Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
7979c3ac
Commit
7979c3ac
authored
8 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
cpu/stm32_common: added periph_apb_clk() function
parent
ccb9179c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpu/stm32_common/cpu_common.c
+11
-0
11 additions, 0 deletions
cpu/stm32_common/cpu_common.c
cpu/stm32_common/include/periph_cpu_common.h
+20
-0
20 additions, 0 deletions
cpu/stm32_common/include/periph_cpu_common.h
with
31 additions
and
0 deletions
cpu/stm32_common/cpu_common.c
+
11
−
0
View file @
7979c3ac
...
...
@@ -18,8 +18,19 @@
* @}
*/
#include
"periph_conf.h"
#include
"periph_cpu_common.h"
uint32_t
periph_apb_clk
(
uint8_t
bus
)
{
if
(
bus
==
APB1
)
{
return
CLOCK_APB1
;
}
else
{
return
CLOCK_APB2
;
}
}
void
periph_clk_en
(
uint8_t
bus
,
uint32_t
mask
)
{
if
(
bus
==
APB1
)
{
...
...
This diff is collapsed.
Click to expand it.
cpu/stm32_common/include/periph_cpu_common.h
+
20
−
0
View file @
7979c3ac
...
...
@@ -65,6 +65,26 @@ typedef uint32_t gpio_t;
*/
#define GPIO_PIN(x, y) ((GPIOA_BASE + (x << 10)) | y)
/**
* @brief Timer configuration
*/
typedef
struct
{
TIM_TypeDef
*
dev
;
/**< timer device */
uint32_t
max
;
/**< maximum value to count to (16/32 bit) */
uint32_t
rcc_mask
;
/**< corresponding bit in the RCC register */
uint8_t
bus
;
/**< APBx bus the timer is clock from */
uint8_t
irqn
;
/**< global IRQ channel */
}
timer_conf_t
;
/**
* @brief Get the actual bus clock frequency for the APB buses
*
* @param[in] bus target APBx bus
*
* @return bus clock frequency in Hz
*/
uint32_t
periph_apb_clk
(
uint8_t
bus
);
/**
* @brief Enable the given peripheral clock
*
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment