Defines the AIROC standard keyscan driver.
More...
Defines the AIROC standard keyscan driver.
The AIROC standard keyscan driver provides the status and control for the keyscan interface. It provides the keyEvents to the interface, maintains the queue behind it. It also supports keyscanning turning on or off.
void wiced_hal_keyscan_config_gpios |
( |
void |
| ) |
|
Configure GPIOs for keyscan operation.
Note that only GPIOs that are in the matrix are configured for keyscan operation. GPIOs that are not part of the scan matrix are left alone.
- Parameters
-
- Returns
- - none
void wiced_hal_keyscan_configure |
( |
uint8_t |
num_rows, |
|
|
uint8_t |
num_columns |
|
) |
| |
configure Keyscan matrix row and column
Application use this to configure its number of keyscan matrix rows and columns. This only need to be done once before keyscan driver initialization
- Parameters
-
num_rows | - number of rows in keyscan matrix |
num_columns | - number of columns in keyscan matrix |
- Returns
- - none
void wiced_hal_keyscan_enable_ghost_detection |
( |
wiced_bool_t |
enable | ) |
|
Enable/disable keyscan ghost key detection.
- Parameters
-
enable | - enable(WICED_TRUE)/disable(WICED_FALSE) |
- Returns
- - none
wiced_bool_t wiced_hal_keyscan_events_pending |
( |
void |
| ) |
|
Check if there are any pending events in the firmware FIFO.
- Returns
- WICED_TRUE if keyscan events are pending in firmware FIFO
- WICED_FALSE otherwise
void wiced_hal_keyscan_flush_HW_events |
( |
void |
| ) |
|
Clears the keys in the HW queue.
- Parameters
-
- Returns
- - none
wiced_bool_t wiced_hal_keyscan_get_next_event |
( |
KeyEvent * |
key | ) |
|
Get the next event.
Note that this function only returns events from the FW FIFO. It does not check the HW. The HW is checked when the MIA poll function is called.
- Parameters
-
key | - pointer to the key event |
- Returns
- WICED_FALSE - if FW fifo is empty,
- WICED_TRUE - otherwise.
void wiced_hal_keyscan_init |
( |
void |
| ) |
|
Keyscan driver initialization function.
Thisw allocates space for the FW FIFO for key events and initializes the keyscan HW. This function should be invoked only once before using any keyscan services. Subsequent invocations will invoke undefined behavior. Keyscan driver must be initialized AFTER mia driver is initialized.
- Parameters
-
- Returns
- - none
wiced_bool_t wiced_hal_keyscan_is_any_key_pressed |
( |
void |
| ) |
|
check if HW detects any pressed key
- Parameters
-
- Returns
- - WICED_TRUE -some key is pressed WICED_FALSE -all keys are released
void wiced_hal_keyscan_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
- Parameters
-
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; |
- Returns
- - none
void wiced_hal_keyscan_reset |
( |
void |
| ) |
|
Reset the keyscan HW.
All state information and events are lost. Any pressed keys will be detected anew.
- Parameters
-
- Returns
- - none
void wiced_hal_keyscan_turnOff |
( |
void |
| ) |
|
Turns off the keyscan HW.
- Parameters
-
- Returns
- - none