LPCOMP HALY

group nrfy_lpcomp

Hardware access layer with cache and barrier support for managing the LPCOMP peripheral.

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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • p_config[in] Pointer to the peripheral configuration structure.

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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of interrupts to be initialized.

  • irq_priority[in] Interrupt priority.

  • enable[in] 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.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_events_process(NRF_LPCOMP_Type *p_reg, uint32_t mask)

Function for processing the specified LPCOMP events.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

  • mask[in] Mask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK().

Returns:

Mask of events that were generated and processed. To be checked against the result of NRFY_EVENT_TO_INT_BITMASK().

NRFY_STATIC_INLINE bool nrfy_lpcomp_sample_check(NRF_LPCOMP_Type *p_reg)

Function for reading the current state of the LPCOMP input.

Parameters:
  • p_reg[in] Pointer to the structure of registers of the peripheral.

Return values:
  • false – The input voltage is below the threshold.

  • true – The input voltage is above the threshold.

NRFY_STATIC_INLINE void nrfy_lpcomp_configure(NRF_LPCOMP_Type *p_reg, nrf_lpcomp_config_t const *p_config)

@refhal{nrf_lpcomp_configure}

NRFY_STATIC_INLINE void nrfy_lpcomp_input_select(NRF_LPCOMP_Type *p_reg, nrf_lpcomp_input_t input)

@refhal{nrf_lpcomp_input_select}

NRFY_STATIC_INLINE void nrfy_lpcomp_enable(NRF_LPCOMP_Type *p_reg)

@refhal{nrf_lpcomp_enable}

NRFY_STATIC_INLINE void nrfy_lpcomp_disable(NRF_LPCOMP_Type *p_reg)

@refhal{nrf_lpcomp_disable}

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_result_get(NRF_LPCOMP_Type const *p_reg)

@refhal{nrf_lpcomp_result_get}

NRFY_STATIC_INLINE void nrfy_lpcomp_int_enable(NRF_LPCOMP_Type *p_reg, uint32_t mask)

@refhal{nrf_lpcomp_int_enable}

NRFY_STATIC_INLINE void nrfy_lpcomp_int_disable(NRF_LPCOMP_Type *p_reg, uint32_t mask)

@refhal{nrf_lpcomp_int_disable}

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_int_enable_check(NRF_LPCOMP_Type const *p_reg, uint32_t mask)

@refhal{nrf_lpcomp_int_enable_check}

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_task_address_get(NRF_LPCOMP_Type const *p_reg, nrf_lpcomp_task_t task)

@refhal{nrf_lpcomp_task_address_get}

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_event_address_get(NRF_LPCOMP_Type const *p_reg, nrf_lpcomp_event_t event)

@refhal{nrf_lpcomp_event_address_get}

NRFY_STATIC_INLINE void nrfy_lpcomp_shorts_enable(NRF_LPCOMP_Type *p_reg, uint32_t mask)

@refhal{nrf_lpcomp_shorts_enable}

NRFY_STATIC_INLINE void nrfy_lpcomp_shorts_disable(NRF_LPCOMP_Type *p_reg, uint32_t mask)

@refhal{nrf_lpcomp_shorts_disable}

NRFY_STATIC_INLINE void nrfy_lpcomp_task_trigger(NRF_LPCOMP_Type *p_reg, nrf_lpcomp_task_t task)

@refhal{nrf_lpcomp_task_trigger}

NRFY_STATIC_INLINE void nrfy_lpcomp_event_clear(NRF_LPCOMP_Type *p_reg, nrf_lpcomp_event_t event)

@refhal{nrf_lpcomp_event_clear}

NRFY_STATIC_INLINE bool nrfy_lpcomp_event_check(NRF_LPCOMP_Type const *p_reg, nrf_lpcomp_event_t event)

@refhal{nrf_lpcomp_event_check}

struct nrfy_lpcomp_config_t
#include <nrfy_lpcomp.h>

LPCOMP configuration structure.

Public Members

nrf_lpcomp_config_t config

Peripheral configuration.

nrf_lpcomp_input_t input

Input to be monitored.