QDEC driver

nRF5 SDK v15.0.0

Quadrature Decoder (QDEC) peripheral driver. More...

Data Structures

struct nrfx_qdec_config_t
QDEC configuration structure. More...
struct nrfx_qdec_sample_data_evt_t
QDEC sample event data. More...
struct nrfx_qdec_report_data_evt_t
QDEC report event data. More...
struct nrfx_qdec_event_t
QDEC event handler structure. More...

Macros

#define NRFX_QDEC_DEFAULT_CONFIG
QDEC default configuration. More...

Typedefs

typedef void(* nrfx_qdec_event_handler_t )( nrfx_qdec_event_t event)
QDEC event handler. More...

Functions

nrfx_err_t nrfx_qdec_init ( nrfx_qdec_config_t const *p_config, nrfx_qdec_event_handler_t event_handler)
Function for initializing QDEC. More...
void nrfx_qdec_uninit (void)
Function for uninitializing QDEC. More...
void nrfx_qdec_enable (void)
Function for enabling QDEC. More...
void nrfx_qdec_disable (void)
Function for disabling QDEC. More...
void nrfx_qdec_accumulators_read (int16_t *p_acc, int16_t *p_accdbl)
Function for reading accumulated transitions QDEC. More...
__STATIC_INLINE uint32_t nrfx_qdec_task_address_get ( nrf_qdec_task_t task)
Function for returning the address of a specific QDEC task. More...
__STATIC_INLINE uint32_t nrfx_qdec_event_address_get ( nrf_qdec_event_t event)
Function for returning the address of a specific QDEC event. More...
void nrfx_qdec_irq_handler (void)

Detailed Description

Quadrature Decoder (QDEC) peripheral driver.

Macro Definition Documentation

#define NRFX_QDEC_DEFAULT_CONFIG

Typedef Documentation

typedef void(* nrfx_qdec_event_handler_t)( nrfx_qdec_event_t event)

QDEC event handler.

Parameters
[in] event QDEC event structure.

Function Documentation

void nrfx_qdec_accumulators_read ( int16_t * p_acc ,
int16_t * p_accdbl
)

Function for reading accumulated transitions QDEC.

Note
Function asserts if module is not enabled.
Accumulators are cleared after reading.
Parameters
[out] p_acc Pointer to store accumulated transitions.
[out] p_accdbl Pointer to store accumulated double transitions.
void nrfx_qdec_disable ( void )

Function for disabling QDEC.

Note
Function asserts if module is uninitialized or disabled.
void nrfx_qdec_enable ( void )

Function for enabling QDEC.

Note
Function asserts if module is uninitialized or enabled.
__STATIC_INLINE uint32_t nrfx_qdec_event_address_get ( nrf_qdec_event_t event )

Function for returning the address of a specific QDEC event.

Parameters
event QDEC event.
Returns
Event address.
nrfx_err_t nrfx_qdec_init ( nrfx_qdec_config_t const * p_config ,
nrfx_qdec_event_handler_t event_handler
)

Function for initializing QDEC.

Parameters
[in] p_config Pointer to the structure with initial configuration.
[in] event_handler Event handler provided by the user. Must not be NULL.
Return values
NRFX_SUCCESS If initialization was successful.
NRFX_ERROR_INVALID_STATE If QDEC was already initialized.
__STATIC_INLINE uint32_t nrfx_qdec_task_address_get ( nrf_qdec_task_t task )

Function for returning the address of a specific QDEC task.

Parameters
task QDEC task.
Returns
Task address.
void nrfx_qdec_uninit ( void )

Function for uninitializing QDEC.

Note
Function asserts if module is uninitialized.