Appiko
hal_clocks.h
1 
19 #ifndef CODEBASE_HAL_HAL_CLOCKS_H_
20 #define CODEBASE_HAL_HAL_CLOCKS_H_
21 
31 #include "stdbool.h"
32 #include "nrf.h"
33 
36 typedef enum {
37  LFCLK_SRC_RC = CLOCK_LFCLKSRC_SRC_RC,
38  LFCLK_SRC_Xtal = CLOCK_LFCLKSRC_SRC_Xtal,
39  LFCLK_SRC_Synth = CLOCK_LFCLKSRC_SRC_Synth
40 } lfclk_src_t;
41 
43 #define LFCLK_FREQ 32768
44 
49 void lfclk_init(lfclk_src_t lfclk_src);
50 
56 void lfclk_deinit(void);
57 
61 void hfclk_xtal_init_blocking(void);
62 
66 
71 void hfclk_block_till_xtal(void);
72 
76 void hfclk_xtal_deinit(void);
77 
78 
79 #endif /* CODEBASE_HAL_HAL_CLOCKS_H_ */
80 
lfclk_src_t
Definition: hal_clocks.h:36
void hfclk_xtal_deinit(void)
Function to de-initialize the HF clock from using the crystal. RC oscillator will be used to generate...
Definition: hal_clocks.c:132
Internal RC oscillator.
Definition: hal_clocks.h:37
void lfclk_init(lfclk_src_t lfclk_src)
Function to initialize the LF clock.
Definition: hal_clocks.c:23
void hfclk_xtal_init_nonblocking(void)
Function to initialize the HF clock to use the crystal. This function returns immediately after trigg...
Definition: hal_clocks.c:101
void hfclk_block_till_xtal(void)
Blocks until the HF crystal oscillator is running.
Definition: hal_clocks.c:112
Synthesizer from HFCLK clock.
Definition: hal_clocks.h:39
void lfclk_deinit(void)
Function to de-initialize the LF clock. Saves a bit of power as LF clock is not running,...
Definition: hal_clocks.c:66
void hfclk_xtal_init_blocking(void)
Function to start the crystal oscillator to be used for HF clock. This function blocks until the crys...
Definition: hal_clocks.c:71
External crystal.
Definition: hal_clocks.h:38