nrfx 3.3
Data Structures | Functions
LPCOMP HALY

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)
 

Detailed Description

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

Function Documentation

◆ nrfy_lpcomp_configure()

NRFY_STATIC_INLINE void nrfy_lpcomp_configure ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_config_t const *  p_config 
)
See also
nrf_lpcomp_configure Function for configuring LPCOMP.

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.

Deprecated:
Use the dedicated functions instead.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configConfiguration.

◆ nrfy_lpcomp_detection_set()

NRFY_STATIC_INLINE void nrfy_lpcomp_detection_set ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_detect_t  detection 
)
See also
nrf_lpcomp_detection_set Function for setting the detection type.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]detectionLPCOMP detection type.

◆ nrfy_lpcomp_disable()

NRFY_STATIC_INLINE void nrfy_lpcomp_disable ( NRF_LPCOMP_Type *  p_reg)
See also
nrf_lpcomp_disable Function for disabling the LPCOMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_lpcomp_enable()

NRFY_STATIC_INLINE void nrfy_lpcomp_enable ( NRF_LPCOMP_Type *  p_reg)
See also
nrf_lpcomp_enable Function for enabling the LPCOMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_lpcomp_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_event_address_get ( NRF_LPCOMP_Type const *  p_reg,
nrf_lpcomp_event_t  event 
)
See also
nrf_lpcomp_event_address_get Function for getting the address of the specified LPCOMP event register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventLPCOMP event.
Returns
The address of the specified LPCOMP event.

◆ nrfy_lpcomp_event_check()

NRFY_STATIC_INLINE bool nrfy_lpcomp_event_check ( NRF_LPCOMP_Type const *  p_reg,
nrf_lpcomp_event_t  event 
)
See also
nrf_lpcomp_event_check Function for retrieving the state of the LPCOMP event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrfy_lpcomp_event_clear()

NRFY_STATIC_INLINE void nrfy_lpcomp_event_clear ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_event_t  event 
)
See also
nrf_lpcomp_event_clear Function for clearing the specified LPCOMP event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventLPCOMP event to be cleared.

◆ nrfy_lpcomp_events_process()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask 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_lpcomp_ext_ref_set()

NRFY_STATIC_INLINE void nrfy_lpcomp_ext_ref_set ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_ext_ref_t  ext_ref 
)
See also
nrf_lpcomp_ext_ref_set Function for setting the external analog reference source.

To use external reference first call nrf_lpcomp_ref_set with NRF_LPCOMP_REF_EXT_REF argument.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]ext_refLPCOMP external analog reference selection.

◆ nrfy_lpcomp_hysteresis_set()

NRFY_STATIC_INLINE void nrfy_lpcomp_hysteresis_set ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_hyst_t  hyst 
)
See also
nrf_lpcomp_hysteresis_set Function for setting the hysteresis.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]hystLPCOMP comparator hysteresis.

◆ nrfy_lpcomp_input_select()

NRFY_STATIC_INLINE void nrfy_lpcomp_input_select ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_input_t  input 
)
See also
nrf_lpcomp_input_select Function for selecting an active LPCOMP input.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]inputInput to be selected.

◆ nrfy_lpcomp_int_disable()

NRFY_STATIC_INLINE void nrfy_lpcomp_int_disable ( NRF_LPCOMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_lpcomp_int_disable Function for disabling interrupts from LPCOMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_lpcomp_int_mask_t values for bit masking.
See also
nrf_lpcomp_int_enable
nrf_lpcomp_int_enable_check

◆ nrfy_lpcomp_int_enable()

NRFY_STATIC_INLINE void nrfy_lpcomp_int_enable ( NRF_LPCOMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_lpcomp_int_enable Function for enabling interrupts from LPCOMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_lpcomp_int_mask_t values for bit masking.
See also
nrf_lpcomp_int_disable
nrf_lpcomp_int_enable_check

◆ nrfy_lpcomp_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_int_enable_check ( NRF_LPCOMP_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_lpcomp_int_enable_check Function for checking if the specified interrupts are enabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked. Use nrf_lpcomp_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_lpcomp_int_init()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be initialized.
[in]irq_priorityInterrupt priority.
[in]enableTrue if the interrupts are to be enabled, false otherwise.

◆ nrfy_lpcomp_int_uninit()

NRFY_STATIC_INLINE void nrfy_lpcomp_int_uninit ( NRF_LPCOMP_Type *  p_reg)

Function for uninitializing the LPCOMP interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_lpcomp_periph_configure()

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
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_configPointer to the peripheral configuration structure.

◆ nrfy_lpcomp_ref_set()

NRFY_STATIC_INLINE void nrfy_lpcomp_ref_set ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_ref_t  reference 
)
See also
nrf_lpcomp_ref_set Function for setting the reference source.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]referenceLPCOMP reference selection.

◆ nrfy_lpcomp_result_get()

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_result_get ( NRF_LPCOMP_Type const *  p_reg)
See also
nrf_lpcomp_result_get Function for getting the last LPCOMP compare result.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The last compare result. If 0, then VIN+ < VIN-. If 1, then VIN- < VIN+.

◆ nrfy_lpcomp_sample_check()

NRFY_STATIC_INLINE bool nrfy_lpcomp_sample_check ( NRF_LPCOMP_Type *  p_reg)

Function for reading the current state of the LPCOMP input.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
falseThe input voltage is below the threshold.
trueThe input voltage is above the threshold.

◆ nrfy_lpcomp_shorts_disable()

NRFY_STATIC_INLINE void nrfy_lpcomp_shorts_disable ( NRF_LPCOMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_lpcomp_shorts_disable Function for clearing LPCOMP shorts by mask.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts.

◆ nrfy_lpcomp_shorts_enable()

NRFY_STATIC_INLINE void nrfy_lpcomp_shorts_enable ( NRF_LPCOMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_lpcomp_shorts_enable Function for setting LPCOMP shorts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts.

◆ nrfy_lpcomp_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_lpcomp_task_address_get ( NRF_LPCOMP_Type const *  p_reg,
nrf_lpcomp_task_t  task 
)
See also
nrf_lpcomp_task_address_get Function for getting the address of the specified LPCOMP task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskLPCOMP task.
Returns
The address of the specified LPCOMP task.

◆ nrfy_lpcomp_task_trigger()

NRFY_STATIC_INLINE void nrfy_lpcomp_task_trigger ( NRF_LPCOMP_Type *  p_reg,
nrf_lpcomp_task_t  task 
)
See also
nrf_lpcomp_task_trigger Function for setting the specified LPCOMP task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskLPCOMP task to be set.

Documentation feedback | Developer Zone | Subscribe | Updated