Hardware access layer for managing the High Frequency Crystal Oscillator (HFXO). More...
Data Structures | |
struct | nrf_hfxo_status_t |
HFXO status. More... | |
Macros | |
#define | NRF_HFXO_IDAC_HAS_MAX_SETTLETIME_40US 1 |
Symbol indicating whether IDAC maximum settling time is equal to 40us. | |
Enumerations | |
enum | nrf_hfxo_event_t { NRF_HFXO_EVENT_MODECHANGED = offsetof(NRF_HFXO_Type, EVENTS_MODECHANGED) , NRF_HFXO_EVENT_ERRORPIERCE = offsetof(NRF_HFXO_Type, EVENTS_ERRORPIERCE) , NRF_HFXO_EVENT_ERRORRUNNING = offsetof(NRF_HFXO_Type, EVENTS_ERRORRUNNING) } |
HFXO events. More... | |
enum | nrf_hfxo_int_mask_t { NRF_HFXO_INT_MODECHANGED_MASK = HFXO_INTENSET_MODECHANGED_Msk , NRF_HFXO_INT_ERRORPIERCE_MASK = HFXO_INTENSET_ERRORPIERCE_Msk , NRF_HFXO_INT_ERRORRUNNING_MASK = HFXO_INTENSET_ERRORRUNNING_Msk } |
HFXO interrupts. More... | |
enum | nrf_hfxo_status_mode_t { NRF_HFXO_STATUS_MODE_PIERCE = HFXO_STATUS_MODE_Pierce , NRF_HFXO_STATUS_MODE_PIXO = HFXO_STATUS_MODE_Pixo , NRF_HFXO_STATUS_MODE_EXT_SINE = HFXO_STATUS_MODE_ExternalSine , NRF_HFXO_STATUS_MODE_EXT_SQUARE = HFXO_STATUS_MODE_ExternalSquare } |
HFXO status modes. More... | |
enum | nrf_hfxo_mode_t { NRF_HFXO_MODE_AUTO = HFXO_MODE_MODE_Auto , NRF_HFXO_MODE_PIERCE = HFXO_MODE_MODE_Pierce , NRF_HFXO_MODE_PIXO = HFXO_MODE_MODE_Pixo , NRF_HFXO_MODE_EXT_SINE = HFXO_MODE_MODE_ExternalSine , NRF_HFXO_MODE_EXT_SQUARE = HFXO_MODE_MODE_ExternalSquare } |
HFXO modes. More... | |
enum | nrf_hfxo_power_control_t { NRF_HFXO_POWER_CONTROL_AUTO = HFXO_PWRUPCTRL_CTRL_Auto , NRF_HFXO_POWER_CONTROL_POWER_UP = HFXO_PWRUPCTRL_CTRL_PowerUp , NRF_HFXO_POWER_CONTROL_POWER_DOWN = HFXO_PWRUPCTRL_CTRL_PowerDown } |
Power up control modes. More... | |
enum | nrf_hfxo_idac_period_t { NRF_HFXO_IDAC_PERIOD_31US = HFXO_IDAC_CHECKPERIOD_VAL_val31us , NRF_HFXO_IDAC_PERIOD_61US = HFXO_IDAC_CHECKPERIOD_VAL_val61us , NRF_HFXO_IDAC_PERIOD_122US = HFXO_IDAC_CHECKPERIOD_VAL_val122us , NRF_HFXO_IDAC_PERIOD_244US = HFXO_IDAC_CHECKPERIOD_VAL_val244us , NRF_HFXO_IDAC_PERIOD_488US = HFXO_IDAC_CHECKPERIOD_VAL_val488us , NRF_HFXO_IDAC_PERIOD_977US = HFXO_IDAC_CHECKPERIOD_VAL_val977us , NRF_HFXO_IDAC_PERIOD_1953US = HFXO_IDAC_CHECKPERIOD_VAL_val1953us , NRF_HFXO_IDAC_PERIOD_3906US = HFXO_IDAC_CHECKPERIOD_VAL_val3906us } |
Period value for the IDAC check. More... | |
enum | nrf_hfxo_idac_settle_time_t { NRF_HFXO_IDAC_SETTLE_TIME_5US = HFXO_IDAC_SETTLETIME_VAL_val5us , NRF_HFXO_IDAC_SETTLE_TIME_10US = HFXO_IDAC_SETTLETIME_VAL_val10us , NRF_HFXO_IDAC_SETTLE_TIME_15US = HFXO_IDAC_SETTLETIME_VAL_val15us , NRF_HFXO_IDAC_SETTLE_TIME_20US = HFXO_IDAC_SETTLETIME_VAL_val20us , NRF_HFXO_IDAC_SETTLE_TIME_25US = HFXO_IDAC_SETTLETIME_VAL_val25us , NRF_HFXO_IDAC_SETTLE_TIME_30US = HFXO_IDAC_SETTLETIME_VAL_val30us , NRF_HFXO_IDAC_SETTLE_TIME_35US = HFXO_IDAC_SETTLETIME_VAL_val35us , NRF_HFXO_IDAC_SETTLE_TIME_40US = HFXO_IDAC_SETTLETIME_VAL_val40us } |
Period value for the IDAC check. More... | |
Functions | |
NRF_STATIC_INLINE uint32_t | nrf_hfxo_event_address_get (NRF_HFXO_Type const *p_reg, nrf_hfxo_event_t event) |
Function for retrieving the address of the specified event. | |
NRF_STATIC_INLINE void | nrf_hfxo_event_clear (NRF_HFXO_Type *p_reg, nrf_hfxo_event_t event) |
Function for clearing the specified event. | |
NRF_STATIC_INLINE bool | nrf_hfxo_event_check (NRF_HFXO_Type const *p_reg, nrf_hfxo_event_t event) |
Function for retrieving the state of the specified event. | |
NRF_STATIC_INLINE void | nrf_hfxo_int_enable (NRF_HFXO_Type *p_reg, uint32_t mask) |
Function for enabling the specified interrupt. | |
NRF_STATIC_INLINE void | nrf_hfxo_int_disable (NRF_HFXO_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupt. | |
NRF_STATIC_INLINE uint32_t | nrf_hfxo_int_enable_check (NRF_HFXO_Type const *p_reg, uint32_t mask) |
Function for checking if the specified interrupts are enabled. | |
NRF_STATIC_INLINE uint32_t | nrf_hfxo_int_pending_get (NRF_HFXO_Type const *p_reg) |
Function for retrieving the state of pending interrupts. | |
NRF_STATIC_INLINE void | nrf_hfxo_status_get (NRF_HFXO_Type const *p_reg, nrf_hfxo_status_t *p_status) |
Function for getting HFXO status. | |
NRF_STATIC_INLINE uint8_t | nrf_hfxo_cload_get (NRF_HFXO_Type const *p_reg) |
Function for getting internal capacitive load value. | |
NRF_STATIC_INLINE void | nrf_hfxo_cload_set (NRF_HFXO_Type *p_reg, uint8_t cap) |
Function for setting internal capacitive load value. | |
NRF_STATIC_INLINE uint8_t | nrf_hfxo_amplitude_control_get (NRF_HFXO_Type const *p_reg) |
Function for getting amplitude control configuration. | |
NRF_STATIC_INLINE void | nrf_hfxo_amplitude_control_set (NRF_HFXO_Type *p_reg, uint8_t amplitude) |
Function for setting amplitude control configuration. | |
NRF_STATIC_INLINE void | nrf_hfxo_power_control_set (NRF_HFXO_Type *p_reg, nrf_hfxo_power_control_t pwrctrl, bool bypass_0V8, bool bypass_1V5) |
Function for setting the power control configuration. | |
NRF_STATIC_INLINE void | nrf_hfxo_mode_set (NRF_HFXO_Type *p_reg, nrf_hfxo_mode_t oscmode) |
Function for setting HFXO mode. | |
NRF_STATIC_INLINE uint8_t | nrf_hfxo_peak_det_thr_get (NRF_HFXO_Type const *p_reg) |
Function for getting the peak detector threshold value. | |
NRF_STATIC_INLINE void | nrf_hfxo_peak_det_thr_set (NRF_HFXO_Type *p_reg, uint8_t thr) |
Function for setting the peak detector threshold value. | |
NRF_STATIC_INLINE uint16_t | nrf_hfxo_startup_pulses_get (NRF_HFXO_Type const *p_reg) |
Function for getting the number of injected pulses during HFXO startup. | |
NRF_STATIC_INLINE void | nrf_hfxo_startup_pulses_set (NRF_HFXO_Type *p_reg, uint16_t pulses) |
Function for setting the number of injected pulses during HFXO startup. | |
NRF_STATIC_INLINE void | nrf_hfxo_idac_init_value_set (NRF_HFXO_Type *p_reg, uint8_t init_val) |
Function for setting the initial IDAC code for the Pierce oscillator. | |
NRF_STATIC_INLINE void | nrf_hfxo_idac_ratio_set (NRF_HFXO_Type *p_reg, uint8_t ratio) |
Function for setting the ratio between IDAC and AREG in the Pierce AREG mode. | |
NRF_STATIC_INLINE void | nrf_hfxo_idac_check_set (NRF_HFXO_Type *p_reg, nrf_hfxo_idac_period_t period, bool enable) |
Function for setting the period for the IDAC check in Pierce mode. | |
NRF_STATIC_INLINE void | nrf_hfxo_idac_settling_time_set (NRF_HFXO_Type *p_reg, nrf_hfxo_idac_settle_time_t time) |
Function for setting the settling time for IDAC current changes. | |
Hardware access layer for managing the High Frequency Crystal Oscillator (HFXO).
enum nrf_hfxo_event_t |
Period value for the IDAC check.
Period value for the IDAC check.
enum nrf_hfxo_int_mask_t |
enum nrf_hfxo_mode_t |
NRF_STATIC_INLINE uint8_t nrf_hfxo_amplitude_control_get | ( | NRF_HFXO_Type const * | p_reg | ) |
Function for getting amplitude control configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_hfxo_amplitude_control_set | ( | NRF_HFXO_Type * | p_reg, |
uint8_t | amplitude | ||
) |
Function for setting amplitude control configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | amplitude | Voltage amplitude setting for Pierce AREG mode (range 0 to 7, where 0 is 244 mV, up to 7 which is 470 mV). |
NRF_STATIC_INLINE uint8_t nrf_hfxo_cload_get | ( | NRF_HFXO_Type const * | p_reg | ) |
Function for getting internal capacitive load value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_hfxo_cload_set | ( | NRF_HFXO_Type * | p_reg, |
uint8_t | cap | ||
) |
Function for setting internal capacitive load value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | cap | Total capacitance in pF. |
NRF_STATIC_INLINE uint32_t nrf_hfxo_event_address_get | ( | NRF_HFXO_Type const * | p_reg, |
nrf_hfxo_event_t | event | ||
) |
Function for retrieving the address of the specified event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | HFXO Event. |
NRF_STATIC_INLINE bool nrf_hfxo_event_check | ( | NRF_HFXO_Type const * | p_reg, |
nrf_hfxo_event_t | event | ||
) |
Function for retrieving the state of the specified event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be checked. |
true | The event has been generated. |
false | The event has not been generated. |
NRF_STATIC_INLINE void nrf_hfxo_event_clear | ( | NRF_HFXO_Type * | p_reg, |
nrf_hfxo_event_t | event | ||
) |
Function for clearing the specified event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to clear. |
NRF_STATIC_INLINE void nrf_hfxo_idac_check_set | ( | NRF_HFXO_Type * | p_reg, |
nrf_hfxo_idac_period_t | period, | ||
bool | enable | ||
) |
Function for setting the period for the IDAC check in Pierce mode.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | period | Period value for the IDAC check. |
[in] | enable | Enable IDAC check. |
NRF_STATIC_INLINE void nrf_hfxo_idac_init_value_set | ( | NRF_HFXO_Type * | p_reg, |
uint8_t | init_val | ||
) |
Function for setting the initial IDAC code for the Pierce oscillator.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | init_val | Initial IDAC code for the Pierce oscillator. |
NRF_STATIC_INLINE void nrf_hfxo_idac_ratio_set | ( | NRF_HFXO_Type * | p_reg, |
uint8_t | ratio | ||
) |
Function for setting the ratio between IDAC and AREG in the Pierce AREG mode.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | ratio | Ratio between IDAC and AREG. |
NRF_STATIC_INLINE void nrf_hfxo_idac_settling_time_set | ( | NRF_HFXO_Type * | p_reg, |
nrf_hfxo_idac_settle_time_t | time | ||
) |
Function for setting the settling time for IDAC current changes.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | time | Settle time. |
NRF_STATIC_INLINE void nrf_hfxo_int_disable | ( | NRF_HFXO_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling the specified interrupt.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_hfxo_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_hfxo_int_enable | ( | NRF_HFXO_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling the specified interrupt.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_hfxo_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_hfxo_int_enable_check | ( | NRF_HFXO_Type const * | p_reg, |
uint32_t | mask | ||
) |
Function for checking if the specified interrupts are enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_hfxo_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_hfxo_int_pending_get | ( | NRF_HFXO_Type const * | p_reg | ) |
Function for retrieving the state of pending interrupts.
States of pending interrupt are saved as a bitmask. One set at particular position means that interrupt for event is pending.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_hfxo_mode_set | ( | NRF_HFXO_Type * | p_reg, |
nrf_hfxo_mode_t | oscmode | ||
) |
Function for setting HFXO mode.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | oscmode | Oscillator mode. |
NRF_STATIC_INLINE uint8_t nrf_hfxo_peak_det_thr_get | ( | NRF_HFXO_Type const * | p_reg | ) |
Function for getting the peak detector threshold value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_hfxo_peak_det_thr_set | ( | NRF_HFXO_Type * | p_reg, |
uint8_t | thr | ||
) |
Function for setting the peak detector threshold value.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | thr | Peak detector threshold value. |
NRF_STATIC_INLINE void nrf_hfxo_power_control_set | ( | NRF_HFXO_Type * | p_reg, |
nrf_hfxo_power_control_t | pwrctrl, | ||
bool | bypass_0V8, | ||
bool | bypass_1V5 | ||
) |
Function for setting the power control configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pwrctrl | Power up control mode. |
[in] | bypass_0V8 | Enable bypass 0.8 V voltage regulator. |
[in] | bypass_1V5 | Enable bypass 1.5 V voltage regulator. |
NRF_STATIC_INLINE uint16_t nrf_hfxo_startup_pulses_get | ( | NRF_HFXO_Type const * | p_reg | ) |
Function for getting the number of injected pulses during HFXO startup.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_hfxo_startup_pulses_set | ( | NRF_HFXO_Type * | p_reg, |
uint16_t | pulses | ||
) |
Function for setting the number of injected pulses during HFXO startup.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pulses | Number of 16MHz clock pulses injected in Pierce mode during HFXO startup. |
NRF_STATIC_INLINE void nrf_hfxo_status_get | ( | NRF_HFXO_Type const * | p_reg, |
nrf_hfxo_status_t * | p_status | ||
) |
Function for getting HFXO status.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_status | Pointer to the structure to be filled with HFXO status. |