Bouffalo SDK  1.0
Bouffalolab Software Development Kit
CLOCK
Collaboration diagram for CLOCK:

Modules

 system clock definition
 

Macros

#define PERIPHERAL_CLOCK_ADC_DAC_ENABLE()
 
#define PERIPHERAL_CLOCK_SEC_ENABLE()
 
#define PERIPHERAL_CLOCK_DMA0_ENABLE()
 
#define PERIPHERAL_CLOCK_UART0_ENABLE()
 
#define PERIPHERAL_CLOCK_UART1_ENABLE()
 
#define PERIPHERAL_CLOCK_SPI0_ENABLE()
 
#define PERIPHERAL_CLOCK_I2C0_ENABLE()
 
#define PERIPHERAL_CLOCK_PWM0_ENABLE()
 
#define PERIPHERAL_CLOCK_TIMER0_1_WDG_ENABLE()
 
#define PERIPHERAL_CLOCK_IR_ENABLE()
 
#define PERIPHERAL_CLOCK_CKS_ENABLE()
 

Functions

uint32_t bflb_clk_get_system_clock (uint8_t type)
 Get system clock frequence. More...
 
uint32_t bflb_clk_get_peripheral_clock (uint8_t type, uint8_t idx)
 Get peripheral clock frequence. More...
 

Detailed Description

Macro Definition Documentation

◆ PERIPHERAL_CLOCK_ADC_DAC_ENABLE

#define PERIPHERAL_CLOCK_ADC_DAC_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 2); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 33 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_CKS_ENABLE

#define PERIPHERAL_CLOCK_CKS_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 23); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 131 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_DMA0_ENABLE

#define PERIPHERAL_CLOCK_DMA0_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 12); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 47 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_I2C0_ENABLE

#define PERIPHERAL_CLOCK_I2C0_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 19); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 93 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_IR_ENABLE

#define PERIPHERAL_CLOCK_IR_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 22); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 124 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_PWM0_ENABLE

#define PERIPHERAL_CLOCK_PWM0_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 20); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 110 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_SEC_ENABLE

#define PERIPHERAL_CLOCK_SEC_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 4); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 40 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_SPI0_ENABLE

#define PERIPHERAL_CLOCK_SPI0_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 18); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 85 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_TIMER0_1_WDG_ENABLE

#define PERIPHERAL_CLOCK_TIMER0_1_WDG_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 21); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 117 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_UART0_ENABLE

#define PERIPHERAL_CLOCK_UART0_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 16); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 59 of file bflb_clock.h.

◆ PERIPHERAL_CLOCK_UART1_ENABLE

#define PERIPHERAL_CLOCK_UART1_ENABLE ( )
Value:
do { \
volatile uint32_t regval = getreg32(BFLB_GLB_CGEN1_BASE); \
regval |= (1 << 17); \
putreg32(regval, BFLB_GLB_CGEN1_BASE); \
} while (0)

Definition at line 66 of file bflb_clock.h.

Function Documentation

◆ bflb_clk_get_peripheral_clock()

uint32_t bflb_clk_get_peripheral_clock ( uint8_t  type,
uint8_t  idx 
)

Get peripheral clock frequence.

Parameters
[in]typeperipheral type
[in]idxperipheral index
Returns
frequence

◆ bflb_clk_get_system_clock()

uint32_t bflb_clk_get_system_clock ( uint8_t  type)

Get system clock frequence.

Parameters
[in]typesystem clock type
Returns
frequence