Quadrature Decoder (QDEC) peripheral driver.
More...
Quadrature Decoder (QDEC) peripheral driver.
◆ NRFX_QDEC_DEFAULT_CONFIG
#define NRFX_QDEC_DEFAULT_CONFIG |
( |
|
_pin_a, |
|
|
|
_pin_b, |
|
|
|
_pin_led |
|
) |
| |
Value:{ \
.psela = _pin_a, \
.pselb = _pin_b, \
.pselled = _pin_led, \
.ledpre = 500, \
.sample_inten = false, \
.interrupt_priority = NRFX_QDEC_DEFAULT_CONFIG_IRQ_PRIORITY \
}
Definition: nrf_qdec.h:66
Definition: nrf_qdec.h:87
Definition: nrf_qdec.h:74
Definition: nrf_qdec.h:96
QDEC driver default configuration.
This configuration sets up QDEC with the following options:
- report period: 10 samples
- sampling period: 16384 us
- LED enabled for 500 us before sampling
- LED polarity: active high
- debouncing filter disabled
- sample ready interrupt disabled
- Parameters
-
[in] | _pin_a | Pin for A encoder channel input. |
[in] | _pin_b | Pin for B encoder channel input. |
[in] | _pin_led | Pin for LED output. |
◆ nrfx_qdec_event_handler_t
QDEC event handler.
- Parameters
-
[in] | event | QDEC event structure. |
◆ nrfx_qdec_accumulators_read()
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_acc | Pointer to store the accumulated transitions. |
[out] | p_accdbl | Pointer to store the accumulated double transitions. |
◆ nrfx_qdec_disable()
void nrfx_qdec_disable |
( |
void |
| ) |
|
Function for disabling QDEC.
- Note
- Function asserts if module is uninitialized or disabled.
◆ nrfx_qdec_enable()
void nrfx_qdec_enable |
( |
void |
| ) |
|
Function for enabling QDEC.
- Note
- Function asserts if module is uninitialized or enabled.
◆ nrfx_qdec_event_address_get()
NRFX_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
-
- Returns
- Event address.
◆ nrfx_qdec_init()
Function for initializing QDEC.
- Parameters
-
[in] | p_config | Pointer to the structure with the initial configuration. |
[in] | event_handler | Event handler provided by the user. Must not be NULL. |
- Return values
-
NRFX_SUCCESS | Initialization was successful. |
NRFX_ERROR_INVALID_STATE | The QDEC was already initialized. |
◆ nrfx_qdec_task_address_get()
NRFX_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
-
- Returns
- Task address.
◆ nrfx_qdec_uninit()
void nrfx_qdec_uninit |
( |
void |
| ) |
|
Function for uninitializing QDEC.
- Note
- Function asserts if module is uninitialized.