nRF5 SDK v17.1.0
Modules | Data Structures | Macros | Typedefs | Functions
QDEC driver

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

Modules

 QDEC peripheral driver configuration
 

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 from the QDEC peripheral. More...
 
__STATIC_INLINE uint32_t nrfx_qdec_task_address_get (nrf_qdec_task_t task)
 Function for returning the address of the specified QDEC task. More...
 
__STATIC_INLINE uint32_t nrfx_qdec_event_address_get (nrf_qdec_event_t event)
 Function for returning the address of the specified QDEC event. More...
 

Detailed Description

Quadrature Decoder (QDEC) peripheral driver.

Macro Definition Documentation

#define NRFX_QDEC_DEFAULT_CONFIG
Value:

QDEC default configuration.

Typedef Documentation

typedef void(* nrfx_qdec_event_handler_t)(nrfx_qdec_event_t event)

QDEC event handler.

Parameters
[in]eventQDEC event structure.

Function Documentation

void nrfx_qdec_accumulators_read ( int16_t *  p_acc,
int16_t *  p_accdbl 
)

Function for reading accumulated transitions from the QDEC peripheral.

Note
Function asserts if module is not enabled.
Accumulators are cleared after reading.
Parameters
[out]p_accPointer to store the accumulated transitions.
[out]p_accdblPointer to store the 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 the specified QDEC event.

Parameters
eventQDEC 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_configPointer to the structure with the initial configuration.
[in]event_handlerEvent handler provided by the user. Must not be NULL.
Return values
NRFX_SUCCESSInitialization was successful.
NRFX_ERROR_INVALID_STATEThe QDEC was already initialized.
__STATIC_INLINE uint32_t nrfx_qdec_task_address_get ( nrf_qdec_task_t  task)

Function for returning the address of the specified QDEC task.

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

Function for uninitializing QDEC.

Note
Function asserts if module is uninitialized.

Documentation feedback | Developer Zone | Subscribe | Updated