Hardware access layer for managing the OSCILLATORS peripheral. More...
Macros | |
#define | NRF_OSCILLATORS_HAS_PLL 1 |
Symbol indicating whether PLL is present. | |
#define | NRF_OSCILLATORS_HAS_CLOCK_QUALITY_IND 1 |
Symbol indicating whether clock quality indicator is present. | |
#define | NRF_OSCILLATORS_HAS_LFXO_CAP_AS_INT_VALUE 1 |
Symbol indicating whether configuration of internal capacitor using integer value is present. | |
#define | NRF_OSCILLATORS_HAS_LFXO_BYPASS 1 |
Symbol indicating whether LFXO bypass is present. | |
#define | OSCILLATORS_HFXO_CAP_CALCULATE(p_ficr_reg, cap_val) |
Macro for calculating HFXO internal capacitor value. | |
#define | OSCILLATORS_LFXO_CAP_CALCULATE(p_ficr_reg, cap_val) |
Macro for calculating LFXO internal capacitor value. | |
#define | NRF_OSCILLATORS_LFXO_CAP_EXTERNAL ((nrf_oscillators_lfxo_cap_t)0) |
Symbol specifying usage of external capacitors. | |
Typedefs | |
typedef uint32_t | nrf_oscillators_lfxo_cap_t |
LFXO capacitance type. | |
Enumerations | |
enum | nrf_oscillators_hfxo_clock_quality_t { NRF_OSCILLATORS_HFXO_CLOCK_QUALITY_NONE = OSCILLATORS_XOSC32M_CLOCKQUALITY_INDICATOR_NoStatus , NRF_OSCILLATORS_HFXO_CLOCK_QUALITY_STARTING = OSCILLATORS_XOSC32M_CLOCKQUALITY_INDICATOR_Starting , NRF_OSCILLATORS_HFXO_CLOCK_QUALITY_STARTED = OSCILLATORS_XOSC32M_CLOCKQUALITY_INDICATOR_Started } |
HFXO clock quality indicator. More... | |
enum | nrf_oscillators_pll_freq_t { NRF_OSCILLATORS_PLL_FREQ_64M = OSCILLATORS_PLL_FREQ_FREQ_CK64M , NRF_OSCILLATORS_PLL_FREQ_128M = OSCILLATORS_PLL_FREQ_FREQ_CK128M } |
PLL frequencies. More... | |
Functions | |
NRF_STATIC_INLINE nrf_oscillators_hfxo_clock_quality_t | nrf_oscillators_hfxo_clock_quality_get (NRF_OSCILLATORS_Type *p_reg) |
Function for reading HFXO clock quality indicator. | |
NRF_STATIC_INLINE void | nrf_oscillators_pll_freq_set (NRF_OSCILLATORS_Type *p_reg, nrf_oscillators_pll_freq_t freq) |
Function for setting PLL frequency. | |
NRF_STATIC_INLINE nrf_oscillators_pll_freq_t | nrf_oscillators_pll_freq_get (NRF_OSCILLATORS_Type *p_reg) |
Function for getting PLL frequency. | |
NRF_STATIC_INLINE void | nrf_oscillators_lfxo_bypass_set (NRF_OSCILLATORS_Type *p_reg, bool enable) |
Function for enabling or disabling the bypass of LFXO with external clock source. | |
NRF_STATIC_INLINE void | nrf_oscillators_lfxo_cap_set (NRF_OSCILLATORS_Type *p_reg, nrf_oscillators_lfxo_cap_t cap) |
Function for configuring the internal capacitors of LFXO. | |
NRF_STATIC_INLINE void | nrf_oscillators_hfxo_cap_set (NRF_OSCILLATORS_Type *p_reg, bool enable, uint32_t cap_value) |
Function for configuring the internal capacitors of HFXO. | |
Hardware access layer for managing the OSCILLATORS peripheral.
#define OSCILLATORS_HFXO_CAP_CALCULATE | ( | p_ficr_reg, | |
cap_val | |||
) |
Macro for calculating HFXO internal capacitor value.
Depending on the SoC used, a range of capacitance of internal capacitors is as follows:
#define OSCILLATORS_LFXO_CAP_CALCULATE | ( | p_ficr_reg, | |
cap_val | |||
) |
Macro for calculating LFXO internal capacitor value.
The capacitance of internal capacitors ranges from 4 pF to 18 pF in 0.5 pF steps. This macro should be used to calculate argument's value for nrf_oscillators_lfxo_cap_set function.
HFXO clock quality indicator.
NRF_STATIC_INLINE void nrf_oscillators_hfxo_cap_set | ( | NRF_OSCILLATORS_Type * | p_reg, |
bool | enable, | ||
uint32_t | cap_value | ||
) |
Function for configuring the internal capacitors of HFXO.
To calculate the correct cap_value
, use OSCILLATORS_HFXO_CAP_CALCULATE macro.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if internal capacitors are to be enabled, false otherwise. |
[in] | cap_value | Value representing capacitance, calculated using provided equation. Ignored when internal capacitors are disabled. |
NRF_STATIC_INLINE nrf_oscillators_hfxo_clock_quality_t nrf_oscillators_hfxo_clock_quality_get | ( | NRF_OSCILLATORS_Type * | p_reg | ) |
Function for reading HFXO clock quality indicator.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_oscillators_lfxo_bypass_set | ( | NRF_OSCILLATORS_Type * | p_reg, |
bool | enable | ||
) |
Function for enabling or disabling the bypass of LFXO with external clock source.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | enable | True if bypass is to be enabled (use with rail-to-rail external source). False if bypass is to be disabled (use with xtal or low-swing external source). |
NRF_STATIC_INLINE void nrf_oscillators_lfxo_cap_set | ( | NRF_OSCILLATORS_Type * | p_reg, |
nrf_oscillators_lfxo_cap_t | cap | ||
) |
Function for configuring the internal capacitors of LFXO.
For SoCs other than nRF5340, to calculate the correct cap_value
, use OSCILLATORS_LFXO_CAP_CALCULATE macro.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cap | Capacitors configuration. |
NRF_STATIC_INLINE nrf_oscillators_pll_freq_t nrf_oscillators_pll_freq_get | ( | NRF_OSCILLATORS_Type * | p_reg | ) |
Function for getting PLL frequency.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_oscillators_pll_freq_set | ( | NRF_OSCILLATORS_Type * | p_reg, |
nrf_oscillators_pll_freq_t | freq | ||
) |
Function for setting PLL frequency.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | freq | New PLL frequency. |