nrfx 3.3
Data Structures | Macros | Functions
COMP HALY

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)
 

Detailed Description

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

Macro Definition Documentation

◆ NRFY_COMP_HAS_ISOURCE

#define NRFY_COMP_HAS_ISOURCE   1
See also
NRF_COMP_HAS_ISOURCE Symbol indicating whether COMP has ISOURCE register.

Function Documentation

◆ nrfy_comp_disable()

NRFY_STATIC_INLINE void nrfy_comp_disable ( NRF_COMP_Type *  p_reg)
See also
nrf_comp_disable Function for disabling the COMP peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_comp_enable()

NRFY_STATIC_INLINE void nrfy_comp_enable ( NRF_COMP_Type *  p_reg)
See also
nrf_comp_enable Function for enabling the COMP peripheral.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_comp_enable_check()

NRFY_STATIC_INLINE bool nrfy_comp_enable_check ( NRF_COMP_Type const *  p_reg)
See also
nrf_comp_enable_check Function for checking if the COMP peripheral is enabled.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe COMP peripheral is enabled.
falseThe COMP peripheral is not enabled.

◆ nrfy_comp_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_comp_event_address_get ( NRF_COMP_Type const *  p_reg,
nrf_comp_event_t  event 
)
See also
nrf_comp_event_address_get Function for getting the address of the specified COMP event register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventCOMP event.
Returns
Address of the specified COMP event.

◆ nrfy_comp_event_check()

NRFY_STATIC_INLINE bool nrfy_comp_event_check ( NRF_COMP_Type const *  p_reg,
nrf_comp_event_t  event 
)
See also
nrf_comp_event_check Function for retrieving the state of the COMP 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_comp_event_clear()

NRFY_STATIC_INLINE void nrfy_comp_event_clear ( NRF_COMP_Type *  p_reg,
nrf_comp_event_t  event 
)
See also
nrf_comp_event_clear Function for clearing the specified COMP event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventCOMP event to be cleared.

◆ nrfy_comp_events_process()

NRFY_STATIC_INLINE uint32_t nrfy_comp_events_process ( NRF_COMP_Type *  p_reg,
uint32_t  mask 
)

Function for processing the specified COMP 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_comp_ext_ref_set()

NRFY_STATIC_INLINE void nrfy_comp_ext_ref_set ( NRF_COMP_Type *  p_reg,
nrf_comp_ext_ref_t  ext_ref 
)
See also
nrf_comp_ext_ref_set Function for setting the external analog reference source.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]ext_refCOMP external analog reference selection.

◆ nrfy_comp_hysteresis_set()

NRFY_STATIC_INLINE void nrfy_comp_hysteresis_set ( NRF_COMP_Type *  p_reg,
nrf_comp_hyst_t  hyst 
)
See also
nrf_comp_hysteresis_set Function for setting the hysteresis.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]hystCOMP comparator hysteresis.

◆ nrfy_comp_input_select()

NRFY_STATIC_INLINE void nrfy_comp_input_select ( NRF_COMP_Type *  p_reg,
nrf_comp_input_t  input 
)
See also
nrf_comp_input_select Function for selecting the active input of the COMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]inputInput to be selected.

◆ nrfy_comp_int_disable()

NRFY_STATIC_INLINE void nrfy_comp_int_disable ( NRF_COMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_comp_int_disable Function for disabling interrupts from COMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_comp_int_mask_t values for bit masking.
See also
nrf_comp_int_enable_check

◆ nrfy_comp_int_enable()

NRFY_STATIC_INLINE void nrfy_comp_int_enable ( NRF_COMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_comp_int_enable Function for enabling interrupts from COMP.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_comp_int_mask_t values for bit masking.
See also
nrf_comp_int_enable_check

◆ nrfy_comp_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_comp_int_enable_check ( NRF_COMP_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_comp_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_comp_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_comp_int_init()

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.

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_comp_int_uninit()

NRFY_STATIC_INLINE void nrfy_comp_int_uninit ( NRF_COMP_Type *  p_reg)

Function for uninitializing the COMP interrupts.

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

◆ nrfy_comp_isource_set()

NRFY_STATIC_INLINE void nrfy_comp_isource_set ( NRF_COMP_Type *  p_reg,
nrf_isource_t  isource 
)
See also
nrf_comp_isource_set Function for setting the current source on the analog input.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]isourceCOMP current source selection on analog input.

◆ nrfy_comp_main_mode_set()

NRFY_STATIC_INLINE void nrfy_comp_main_mode_set ( NRF_COMP_Type *  p_reg,
nrf_comp_main_mode_t  main_mode 
)
See also
nrf_comp_main_mode_set Function for setting the main mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]main_modeCOMP main operation mode.

◆ nrfy_comp_periph_configure()

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.

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

◆ nrfy_comp_ref_set()

NRFY_STATIC_INLINE void nrfy_comp_ref_set ( NRF_COMP_Type *  p_reg,
nrf_comp_ref_t  reference 
)
See also
nrf_comp_ref_set Function for setting the reference source.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]referenceCOMP reference selection.

◆ nrfy_comp_result_get()

NRFY_STATIC_INLINE uint32_t nrfy_comp_result_get ( NRF_COMP_Type const *  p_reg)
See also
nrf_comp_result_get Function for getting the last COMP compare result.
Note
If VIN+ == VIN-, the return value depends on the previous 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_comp_sample()

NRFY_STATIC_INLINE uint32_t nrfy_comp_sample ( NRF_COMP_Type *  p_reg)

Function for reading the current state of the COMP.

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

◆ nrfy_comp_shorts_disable()

NRFY_STATIC_INLINE void nrfy_comp_shorts_disable ( NRF_COMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_comp_shorts_disable Function for clearing COMP shortcuts by mask.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts.

◆ nrfy_comp_shorts_enable()

NRFY_STATIC_INLINE void nrfy_comp_shorts_enable ( NRF_COMP_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_comp_shorts_enable Function for setting COMP shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts.

◆ nrfy_comp_speed_mode_set()

NRFY_STATIC_INLINE void nrfy_comp_speed_mode_set ( NRF_COMP_Type *  p_reg,
nrf_comp_sp_mode_t  speed_mode 
)
See also
nrf_comp_speed_mode_set Function for setting the speed mode.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]speed_modeCOMP speed and power mode.

◆ nrfy_comp_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_comp_task_address_get ( NRF_COMP_Type const *  p_reg,
nrf_comp_task_t  task 
)
See also
nrf_comp_task_address_get Function for getting the address of the specified COMP task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskCOMP task.
Returns
Address of the specified COMP task.

◆ nrfy_comp_task_trigger()

NRFY_STATIC_INLINE void nrfy_comp_task_trigger ( NRF_COMP_Type *  p_reg,
nrf_comp_task_t  task 
)
See also
nrf_comp_task_trigger Function for setting the specified COMP task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

◆ nrfy_comp_th_set()

NRFY_STATIC_INLINE void nrfy_comp_th_set ( NRF_COMP_Type *  p_reg,
nrf_comp_th_t  threshold 
)
See also
nrf_comp_th_set Function for setting threshold voltages.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]thresholdCOMP VDOWN and VUP thresholds.

Documentation feedback | Developer Zone | Subscribe | Updated