Loading...
Searching...
No Matches
cpu_common.h File Reference

Common CPU definitions for the STM32 family. More...

Detailed Description

Common CPU definitions for the STM32 family.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de
Vincent Dupont vince.nosp@m.nt@o.nosp@m.takey.nosp@m.s.co.nosp@m.m

Definition in file cpu_common.h.

#include <stdint.h>
+ Include dependency graph for cpu_common.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define CPUID_LEN   (12U)
 Length of the CPU_ID in octets.
 
#define CPUID_ADDR   (UID_BASE)
 Starting address of the CPU ID.
 
enum  bus_t { APB1 , APB2 }
 CPU specific LSI clock speed. More...
 
uint32_t periph_apb_clk (bus_t bus)
 Get the actual bus clock frequency for the APB buses.
 
uint32_t periph_timer_clk (bus_t bus)
 Get the actual timer clock frequency.
 
void periph_clk_en (bus_t bus, uint32_t mask)
 Enable the given peripheral clock.
 
void periph_clk_dis (bus_t bus, uint32_t mask)
 Disable the given peripheral clock.
 
void periph_lpclk_en (bus_t bus, uint32_t mask)
 Enable the given peripheral clock in low power mode.
 
void periph_lpclk_dis (bus_t bus, uint32_t mask)
 Disable the given peripheral clock in low power mode.
 

Macro Definition Documentation

◆ CPUID_ADDR

#define CPUID_ADDR   (UID_BASE)

Starting address of the CPU ID.

Definition at line 49 of file cpu_common.h.

◆ CPUID_LEN

#define CPUID_LEN   (12U)

Length of the CPU_ID in octets.

This is the same for all members of the stm32 family

Definition at line 43 of file cpu_common.h.

Enumeration Type Documentation

◆ bus_t

enum bus_t

CPU specific LSI clock speed.

Available peripheral buses

Enumerator
APB1 

APB1 bus.

APB2 

APB2 bus.

Definition at line 74 of file cpu_common.h.

Function Documentation

◆ periph_apb_clk()

uint32_t periph_apb_clk ( bus_t  bus)

Get the actual bus clock frequency for the APB buses.

Parameters
[in]bustarget APBx bus
Returns
bus clock frequency in Hz

◆ periph_clk_dis()

void periph_clk_dis ( bus_t  bus,
uint32_t  mask 
)

Disable the given peripheral clock.

Parameters
[in]busbus the peripheral is connected to
[in]maskbit in the RCC enable register

◆ periph_clk_en()

void periph_clk_en ( bus_t  bus,
uint32_t  mask 
)

Enable the given peripheral clock.

Parameters
[in]busbus the peripheral is connected to
[in]maskbit in the RCC enable register

◆ periph_lpclk_dis()

void periph_lpclk_dis ( bus_t  bus,
uint32_t  mask 
)

Disable the given peripheral clock in low power mode.

Parameters
[in]busbus the peripheral is connected to
[in]maskbit in the RCC enable register

◆ periph_lpclk_en()

void periph_lpclk_en ( bus_t  bus,
uint32_t  mask 
)

Enable the given peripheral clock in low power mode.

Parameters
[in]busbus the peripheral is connected to
[in]maskbit in the RCC enable register

◆ periph_timer_clk()

uint32_t periph_timer_clk ( bus_t  bus)

Get the actual timer clock frequency.

Parameters
[in]buscorresponding APBx bus
Returns
timer clock frequency in Hz