Hardware access layer with cache and barrier support for managing the COMP peripheral. More...
Data Structures | |
struct | nrfy_comp_config_t |
COMP configuration structure. More... | |
Macros | |
#define | NRFY_COMP_HAS_ISOURCE 1 |
Functions | |
NRFY_STATIC_INLINE void | nrfy_comp_periph_configure (NRF_COMP_Type *p_reg, nrfy_comp_config_t const *p_config) |
Function for configuring the COMP. | |
NRFY_STATIC_INLINE void | nrfy_comp_int_init (NRF_COMP_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable) |
Function for initializing the specified COMP interrupts. | |
NRFY_STATIC_INLINE void | nrfy_comp_int_uninit (NRF_COMP_Type *p_reg) |
Function for uninitializing the COMP interrupts. | |
NRFY_STATIC_INLINE uint32_t | nrfy_comp_events_process (NRF_COMP_Type *p_reg, uint32_t mask) |
Function for processing the specified COMP events. | |
NRFY_STATIC_INLINE uint32_t | nrfy_comp_sample (NRF_COMP_Type *p_reg) |
Function for reading the current state of the COMP. | |
NRFY_STATIC_INLINE void | nrfy_comp_enable (NRF_COMP_Type *p_reg) |
NRFY_STATIC_INLINE void | nrfy_comp_disable (NRF_COMP_Type *p_reg) |
NRFY_STATIC_INLINE bool | nrfy_comp_enable_check (NRF_COMP_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_comp_ref_set (NRF_COMP_Type *p_reg, nrf_comp_ref_t reference) |
NRFY_STATIC_INLINE void | nrfy_comp_ext_ref_set (NRF_COMP_Type *p_reg, nrf_comp_ext_ref_t ext_ref) |
NRFY_STATIC_INLINE void | nrfy_comp_th_set (NRF_COMP_Type *p_reg, nrf_comp_th_t threshold) |
NRFY_STATIC_INLINE void | nrfy_comp_main_mode_set (NRF_COMP_Type *p_reg, nrf_comp_main_mode_t main_mode) |
NRFY_STATIC_INLINE void | nrfy_comp_speed_mode_set (NRF_COMP_Type *p_reg, nrf_comp_sp_mode_t speed_mode) |
NRFY_STATIC_INLINE void | nrfy_comp_hysteresis_set (NRF_COMP_Type *p_reg, nrf_comp_hyst_t hyst) |
NRFY_STATIC_INLINE void | nrfy_comp_isource_set (NRF_COMP_Type *p_reg, nrf_isource_t isource) |
NRFY_STATIC_INLINE void | nrfy_comp_input_select (NRF_COMP_Type *p_reg, nrf_comp_input_t input) |
NRFY_STATIC_INLINE uint32_t | nrfy_comp_result_get (NRF_COMP_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_comp_int_enable (NRF_COMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_comp_int_disable (NRF_COMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_comp_int_enable_check (NRF_COMP_Type const *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_comp_task_address_get (NRF_COMP_Type const *p_reg, nrf_comp_task_t task) |
NRFY_STATIC_INLINE uint32_t | nrfy_comp_event_address_get (NRF_COMP_Type const *p_reg, nrf_comp_event_t event) |
NRFY_STATIC_INLINE void | nrfy_comp_shorts_enable (NRF_COMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_comp_shorts_disable (NRF_COMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_comp_task_trigger (NRF_COMP_Type *p_reg, nrf_comp_task_t task) |
NRFY_STATIC_INLINE void | nrfy_comp_event_clear (NRF_COMP_Type *p_reg, nrf_comp_event_t event) |
NRFY_STATIC_INLINE bool | nrfy_comp_event_check (NRF_COMP_Type const *p_reg, nrf_comp_event_t event) |
Hardware access layer with cache and barrier support for managing the COMP peripheral.
#define NRFY_COMP_HAS_ISOURCE 1 |
NRFY_STATIC_INLINE void nrfy_comp_disable | ( | NRF_COMP_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_comp_enable | ( | NRF_COMP_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE bool nrfy_comp_enable_check | ( | NRF_COMP_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | The COMP peripheral is enabled. |
false | The COMP peripheral is not enabled. |
NRFY_STATIC_INLINE uint32_t nrfy_comp_event_address_get | ( | NRF_COMP_Type const * | p_reg, |
nrf_comp_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | COMP event. |
NRFY_STATIC_INLINE bool nrfy_comp_event_check | ( | NRF_COMP_Type const * | p_reg, |
nrf_comp_event_t | 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. |
NRFY_STATIC_INLINE void nrfy_comp_event_clear | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | COMP event to be cleared. |
NRFY_STATIC_INLINE uint32_t nrfy_comp_events_process | ( | NRF_COMP_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for processing the specified COMP events.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK(). |
NRFY_STATIC_INLINE void nrfy_comp_ext_ref_set | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_ext_ref_t | ext_ref | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | ext_ref | COMP external analog reference selection. |
NRFY_STATIC_INLINE void nrfy_comp_hysteresis_set | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_hyst_t | hyst | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | hyst | COMP comparator hysteresis. |
NRFY_STATIC_INLINE void nrfy_comp_input_select | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_input_t | input | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | input | Input to be selected. |
NRFY_STATIC_INLINE void nrfy_comp_int_disable | ( | NRF_COMP_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_comp_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_comp_int_enable | ( | NRF_COMP_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_comp_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE uint32_t nrfy_comp_int_enable_check | ( | NRF_COMP_Type const * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_comp_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_comp_int_init | ( | NRF_COMP_Type * | p_reg, |
uint32_t | mask, | ||
uint8_t | irq_priority, | ||
bool | enable | ||
) |
Function for initializing the specified COMP interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be initialized. |
[in] | irq_priority | Interrupt priority. |
[in] | enable | True if the interrupts are to be enabled, false otherwise. |
NRFY_STATIC_INLINE void nrfy_comp_int_uninit | ( | NRF_COMP_Type * | p_reg | ) |
Function for uninitializing the COMP interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_comp_isource_set | ( | NRF_COMP_Type * | p_reg, |
nrf_isource_t | isource | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | isource | COMP current source selection on analog input. |
NRFY_STATIC_INLINE void nrfy_comp_main_mode_set | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_main_mode_t | main_mode | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | main_mode | COMP main operation mode. |
NRFY_STATIC_INLINE void nrfy_comp_periph_configure | ( | NRF_COMP_Type * | p_reg, |
nrfy_comp_config_t const * | p_config | ||
) |
Function for configuring the COMP.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_config | Pointer to the peripheral configuration structure. |
NRFY_STATIC_INLINE void nrfy_comp_ref_set | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_ref_t | reference | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | reference | COMP reference selection. |
NRFY_STATIC_INLINE uint32_t nrfy_comp_result_get | ( | NRF_COMP_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE uint32_t nrfy_comp_sample | ( | NRF_COMP_Type * | p_reg | ) |
Function for reading the current state of the COMP.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
0 | The input voltage is below the threshold. |
1 | The input voltage is above the threshold. |
NRFY_STATIC_INLINE void nrfy_comp_shorts_disable | ( | NRF_COMP_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of shortcuts. |
NRFY_STATIC_INLINE void nrfy_comp_shorts_enable | ( | NRF_COMP_Type * | p_reg, |
uint32_t | mask | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of shortcuts. |
NRFY_STATIC_INLINE void nrfy_comp_speed_mode_set | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_sp_mode_t | speed_mode | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | speed_mode | COMP speed and power mode. |
NRFY_STATIC_INLINE uint32_t nrfy_comp_task_address_get | ( | NRF_COMP_Type const * | p_reg, |
nrf_comp_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | COMP task. |
NRFY_STATIC_INLINE void nrfy_comp_task_trigger | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | Task to be activated. |
NRFY_STATIC_INLINE void nrfy_comp_th_set | ( | NRF_COMP_Type * | p_reg, |
nrf_comp_th_t | threshold | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | threshold | COMP VDOWN and VUP thresholds. |