Hardware access layer with cache and barrier support for managing the LPCOMP peripheral. More...
Data Structures | |
struct | nrfy_lpcomp_config_t |
LPCOMP configuration structure. More... | |
Functions | |
NRFY_STATIC_INLINE void | nrfy_lpcomp_periph_configure (NRF_LPCOMP_Type *p_reg, nrfy_lpcomp_config_t const *p_config) |
Function for configuring the LPCOMP. | |
NRFY_STATIC_INLINE void | nrfy_lpcomp_int_init (NRF_LPCOMP_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable) |
Function for initializing the specified LPCOMP interrupts. | |
NRFY_STATIC_INLINE void | nrfy_lpcomp_int_uninit (NRF_LPCOMP_Type *p_reg) |
Function for uninitializing the LPCOMP interrupts. | |
NRFY_STATIC_INLINE uint32_t | nrfy_lpcomp_events_process (NRF_LPCOMP_Type *p_reg, uint32_t mask) |
Function for processing the specified LPCOMP events. | |
NRFY_STATIC_INLINE bool | nrfy_lpcomp_sample_check (NRF_LPCOMP_Type *p_reg) |
Function for reading the current state of the LPCOMP input. | |
NRFY_STATIC_INLINE void | nrfy_lpcomp_ref_set (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_ref_t reference) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_ext_ref_set (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_ext_ref_t ext_ref) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_detection_set (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_detect_t detection) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_hysteresis_set (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_hyst_t hyst) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_configure (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_config_t const *p_config) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_input_select (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_input_t input) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_enable (NRF_LPCOMP_Type *p_reg) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_disable (NRF_LPCOMP_Type *p_reg) |
NRFY_STATIC_INLINE uint32_t | nrfy_lpcomp_result_get (NRF_LPCOMP_Type const *p_reg) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_int_enable (NRF_LPCOMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_int_disable (NRF_LPCOMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_lpcomp_int_enable_check (NRF_LPCOMP_Type const *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE uint32_t | nrfy_lpcomp_task_address_get (NRF_LPCOMP_Type const *p_reg, nrf_lpcomp_task_t task) |
NRFY_STATIC_INLINE uint32_t | nrfy_lpcomp_event_address_get (NRF_LPCOMP_Type const *p_reg, nrf_lpcomp_event_t event) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_shorts_enable (NRF_LPCOMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_shorts_disable (NRF_LPCOMP_Type *p_reg, uint32_t mask) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_task_trigger (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_task_t task) |
NRFY_STATIC_INLINE void | nrfy_lpcomp_event_clear (NRF_LPCOMP_Type *p_reg, nrf_lpcomp_event_t event) |
NRFY_STATIC_INLINE bool | nrfy_lpcomp_event_check (NRF_LPCOMP_Type const *p_reg, nrf_lpcomp_event_t event) |
Hardware access layer with cache and barrier support for managing the LPCOMP peripheral.
NRFY_STATIC_INLINE void nrfy_lpcomp_configure | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_config_t const * | p_config | ||
) |
This function powers on LPCOMP and configures it. LPCOMP is in DISABLE state after configuration, so it must be enabled before using it. All shorts are inactive, events are cleared, and LPCOMP is stopped.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_config | Configuration. |
NRFY_STATIC_INLINE void nrfy_lpcomp_detection_set | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_detect_t | detection | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | detection | LPCOMP detection type. |
NRFY_STATIC_INLINE void nrfy_lpcomp_disable | ( | NRF_LPCOMP_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_lpcomp_enable | ( | NRF_LPCOMP_Type * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_event_address_get | ( | NRF_LPCOMP_Type const * | p_reg, |
nrf_lpcomp_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | LPCOMP event. |
NRFY_STATIC_INLINE bool nrfy_lpcomp_event_check | ( | NRF_LPCOMP_Type const * | p_reg, |
nrf_lpcomp_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_lpcomp_event_clear | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_event_t | event | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | LPCOMP event to be cleared. |
NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_events_process | ( | NRF_LPCOMP_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for processing the specified LPCOMP 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_lpcomp_ext_ref_set | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_ext_ref_t | ext_ref | ||
) |
To use external reference first call nrf_lpcomp_ref_set with NRF_LPCOMP_REF_EXT_REF argument.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | ext_ref | LPCOMP external analog reference selection. |
NRFY_STATIC_INLINE void nrfy_lpcomp_hysteresis_set | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_hyst_t | hyst | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | hyst | LPCOMP comparator hysteresis. |
NRFY_STATIC_INLINE void nrfy_lpcomp_input_select | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_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_lpcomp_int_disable | ( | NRF_LPCOMP_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_lpcomp_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_lpcomp_int_enable | ( | NRF_LPCOMP_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_lpcomp_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_int_enable_check | ( | NRF_LPCOMP_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_lpcomp_int_mask_t values for bit masking. |
NRFY_STATIC_INLINE void nrfy_lpcomp_int_init | ( | NRF_LPCOMP_Type * | p_reg, |
uint32_t | mask, | ||
uint8_t | irq_priority, | ||
bool | enable | ||
) |
Function for initializing the specified LPCOMP 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_lpcomp_int_uninit | ( | NRF_LPCOMP_Type * | p_reg | ) |
Function for uninitializing the LPCOMP interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE void nrfy_lpcomp_periph_configure | ( | NRF_LPCOMP_Type * | p_reg, |
nrfy_lpcomp_config_t const * | p_config | ||
) |
Function for configuring the LPCOMP.
[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_lpcomp_ref_set | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_ref_t | reference | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | reference | LPCOMP reference selection. |
NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_result_get | ( | NRF_LPCOMP_Type const * | p_reg | ) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRFY_STATIC_INLINE bool nrfy_lpcomp_sample_check | ( | NRF_LPCOMP_Type * | p_reg | ) |
Function for reading the current state of the LPCOMP input.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
false | The input voltage is below the threshold. |
true | The input voltage is above the threshold. |
NRFY_STATIC_INLINE void nrfy_lpcomp_shorts_disable | ( | NRF_LPCOMP_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_lpcomp_shorts_enable | ( | NRF_LPCOMP_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 uint32_t nrfy_lpcomp_task_address_get | ( | NRF_LPCOMP_Type const * | p_reg, |
nrf_lpcomp_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | LPCOMP task. |
NRFY_STATIC_INLINE void nrfy_lpcomp_task_trigger | ( | NRF_LPCOMP_Type * | p_reg, |
nrf_lpcomp_task_t | task | ||
) |
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | task | LPCOMP task to be set. |