nrfx 3.3
Data Structures | Functions
QDEC HALY

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

Data Structures

struct  nrfy_qdec_pins_t
 Configuration structure for QDEC pins. More...
 
struct  nrfy_qdec_config_t
 QDEC configuration structure. More...
 

Functions

NRFY_STATIC_INLINE void nrfy_qdec_periph_configure (NRF_QDEC_Type *p_reg, nrfy_qdec_config_t const *p_config)
 Function for configuring the QDEC.
 
NRFY_STATIC_INLINE void nrfy_qdec_int_init (NRF_QDEC_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable)
 Function for initializing the specified QDEC interrupts.
 
NRFY_STATIC_INLINE void nrfy_qdec_int_uninit (NRF_QDEC_Type *p_reg)
 Function for uninitializing the QDEC interrupts.
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_events_process (NRF_QDEC_Type *p_reg, uint32_t mask)
 Function for processing the specified QDEC events.
 
NRFY_STATIC_INLINE void nrfy_qdec_accumulators_read (NRF_QDEC_Type const *p_reg, int32_t *p_acc, uint32_t *p_accdbl)
 Function for reading QDEC accumulators.
 
NRFY_STATIC_INLINE void nrfy_qdec_pins_get (NRF_QDEC_Type const *p_reg, nrfy_qdec_pins_t *p_pins)
 Function for reading QDEC pins.
 
NRFY_STATIC_INLINE void nrfy_qdec_pins_set (NRF_QDEC_Type *p_reg, nrfy_qdec_pins_t const *p_pins)
 Function for setting QDEC pins.
 
NRFY_STATIC_INLINE void nrfy_qdec_enable (NRF_QDEC_Type *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_disable (NRF_QDEC_Type *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_enable_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_int_enable (NRF_QDEC_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_qdec_int_disable (NRF_QDEC_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_int_enable_check (NRF_QDEC_Type const *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_qdec_dbfen_enable (NRF_QDEC_Type *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_dbfen_disable (NRF_QDEC_Type *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_dbfen_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_a_pin_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_b_pin_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_led_pin_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_task_trigger (NRF_QDEC_Type *p_reg, nrf_qdec_task_t task)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_task_address_get (NRF_QDEC_Type const *p_reg, nrf_qdec_task_t task)
 
NRFY_STATIC_INLINE void nrfy_qdec_event_clear (NRF_QDEC_Type *p_reg, nrf_qdec_event_t event)
 
NRFY_STATIC_INLINE bool nrfy_qdec_event_check (NRF_QDEC_Type const *p_reg, nrf_qdec_event_t event)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_event_address_get (NRF_QDEC_Type const *p_reg, nrf_qdec_event_t event)
 
NRFY_STATIC_INLINE void nrfy_qdec_shorts_enable (NRF_QDEC_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE void nrfy_qdec_shorts_disable (NRF_QDEC_Type *p_reg, uint32_t mask)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_sampleper_to_value (nrf_qdec_sampleper_t sampleper)
 
NRFY_STATIC_INLINE void nrfy_qdec_sampleper_set (NRF_QDEC_Type *p_reg, nrf_qdec_sampleper_t sampleper)
 
NRFY_STATIC_INLINE nrf_qdec_sampleper_t nrfy_qdec_sampleper_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE int32_t nrfy_qdec_sample_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE int32_t nrfy_qdec_acc_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE int32_t nrfy_qdec_accread_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_accdbl_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_accdblread_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_ledpre_set (NRF_QDEC_Type *p_reg, uint32_t time_us)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_ledpre_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_ledpol_set (NRF_QDEC_Type *p_reg, nrf_qdec_ledpol_t pol)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_ledpol_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE void nrfy_qdec_reportper_set (NRF_QDEC_Type *p_reg, nrf_qdec_reportper_t reportper)
 
NRFY_STATIC_INLINE nrf_qdec_reportper_t nrfy_qdec_reportper_get (NRF_QDEC_Type const *p_reg)
 
NRFY_STATIC_INLINE uint32_t nrfy_qdec_reportper_to_value (nrf_qdec_reportper_t reportper)
 

Detailed Description

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

Function Documentation

◆ nrfy_qdec_a_pin_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_a_pin_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_phase_a_pin_get Function for getting the Phase A pin selection.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Phase A pin selection.

◆ nrfy_qdec_acc_get()

NRFY_STATIC_INLINE int32_t nrfy_qdec_acc_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_acc_get Function for retrieving value of the QDEC ACC register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Value of the ACC register.

◆ nrfy_qdec_accdbl_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_accdbl_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_accdbl_get Function for retrieving value of the QDEC ACCDBL register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Value of the ACCDBL register.

◆ nrfy_qdec_accdblread_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_accdblread_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_accdblread_get Function for retrieving value of the QDEC ACCDBLREAD register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Value of the ACCDBLREAD register.

◆ nrfy_qdec_accread_get()

NRFY_STATIC_INLINE int32_t nrfy_qdec_accread_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_accread_get Function for retrieving value of the QDEC ACCREAD register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Value of the ACCREAD register.

◆ nrfy_qdec_accumulators_read()

NRFY_STATIC_INLINE void nrfy_qdec_accumulators_read ( NRF_QDEC_Type const *  p_reg,
int32_t *  p_acc,
uint32_t *  p_accdbl 
)

Function for reading QDEC accumulators.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_accPointer to store the accumulated transitions
[in]p_accdblPointer to store the accumulated double transitions.

◆ nrfy_qdec_b_pin_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_b_pin_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_phase_b_pin_get Function for getting the Phase B pin selection.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Phase B pin selection.

◆ nrfy_qdec_dbfen_disable()

NRFY_STATIC_INLINE void nrfy_qdec_dbfen_disable ( NRF_QDEC_Type *  p_reg)
See also
nrf_qdec_dbfen_disable Function for disabling the QDEC debouncing filter.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_qdec_dbfen_enable()

NRFY_STATIC_INLINE void nrfy_qdec_dbfen_enable ( NRF_QDEC_Type *  p_reg)
See also
nrf_qdec_dbfen_enable Function for enabling the QDEC debouncing filter.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_qdec_dbfen_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_dbfen_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_dbfen_get Function for getting the state of the QDEC debouncing filter.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
NRF_QDEC_DBFEN_DISABLEThe debouncing filter is disabled.
NRF_QDEC_DBFEN_ENABLEThe debouncing filter is enabled.

◆ nrfy_qdec_disable()

NRFY_STATIC_INLINE void nrfy_qdec_disable ( NRF_QDEC_Type *  p_reg)
See also
nrf_qdec_disable Function for disabling QDEC.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_qdec_enable()

NRFY_STATIC_INLINE void nrfy_qdec_enable ( NRF_QDEC_Type *  p_reg)
See also
nrf_qdec_enable Function for enabling QDEC.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrfy_qdec_enable_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_enable_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_enable_get Function for returning the enable state of QDEC.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
State of the register.

◆ nrfy_qdec_event_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_event_address_get ( NRF_QDEC_Type const *  p_reg,
nrf_qdec_event_t  event 
)
See also
nrf_qdec_event_address_get Function for retrieving the address of the specified QDEC event register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventQDEC event to get its address.
Returns
Address of the specified QDEC event.

◆ nrfy_qdec_event_check()

NRFY_STATIC_INLINE bool nrfy_qdec_event_check ( NRF_QDEC_Type const *  p_reg,
nrf_qdec_event_t  event 
)
See also
nrf_qdec_event_check Function for getting the state of the specified QDEC event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventQDEC event to be checked.
Returns
State of the specified QDEC event.

◆ nrfy_qdec_event_clear()

NRFY_STATIC_INLINE void nrfy_qdec_event_clear ( NRF_QDEC_Type *  p_reg,
nrf_qdec_event_t  event 
)
See also
nrf_qdec_event_clear Function for clearing the specified QDEC event.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventQDEC event to be cleared.

◆ nrfy_qdec_events_process()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_events_process ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)

Function for processing the specified QDEC 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_qdec_int_disable()

NRFY_STATIC_INLINE void nrfy_qdec_int_disable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_qdec_int_disable Function for disabling QDEC interrupts by mask.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled. Use nrf_qdec_int_mask_t values for bit masking.

◆ nrfy_qdec_int_enable()

NRFY_STATIC_INLINE void nrfy_qdec_int_enable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_qdec_int_enable Function for enabling QDEC interrupts by mask.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled. Use nrf_qdec_int_mask_t values for bit masking.

◆ nrfy_qdec_int_enable_check()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_int_enable_check ( NRF_QDEC_Type const *  p_reg,
uint32_t  mask 
)
See also
nrf_qdec_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_qdec_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrfy_qdec_int_init()

NRFY_STATIC_INLINE void nrfy_qdec_int_init ( NRF_QDEC_Type *  p_reg,
uint32_t  mask,
uint8_t  irq_priority,
bool  enable 
)

Function for initializing the specified QDEC 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_qdec_int_uninit()

NRFY_STATIC_INLINE void nrfy_qdec_int_uninit ( NRF_QDEC_Type *  p_reg)

Function for uninitializing the QDEC interrupts.

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

◆ nrfy_qdec_led_pin_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_led_pin_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_led_pin_get Function for getting the LED pin selection.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
LED pin selection.

◆ nrfy_qdec_ledpol_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_ledpol_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_ledpol_get Function for retrieving the active level for the LED.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Level of the active signal of the LED.

◆ nrfy_qdec_ledpol_set()

NRFY_STATIC_INLINE void nrfy_qdec_ledpol_set ( NRF_QDEC_Type *  p_reg,
nrf_qdec_ledpol_t  pol 
)
See also
nrf_qdec_ledpol_set Function for setting the active level for the LED.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]polLevel of the active signal of the LED.

◆ nrfy_qdec_ledpre_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_ledpre_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_ledpre_get Function for retrieving how long the LED is switched on before sampling.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The gap in time in microseconds between switched LED to active state and start sampling.

◆ nrfy_qdec_ledpre_set()

NRFY_STATIC_INLINE void nrfy_qdec_ledpre_set ( NRF_QDEC_Type *  p_reg,
uint32_t  time_us 
)
See also
nrf_qdec_ledpre_set Function for setting delay time between setting LED active state and start sampling.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]time_usDelay time (in microseconds) between setting LED active state and start sampling.

◆ nrfy_qdec_periph_configure()

NRFY_STATIC_INLINE void nrfy_qdec_periph_configure ( NRF_QDEC_Type *  p_reg,
nrfy_qdec_config_t const *  p_config 
)

Function for configuring the QDEC.

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

◆ nrfy_qdec_pins_get()

NRFY_STATIC_INLINE void nrfy_qdec_pins_get ( NRF_QDEC_Type const *  p_reg,
nrfy_qdec_pins_t p_pins 
)

Function for reading QDEC pins.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_pinsPointer to the QDEC pin configurartion structure.

◆ nrfy_qdec_pins_set()

NRFY_STATIC_INLINE void nrfy_qdec_pins_set ( NRF_QDEC_Type *  p_reg,
nrfy_qdec_pins_t const *  p_pins 
)

Function for setting QDEC pins.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_pinsPointer to the QDEC pin configurartion structure.

◆ nrfy_qdec_reportper_get()

NRFY_STATIC_INLINE nrf_qdec_reportper_t nrfy_qdec_reportper_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_reportper_get Function for retrieving the report period.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The report period.

◆ nrfy_qdec_reportper_set()

NRFY_STATIC_INLINE void nrfy_qdec_reportper_set ( NRF_QDEC_Type *  p_reg,
nrf_qdec_reportper_t  reportper 
)
See also
nrf_qdec_reportper_set Function for setting the report period (in samples).
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]reportperThe number of samples.

◆ nrfy_qdec_reportper_to_value()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_reportper_to_value ( nrf_qdec_reportper_t  reportper)
See also
nrf_qdec_reportper_to_value Function for retrieving the value of QDEC SAMPLEPER register.
Parameters
[in]reportperReportper to be converted to amount of samples per report.
Returns
Number of samples per report.

◆ nrfy_qdec_sample_get()

NRFY_STATIC_INLINE int32_t nrfy_qdec_sample_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_sample_get Function for retrieving value of the QDEC SAMPLE register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Value of the SAMPLE register.

◆ nrfy_qdec_sampleper_get()

NRFY_STATIC_INLINE nrf_qdec_sampleper_t nrfy_qdec_sampleper_get ( NRF_QDEC_Type const *  p_reg)
See also
nrf_qdec_sampleper_get Function for retrieving value of the QDEC sampling period.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Sampling period.

◆ nrfy_qdec_sampleper_set()

NRFY_STATIC_INLINE void nrfy_qdec_sampleper_set ( NRF_QDEC_Type *  p_reg,
nrf_qdec_sampleper_t  sampleper 
)
See also
nrf_qdec_sampleper_set Function for setting value of the QDEC sampling period.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]sampleperThe sampling period.

◆ nrfy_qdec_sampleper_to_value()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_sampleper_to_value ( nrf_qdec_sampleper_t  sampleper)
See also
nrf_qdec_sampleper_to_value Function for converting return value of the nrf_qdec_sampleper_get function to microseconds.
Parameters
[in]sampleperThe sampling period.
Returns
Period in microseconds.

◆ nrfy_qdec_shorts_disable()

NRFY_STATIC_INLINE void nrfy_qdec_shorts_disable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_qdec_shorts_disable Function for clearing shortcuts of the QDEC by mask.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of QDEC shortcuts to be cleared.

◆ nrfy_qdec_shorts_enable()

NRFY_STATIC_INLINE void nrfy_qdec_shorts_enable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)
See also
nrf_qdec_shorts_enable Function for setting QDEC shortcuts.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of QDEC shortcuts to be set.

◆ nrfy_qdec_task_address_get()

NRFY_STATIC_INLINE uint32_t nrfy_qdec_task_address_get ( NRF_QDEC_Type const *  p_reg,
nrf_qdec_task_t  task 
)
See also
nrf_qdec_task_address_get Function for retrieving the address of a QDEC task register.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskQDEC task to get its address.
Returns
Address of the specified QDEC task.

◆ nrfy_qdec_task_trigger()

NRFY_STATIC_INLINE void nrfy_qdec_task_trigger ( NRF_QDEC_Type *  p_reg,
nrf_qdec_task_t  task 
)
See also
nrf_qdec_task_trigger Function for setting the specified QDEC task.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskQDEC task to be triggered.

Documentation feedback | Developer Zone | Subscribe | Updated