|
SmartSnippets DA1459x SDK
|
Go to the documentation of this file.
46 #if dg_configUSE_HW_CLK
102 return REG_GETF(CRG_TOP, CLK_AMBA_REG, HCLK_DIV);
112 return REG_GETF(CRG_TOP, CLK_AMBA_REG, PCLK_DIV);
129 REG_SETF(CRG_TOP, CLK_AMBA_REG, PCLK_DIV, div);
148 case LP_CLK_IS_XTAL32K:
151 case LP_CLK_IS_EXTERNAL:
175 case LP_CLK_IS_XTAL32K:
177 case LP_CLK_IS_EXTERNAL:
195 for (lp_clk = 0; lp_clk < LP_CLK_IS_INVALID; lp_clk++) {
201 return LP_CLK_IS_INVALID;
218 case LP_CLK_IS_XTAL32K:
221 case LP_CLK_IS_EXTERNAL:
244 case LP_CLK_IS_XTAL32K:
247 case LP_CLK_IS_EXTERNAL:
270 case LP_CLK_IS_XTAL32K:
273 case LP_CLK_IS_EXTERNAL:
293 return dg_configRC32M_FREQ;
295 return dg_configXTAL32M_FREQ;
297 return dg_configDBLR64M_FREQ;
__STATIC_INLINE void hw_clk_configure_rcx(void)
Configure RCX. This must be done only once since the register is retained.
Definition: hw_clk_da1459x.h:469
__STATIC_INLINE bool hw_clk_lp_is_xtal32k(void)
Check whether the XTAL32K is the Low Power clock.
Definition: hw_clk_da1459x.h:312
#define REG_SETF(base, reg, field, new_val)
Set the value of a register field.
Definition: sdk_defs.h:738
__STATIC_INLINE void hw_clk_set_lpclk(lp_clk_is_t mode)
Set Low Power clock.
Definition: hw_clk.h:138
Divide by 2.
Definition: hw_clk.h:77
RC32.
Definition: hw_clk_da1459x.h:130
Divide by 4.
Definition: hw_clk.h:78
enum apbdiv_type apb_div_t
The AMBA Peripheral Bus (APB) clock divider.
__STATIC_INLINE void hw_clk_enable_rcx(void)
Enable RCX but does not set it as the LP clock.
Definition: hw_clk_da1459x.h:477
Central include header file with platform definitions.
Divide by 2.
Definition: hw_clk.h:89
__STATIC_FORCEINLINE uint32_t hw_clk_get_sys_clk_freq(sys_clk_t sys_clk)
Get the system clock frequency.
Definition: hw_clk.h:289
__STATIC_INLINE void hw_clk_enable_xtal32k(void)
Enable XTAL32K but do not set it as the LP clock.
Definition: hw_clk_da1459x.h:512
__STATIC_INLINE void hw_clk_lp_set_ext32k(void)
Set an external digital clock as the Low Power clock.
Definition: hw_clk_da1459x.h:388
__STATIC_INLINE void hw_clk_configure_lpclk(lp_clk_is_t clk)
Configure a Low Power clock. This must be done only once since the register is retained.
Definition: hw_clk.h:209
Divide by 1.
Definition: hw_clk.h:88
__STATIC_INLINE void hw_clk_configure_xtal32k(void)
Configure XTAL32K. This must be done only once since the register is retained.
Definition: hw_clk_da1459x.h:497
32MHz
Definition: hw_clk_da1459x.h:131
__STATIC_INLINE bool hw_clk_lp_is_rclp(void)
Check whether the RCLP is the Low Power clock.
Definition: hw_clk_da1459x.h:323
Divide by 8.
Definition: hw_clk.h:91
lp_clk_is_type
The type of the LP clock.
Definition: hw_clk.h:60
__STATIC_FORCEINLINE apb_div_t hw_clk_get_pclk_div(void)
Get the divider of the AMBA Peripheral Bus.
Definition: hw_clk.h:110
__STATIC_INLINE void hw_clk_disable_xtal32k(void)
Disable XTAL32K.
Definition: hw_clk_da1459x.h:522
Clock Driver header file.
__STATIC_INLINE void hw_clk_disable_rcx(void)
Disable RCX.
Definition: hw_clk_da1459x.h:487
__STATIC_INLINE void hw_clk_enable_rclp(void)
Enable RCLP.
Definition: hw_clk_da1459x.h:433
ahbdiv_type
The AMBA High-Performance Bus (AHB) clock divider.
Definition: hw_clk.h:75
__STATIC_FORCEINLINE ahb_div_t hw_clk_get_hclk_div(void)
Get the divider of the AMBA High Speed Bus.
Definition: hw_clk.h:100
enum sysclk_type sys_clk_t
The system clock type.
__STATIC_INLINE void hw_clk_disable_lpclk(lp_clk_is_t clk)
Deactivate a Low Power clock.
Definition: hw_clk.h:261
__STATIC_INLINE bool hw_clk_lpclk_is(lp_clk_is_t clk)
Check whether a clock is the Low Power clock.
Definition: hw_clk.h:168
enum ahbdiv_type ahb_div_t
The AMBA High-Performance Bus (AHB) clock divider.
__RETAINED_CODE void hw_clk_delay_usec(uint32_t usec)
Add delay of N usecs.
Divide by 8.
Definition: hw_clk.h:79
HW_GPIO_MODE mode
Definition: hw_gpio.h:211
__STATIC_INLINE bool hw_clk_lp_is_external(void)
Check whether the RCX is the Low Power clock.
Definition: hw_clk_da1459x.h:345
__STATIC_INLINE void hw_clk_enable_lpclk(lp_clk_is_t clk)
Activate a Low Power clock.
Definition: hw_clk.h:235
__STATIC_INLINE bool hw_clk_lp_is_rcx(void)
Check whether the RCX is the Low Power clock.
Definition: hw_clk_da1459x.h:334
#define GLOBAL_INT_RESTORE()
Macro to restore all interrupts.
Definition: sdk_defs.h:477
__STATIC_INLINE void hw_clk_lp_set_xtal32k(void)
Set XTAL32K as the Low Power clock.
Definition: hw_clk_da1459x.h:374
64MHz
Definition: hw_clk_da1459x.h:132
#define REG_GETF(base, reg, field)
Return the value of a register field.
Definition: sdk_defs.h:711
__STATIC_INLINE void hw_clk_disable_rclp(void)
Disable RCLP.
Definition: hw_clk_da1459x.h:443
enum lp_clk_is_type lp_clk_is_t
The type of the LP clock.
__STATIC_INLINE void hw_clk_lp_set_rcx(void)
Set RCX as the Low Power clock.
Definition: hw_clk_da1459x.h:358
__STATIC_INLINE void hw_clk_lp_set_rclp(void)
Set RCLP as the Low Power clock.
Definition: hw_clk_da1459x.h:458
Divide by 4.
Definition: hw_clk.h:90
__STATIC_INLINE lp_clk_is_t hw_clk_get_lpclk(void)
Return the clock used as the Low Power clock.
Definition: hw_clk.h:192
Divide by 1.
Definition: hw_clk.h:76
__STATIC_FORCEINLINE void hw_clk_set_pclk_div(apb_div_t div)
Set the divider of the AMBA Peripheral Bus.
Definition: hw_clk.h:123
apbdiv_type
The AMBA Peripheral Bus (APB) clock divider.
Definition: hw_clk.h:87
#define GLOBAL_INT_DISABLE()
Macro to disable all interrupts.
Definition: sdk_defs.h:452
Divide by 16.
Definition: hw_clk.h:80
__RETAINED_CODE uint32_t hw_clk_get_sysclk_freq(void)
Get current system clock's frequency.