AIROC™ BTSDK v4.8 - Documentation | ||||
Functions | |
void | wiced_hal_quadrature_configure (uint16_t QOC_LEDs_output_polarity, uint16_t quadratureInputGpioConfig, uint8_t port0PinsUsedAsQuadratureInput, wiced_bool_t configureP26AsQOC0, wiced_bool_t configureP27AsQOC1, wiced_bool_t configureP28AsQOC2, wiced_bool_t configureP29AsQOC3, uint8_t channelEnableAndSamplingRate, wiced_bool_t pollXAxis, wiced_bool_t pollYAxis, wiced_bool_t pollZAxis) |
configure quadrature driver More... | |
void | wiced_hal_quadrature_init (void) |
Initialize the quadrature driver. More... | |
void | wiced_hal_quadrature_turnOff (void) |
Disable the quadrature interface including wakeups. More... | |
int16_t | wiced_hal_quadrature_get_X_motion (void) |
Returns currently accumulated motion for the X axis. More... | |
int16_t | wiced_hal_quadrature_get_Y_motion (void) |
Returns currently accumulated motion for the Y axis. More... | |
int16_t | wiced_hal_quadrature_get_Z_motion (void) |
Returns currently accumulated motion for the Z axis. More... | |
int16_t | wiced_hal_quadrature_get_scroll_count (void) |
Returns currently accumulated motion for the active axis (X, Y or Z). More... | |
void | wiced_hal_quadrature_register_for_event_notification (void(*userfn)(void *), void *userdata) |
Register for notification of changes. More... | |
void wiced_hal_quadrature_configure | ( | uint16_t | QOC_LEDs_output_polarity, |
uint16_t | quadratureInputGpioConfig, | ||
uint8_t | port0PinsUsedAsQuadratureInput, | ||
wiced_bool_t | configureP26AsQOC0, | ||
wiced_bool_t | configureP27AsQOC1, | ||
wiced_bool_t | configureP28AsQOC2, | ||
wiced_bool_t | configureP29AsQOC3, | ||
uint8_t | channelEnableAndSamplingRate, | ||
wiced_bool_t | pollXAxis, | ||
wiced_bool_t | pollYAxis, | ||
wiced_bool_t | pollZAxis | ||
) |
configure quadrature driver
Application use this to configure Quadradure driver
QOC_LEDs_output_polarity | - QOC LEDs (QOC0, QOC1, QOC2, and QOC3) output polarity |
quadratureInputGpioConfig | - Configuration value used for each GPIO pin used for quadrature input. This allows configuration of pull up/down, etc. just like a GPIO. |
port0PinsUsedAsQuadratureInput | - if set to ENABLE_PORT_0_PINS_AS_QUAD_INPUT, Port 0 selected as quadrature input port (P2 as qdx0, P3 as qdx1, P4 as qdy0, P5 as qdy1, P6 as qdz0,P7 as qdz1). if set to ENABLE_PORT_2_PINS_AS_QUAD_INPUT, Port 2 selected as quadrature input port (P32 as qdx0, P33 as qdx1, P34 as qdy0, P35 as qdy1, P36 as qdz0, P37 as qdz1) |
configureP26AsQOC0 | - if set to WICED_TRUE, P26 should be configured as QOC LED 0. if set to WICED_FALSE, P26 config is not modified. |
configureP27AsQOC1 | - if set to WICED_TRUE, P27 should be configured as QOC LED 1. if set to WICED_FALSE, P27 config is not modified. |
configureP28AsQOC2 | - if set to WICED_TRUE, P28 should be configured as QOC LED 2. if set to WICED_FALSE, P28 config is not modified. |
configureP29AsQOC3 | - if set to WICED_TRUE, P29 should be configured as QOC LED 3. if set to WICED_FALSE, P29 config is not modified. |
channelEnableAndSamplingRate | -Configuration for QD XY and Z enable and sampling rate control |
pollXAxis | -if set to WICED_TRUE, enable X Axis Data Polling. Otherwise, disable X Axis Data Polling |
pollYAxis | -if set to WICED_TRUE, enable Y Axis Data Polling. Otherwise, disable Y Axis Data Polling |
pollZAxis | -if set to WICED_TRUE, enable Z Axis Data Polling. Otherwise, disable Z Axis Data Polling |
int16_t wiced_hal_quadrature_get_scroll_count | ( | void | ) |
Returns currently accumulated motion for the active axis (X, Y or Z).
It assumes only one of the three, pollXAxis/pollYAxis/pollZAxis, is enabled.
int16_t wiced_hal_quadrature_get_X_motion | ( | void | ) |
Returns currently accumulated motion for the X axis.
The internally accumulated motion value is set to 0.
int16_t wiced_hal_quadrature_get_Y_motion | ( | void | ) |
Returns currently accumulated motion for the Y axis.
The internally accumulated motion value is set to 0.
int16_t wiced_hal_quadrature_get_Z_motion | ( | void | ) |
Returns currently accumulated motion for the Z axis.
The internally accumulated motion value is set to 0.
void wiced_hal_quadrature_init | ( | void | ) |
Initialize the quadrature driver.
The quadrature HW is also initialized if the last reset was because of power up. Clears out any accumulated motion. This must be invoked once at power up before using any quadrature HW services and this call MUST be after mia driver has been initialized.
void wiced_hal_quadrature_register_for_event_notification | ( | void(*)(void *) | userfn, |
void * | userdata | ||
) |
Register for notification of changes.
Once registered, you CAN NOT UNREGISTER; registration is meant to be a startup activity.
userfn | points to the function to call when the interrupt comes and matches one of the masks (if you pass a method, it must be static). The function does not need to clear the interrupt status; this will be done by KeyscanDriver::lhlInterrupt(). The function will be called ONCE per interrupt. |
userdata | will be passed back to userfn as-is; it can be used to carry the "this", for example. |
void wiced_hal_quadrature_turnOff | ( | void | ) |
Disable the quadrature interface including wakeups.
Also clears any accumulated motion