nrfx 2.5
Macros | Enumerations | Functions
QDEC HAL

Hardware access layer for managing the Quadrature Decoder (QDEC) peripheral. More...

Macros

#define NRF_QDEC_LED_NOT_CONNECTED   0xFFFFFFFF
 This value can be provided as a parameter for the nrf_qdec_pio_assign function call to specify that a LED signal shall not be use by the QDEC and connected to a physical pin.
 

Enumerations

enum  nrf_qdec_task_t {
  NRF_QDEC_TASK_START = offsetof(NRF_QDEC_Type, TASKS_START),
  NRF_QDEC_TASK_STOP = offsetof(NRF_QDEC_Type, TASKS_STOP),
  NRF_QDEC_TASK_READCLRACC = offsetof(NRF_QDEC_Type, TASKS_READCLRACC)
}
 QDEC tasks. More...
 
enum  nrf_qdec_event_t {
  NRF_QDEC_EVENT_SAMPLERDY = offsetof(NRF_QDEC_Type, EVENTS_SAMPLERDY),
  NRF_QDEC_EVENT_REPORTRDY = offsetof(NRF_QDEC_Type, EVENTS_REPORTRDY),
  NRF_QDEC_EVENT_ACCOF = offsetof(NRF_QDEC_Type, EVENTS_ACCOF)
}
 QDEC events. More...
 
enum  nrf_qdec_short_mask_t {
  NRF_QDEC_SHORT_REPORTRDY_READCLRACC_MASK = QDEC_SHORTS_REPORTRDY_READCLRACC_Msk,
  NRF_QDEC_SHORT_SAMPLERDY_STOP_MASK = QDEC_SHORTS_SAMPLERDY_STOP_Msk
}
 QDEC shortcuts. More...
 
enum  nrf_qdec_int_mask_t {
  NRF_QDEC_INT_SAMPLERDY_MASK = QDEC_INTENSET_SAMPLERDY_Msk,
  NRF_QDEC_INT_REPORTRDY_MASK = QDEC_INTENSET_REPORTRDY_Msk,
  NRF_QDEC_INT_ACCOF_MASK = QDEC_INTENSET_ACCOF_Msk
}
 QDEC interrupts. More...
 
enum  nrf_qdec_enable_t {
  NRF_QDEC_DISABLE = QDEC_ENABLE_ENABLE_Disabled,
  NRF_QDEC_ENABLE = QDEC_ENABLE_ENABLE_Enabled
}
 States of the enable bit. More...
 
enum  nrf_qdec_dbfen_t {
  NRF_QDEC_DBFEN_DISABLE = QDEC_DBFEN_DBFEN_Disabled,
  NRF_QDEC_DBFEN_ENABLE = QDEC_DBFEN_DBFEN_Enabled
}
 States of the debounce filter enable bit. More...
 
enum  nrf_qdec_ledpol_t {
  NRF_QDEC_LEPOL_ACTIVE_LOW = QDEC_LEDPOL_LEDPOL_ActiveLow,
  NRF_QDEC_LEPOL_ACTIVE_HIGH = QDEC_LEDPOL_LEDPOL_ActiveHigh
}
 Active LED polarity. More...
 
enum  nrf_qdec_sampleper_t {
  NRF_QDEC_SAMPLEPER_128us = QDEC_SAMPLEPER_SAMPLEPER_128us,
  NRF_QDEC_SAMPLEPER_256us = QDEC_SAMPLEPER_SAMPLEPER_256us,
  NRF_QDEC_SAMPLEPER_512us = QDEC_SAMPLEPER_SAMPLEPER_512us,
  NRF_QDEC_SAMPLEPER_1024us = QDEC_SAMPLEPER_SAMPLEPER_1024us,
  NRF_QDEC_SAMPLEPER_2048us = QDEC_SAMPLEPER_SAMPLEPER_2048us,
  NRF_QDEC_SAMPLEPER_4096us = QDEC_SAMPLEPER_SAMPLEPER_4096us,
  NRF_QDEC_SAMPLEPER_8192us = QDEC_SAMPLEPER_SAMPLEPER_8192us,
  NRF_QDEC_SAMPLEPER_16384us = QDEC_SAMPLEPER_SAMPLEPER_16384us
}
 Available sampling periods. More...
 
enum  nrf_qdec_reportper_t {
  NRF_QDEC_REPORTPER_1 = QDEC_REPORTPER_REPORTPER_1Smpl,
  NRF_QDEC_REPORTPER_10 = QDEC_REPORTPER_REPORTPER_10Smpl,
  NRF_QDEC_REPORTPER_40 = QDEC_REPORTPER_REPORTPER_40Smpl,
  NRF_QDEC_REPORTPER_80 = QDEC_REPORTPER_REPORTPER_80Smpl,
  NRF_QDEC_REPORTPER_120 = QDEC_REPORTPER_REPORTPER_120Smpl,
  NRF_QDEC_REPORTPER_160 = QDEC_REPORTPER_REPORTPER_160Smpl,
  NRF_QDEC_REPORTPER_200 = QDEC_REPORTPER_REPORTPER_200Smpl,
  NRF_QDEC_REPORTPER_240 = QDEC_REPORTPER_REPORTPER_240Smpl,
  NRF_QDEC_REPORTPER_280 = QDEC_REPORTPER_REPORTPER_280Smpl,
  NRF_QDEC_REPORTPER_DISABLED = (QDEC_REPORTPER_REPORTPER_Msk >> QDEC_REPORTPER_REPORTPER_Pos) + 1
}
 Available report periods. More...
 

Functions

NRF_STATIC_INLINE void nrf_qdec_enable (NRF_QDEC_Type *p_reg)
 Function for enabling QDEC. More...
 
NRF_STATIC_INLINE void nrf_qdec_disable (NRF_QDEC_Type *p_reg)
 Function for disabling QDEC. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_enable_get (NRF_QDEC_Type const *p_reg)
 Function for returning the enable state of QDEC. More...
 
NRF_STATIC_INLINE void nrf_qdec_int_enable (NRF_QDEC_Type *p_reg, uint32_t mask)
 Function for enabling QDEC interrupts by mask. More...
 
NRF_STATIC_INLINE void nrf_qdec_int_disable (NRF_QDEC_Type *p_reg, uint32_t mask)
 Function for disabling QDEC interrupts by mask. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_int_enable_check (NRF_QDEC_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled. More...
 
NRF_STATIC_INLINE void nrf_qdec_dbfen_enable (NRF_QDEC_Type *p_reg)
 Function for enabling the QDEC debouncing filter. More...
 
NRF_STATIC_INLINE void nrf_qdec_dbfen_disable (NRF_QDEC_Type *p_reg)
 Function for disabling the QDEC debouncing filter. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_dbfen_get (NRF_QDEC_Type const *p_reg)
 Function for getting the state of the QDEC debouncing filter. More...
 
NRF_STATIC_INLINE void nrf_qdec_pins_set (NRF_QDEC_Type *p_reg, uint32_t phase_a_pin, uint32_t phase_b_pin, uint32_t led_pin)
 Function for configuring QDEC pins. More...
 
NRF_STATIC_INLINE void nrf_qdec_pio_assign (NRF_QDEC_Type *p_reg, uint32_t psela, uint32_t pselb, uint32_t pselled)
 Function for assigning QDEC pins. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_phase_a_pin_get (NRF_QDEC_Type const *p_reg)
 Function for getting the Phase A pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_phase_b_pin_get (NRF_QDEC_Type const *p_reg)
 Function for getting the Phase B pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_led_pin_get (NRF_QDEC_Type const *p_reg)
 Function for getting the LED pin selection. More...
 
NRF_STATIC_INLINE void nrf_qdec_task_trigger (NRF_QDEC_Type *p_reg, nrf_qdec_task_t task)
 Function for setting the specified QDEC task. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_task_address_get (NRF_QDEC_Type const *p_reg, nrf_qdec_task_t task)
 Function for retrieving the address of a QDEC task register. More...
 
NRF_STATIC_INLINE void nrf_qdec_event_clear (NRF_QDEC_Type *p_reg, nrf_qdec_event_t event)
 Function for clearing the specified QDEC event. More...
 
NRF_STATIC_INLINE bool nrf_qdec_event_check (NRF_QDEC_Type const *p_reg, nrf_qdec_event_t event)
 Function for getting the state of the specified QDEC event. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_event_address_get (NRF_QDEC_Type const *p_reg, nrf_qdec_event_t event)
 Function for retrieving the address of the specified QDEC event register. More...
 
NRF_STATIC_INLINE void nrf_qdec_shorts_enable (NRF_QDEC_Type *p_reg, uint32_t mask)
 Function for setting QDEC shortcuts. More...
 
NRF_STATIC_INLINE void nrf_qdec_shorts_disable (NRF_QDEC_Type *p_reg, uint32_t mask)
 Function for clearing shortcuts of the QDEC by mask. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_sampleper_to_value (nrf_qdec_sampleper_t sampleper)
 Function for converting return value of the nrf_qdec_sampleper_get function to microseconds. More...
 
NRF_STATIC_INLINE void nrf_qdec_sampleper_set (NRF_QDEC_Type *p_reg, nrf_qdec_sampleper_t sampleper)
 Function for setting value of the QDEC sampling period. More...
 
NRF_STATIC_INLINE nrf_qdec_sampleper_t nrf_qdec_sampleper_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving value of the QDEC sampling period. More...
 
NRF_STATIC_INLINE int32_t nrf_qdec_sample_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving value of the QDEC SAMPLE register. More...
 
NRF_STATIC_INLINE int32_t nrf_qdec_acc_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving value of the QDEC ACC register. More...
 
NRF_STATIC_INLINE int32_t nrf_qdec_accread_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving value of the QDEC ACCREAD register. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_accdbl_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving value of the QDEC ACCDBL register. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_accdblread_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving value of the QDEC ACCDBLREAD register. More...
 
NRF_STATIC_INLINE void nrf_qdec_ledpre_set (NRF_QDEC_Type *p_reg, uint32_t time_us)
 Function for setting delay time between setting LED active state and start sampling. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_ledpre_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving how long the LED is switched on before sampling. More...
 
NRF_STATIC_INLINE void nrf_qdec_reportper_set (NRF_QDEC_Type *p_reg, nrf_qdec_reportper_t reportper)
 Function for setting the report period (in samples). More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_reportper_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving the report period. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_reportper_to_value (uint32_t reportper)
 Function for retrieving the value of QDEC SAMPLEPER register. More...
 
NRF_STATIC_INLINE void nrf_qdec_ledpol_set (NRF_QDEC_Type *p_reg, nrf_qdec_ledpol_t pol)
 Function for setting the active level for the LED. More...
 
NRF_STATIC_INLINE uint32_t nrf_qdec_ledpol_get (NRF_QDEC_Type const *p_reg)
 Function for retrieving the active level for the LED. More...
 

Detailed Description

Hardware access layer for managing the Quadrature Decoder (QDEC) peripheral.

Enumeration Type Documentation

◆ nrf_qdec_dbfen_t

States of the debounce filter enable bit.

Enumerator
NRF_QDEC_DBFEN_DISABLE 

Mask for disabling the debounce filter.

NRF_QDEC_DBFEN_ENABLE 

Mask for enabling the debounce filter.

◆ nrf_qdec_enable_t

States of the enable bit.

Enumerator
NRF_QDEC_DISABLE 

Mask for disabling the QDEC periperal. When disabled, the QDEC decoder pins are not active.

NRF_QDEC_ENABLE 

Mask for enabling the QDEC periperal. When enabled, the QDEC pins are active.

◆ nrf_qdec_event_t

QDEC events.

Enumerator
NRF_QDEC_EVENT_SAMPLERDY 

Event generated for every new sample.

NRF_QDEC_EVENT_REPORTRDY 

Event generated for every new report.

NRF_QDEC_EVENT_ACCOF 

Event generated for every accumulator overflow.

◆ nrf_qdec_int_mask_t

QDEC interrupts.

Enumerator
NRF_QDEC_INT_SAMPLERDY_MASK 

Mask for enabling or disabling an interrupt on SAMPLERDY event.

NRF_QDEC_INT_REPORTRDY_MASK 

Mask for enabling or disabling an interrupt on REPORTRDY event.

NRF_QDEC_INT_ACCOF_MASK 

Mask for enabling or disabling an interrupt on ACCOF event.

◆ nrf_qdec_ledpol_t

Active LED polarity.

Enumerator
NRF_QDEC_LEPOL_ACTIVE_LOW 

QDEC LED active on output pin low.

NRF_QDEC_LEPOL_ACTIVE_HIGH 

QDEC LED active on output pin high.

◆ nrf_qdec_reportper_t

Available report periods.

Enumerator
NRF_QDEC_REPORTPER_1 

QDEC report period 1 sample.

NRF_QDEC_REPORTPER_10 

QDEC report period 10 samples.

NRF_QDEC_REPORTPER_40 

QDEC report period 40 samples.

NRF_QDEC_REPORTPER_80 

QDEC report period 80 samples.

NRF_QDEC_REPORTPER_120 

QDEC report period 120 samples.

NRF_QDEC_REPORTPER_160 

QDEC report period 160 samples.

NRF_QDEC_REPORTPER_200 

QDEC report period 200 samples.

NRF_QDEC_REPORTPER_240 

QDEC report period 240 samples.

NRF_QDEC_REPORTPER_280 

QDEC report period 280 samples.

NRF_QDEC_REPORTPER_DISABLED 

QDEC reporting disabled. Deprecated.

◆ nrf_qdec_sampleper_t

Available sampling periods.

Enumerator
NRF_QDEC_SAMPLEPER_128us 

QDEC sampling period 128 microseconds.

NRF_QDEC_SAMPLEPER_256us 

QDEC sampling period 256 microseconds.

NRF_QDEC_SAMPLEPER_512us 

QDEC sampling period 512 microseconds.

NRF_QDEC_SAMPLEPER_1024us 

QDEC sampling period 1024 microseconds.

NRF_QDEC_SAMPLEPER_2048us 

QDEC sampling period 2048 microseconds.

NRF_QDEC_SAMPLEPER_4096us 

QDEC sampling period 4096 microseconds.

NRF_QDEC_SAMPLEPER_8192us 

QDEC sampling period 8192 microseconds.

NRF_QDEC_SAMPLEPER_16384us 

QDEC sampling period 16384 microseconds.

◆ nrf_qdec_short_mask_t

QDEC shortcuts.

Enumerator
NRF_QDEC_SHORT_REPORTRDY_READCLRACC_MASK 

Shortcut between REPORTRDY event and READCLRACC task.

NRF_QDEC_SHORT_SAMPLERDY_STOP_MASK 

Shortcut between SAMPLERDY event and STOP task.

◆ nrf_qdec_task_t

QDEC tasks.

Enumerator
NRF_QDEC_TASK_START 

Starting the quadrature decoder.

NRF_QDEC_TASK_STOP 

Stopping the quadrature decoder.

NRF_QDEC_TASK_READCLRACC 

Reading and clearing ACC and ACCDBL registers.

Function Documentation

◆ nrf_qdec_acc_get()

NRF_STATIC_INLINE int32_t nrf_qdec_acc_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_accdbl_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_accdbl_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_accdblread_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_accdblread_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_accread_get()

NRF_STATIC_INLINE int32_t nrf_qdec_accread_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_dbfen_disable()

NRF_STATIC_INLINE void nrf_qdec_dbfen_disable ( NRF_QDEC_Type *  p_reg)

Function for disabling the QDEC debouncing filter.

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

◆ nrf_qdec_dbfen_enable()

NRF_STATIC_INLINE void nrf_qdec_dbfen_enable ( NRF_QDEC_Type *  p_reg)

Function for enabling the QDEC debouncing filter.

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

◆ nrf_qdec_dbfen_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_dbfen_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_disable()

NRF_STATIC_INLINE void nrf_qdec_disable ( NRF_QDEC_Type *  p_reg)

Function for disabling QDEC.

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

◆ nrf_qdec_enable()

NRF_STATIC_INLINE void nrf_qdec_enable ( NRF_QDEC_Type *  p_reg)

Function for enabling QDEC.

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

◆ nrf_qdec_enable_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_enable_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_event_address_get ( NRF_QDEC_Type const *  p_reg,
nrf_qdec_event_t  event 
)

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.

◆ nrf_qdec_event_check()

NRF_STATIC_INLINE bool nrf_qdec_event_check ( NRF_QDEC_Type const *  p_reg,
nrf_qdec_event_t  event 
)

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.

◆ nrf_qdec_event_clear()

NRF_STATIC_INLINE void nrf_qdec_event_clear ( NRF_QDEC_Type *  p_reg,
nrf_qdec_event_t  event 
)

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.

◆ nrf_qdec_int_disable()

NRF_STATIC_INLINE void nrf_qdec_int_disable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)

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.

◆ nrf_qdec_int_enable()

NRF_STATIC_INLINE void nrf_qdec_int_enable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)

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.

◆ nrf_qdec_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_qdec_int_enable_check ( NRF_QDEC_Type const *  p_reg,
uint32_t  mask 
)

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.
Returns
Mask of enabled interrupts.

◆ nrf_qdec_led_pin_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_led_pin_get ( NRF_QDEC_Type const *  p_reg)

Function for getting the LED pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
LED pin selection.

◆ nrf_qdec_ledpol_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_ledpol_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_ledpol_set()

NRF_STATIC_INLINE void nrf_qdec_ledpol_set ( NRF_QDEC_Type *  p_reg,
nrf_qdec_ledpol_t  pol 
)

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.

◆ nrf_qdec_ledpre_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_ledpre_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_ledpre_set()

NRF_STATIC_INLINE void nrf_qdec_ledpre_set ( NRF_QDEC_Type *  p_reg,
uint32_t  time_us 
)

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.

◆ nrf_qdec_phase_a_pin_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_phase_a_pin_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_phase_b_pin_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_phase_b_pin_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_pins_set()

NRF_STATIC_INLINE void nrf_qdec_pins_set ( NRF_QDEC_Type *  p_reg,
uint32_t  phase_a_pin,
uint32_t  phase_b_pin,
uint32_t  led_pin 
)

Function for configuring QDEC pins.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]phase_a_pinPhase A pin number.
[in]phase_b_pinPhase B pin number.
[in]led_pinLED pin number.

◆ nrf_qdec_pio_assign()

NRF_STATIC_INLINE void nrf_qdec_pio_assign ( NRF_QDEC_Type *  p_reg,
uint32_t  psela,
uint32_t  pselb,
uint32_t  pselled 
)

Function for assigning QDEC pins.

Note
This function is deprecated. Use nrf_qdec_pins_set instead.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]pselaPin number.
[in]pselbPin number.
[in]pselledPin number.

◆ nrf_qdec_reportper_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_reportper_get ( NRF_QDEC_Type const *  p_reg)

Function for retrieving the report period.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The report period.

◆ nrf_qdec_reportper_set()

NRF_STATIC_INLINE void nrf_qdec_reportper_set ( NRF_QDEC_Type *  p_reg,
nrf_qdec_reportper_t  reportper 
)

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.

◆ nrf_qdec_reportper_to_value()

NRF_STATIC_INLINE uint32_t nrf_qdec_reportper_to_value ( uint32_t  reportper)

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.

◆ nrf_qdec_sample_get()

NRF_STATIC_INLINE int32_t nrf_qdec_sample_get ( NRF_QDEC_Type const *  p_reg)

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.

◆ nrf_qdec_sampleper_get()

NRF_STATIC_INLINE nrf_qdec_sampleper_t nrf_qdec_sampleper_get ( NRF_QDEC_Type const *  p_reg)

Function for retrieving value of the QDEC sampling period.

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

◆ nrf_qdec_sampleper_set()

NRF_STATIC_INLINE void nrf_qdec_sampleper_set ( NRF_QDEC_Type *  p_reg,
nrf_qdec_sampleper_t  sampleper 
)

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.

◆ nrf_qdec_sampleper_to_value()

NRF_STATIC_INLINE uint32_t nrf_qdec_sampleper_to_value ( nrf_qdec_sampleper_t  sampleper)

Function for converting return value of the nrf_qdec_sampleper_get function to microseconds.

Parameters
[in]sampleperThe sampling period.
Returns
Period in microseconds.

◆ nrf_qdec_shorts_disable()

NRF_STATIC_INLINE void nrf_qdec_shorts_disable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)

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.

◆ nrf_qdec_shorts_enable()

NRF_STATIC_INLINE void nrf_qdec_shorts_enable ( NRF_QDEC_Type *  p_reg,
uint32_t  mask 
)

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.

◆ nrf_qdec_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_qdec_task_address_get ( NRF_QDEC_Type const *  p_reg,
nrf_qdec_task_t  task 
)

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.

◆ nrf_qdec_task_trigger()

NRF_STATIC_INLINE void nrf_qdec_task_trigger ( NRF_QDEC_Type *  p_reg,
nrf_qdec_task_t  task 
)

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