KEYSCAN

Description

Keyscan driver.

Data Structures

struct sl_keyscan_driver_process_keyscan_event_handle_t
An Event Handle.

Functions

sl_status_t sl_keyscan_driver_init (void)
Initializes the keyscan driver.
void sl_keyscan_driver_subscribe_event ( sl_keyscan_driver_process_keyscan_event_handle_t *event_handle)
Registers an event callback to be called on Keyscan event.
void sl_keyscan_driver_unsubscribe_event ( sl_keyscan_driver_process_keyscan_event_handle_t *event_handle)
Unregisters an event callback to be called on Keyscan event.
sl_status_t sl_keyscan_driver_start_scan (void)
Starts the keyscan scan.
sl_status_t sl_keyscan_driver_stop_scan (void)
Stops the keyscan scan.

Typedefs

typedef void(* sl_keyscan_driver_process_keyscan_event ) (uint8_t *p_keyscan_matrix, sl_keyscan_driver_status_t status)
A Keyscan event handler.

Enumerations

enum sl_keyscan_driver_status_t {
SL_KEYSCAN_STATUS_KEYPRESS_VALID = 0,
SL_KEYSCAN_STATUS_KEYPRESS_INVALID ,
SL_KEYSCAN_STATUS_KEYPRESS_RELEASED
}
KEYSCAN status values.

Function Documentation

sl_keyscan_driver_init()

sl_status_t sl_keyscan_driver_init ( void )

Initializes the keyscan driver.

Returns
0 if successful. Error code otherwise.

sl_keyscan_driver_subscribe_event()

void sl_keyscan_driver_subscribe_event ( sl_keyscan_driver_process_keyscan_event_handle_t * event_handle )

Registers an event callback to be called on Keyscan event.

Parameters
[in] event_handle Event handle to register
Note
An EFM_ASSERT is thrown if the handle is NULL.
Must be called before init function.

Registers an event callback to be called on Keyscan event.

sl_keyscan_driver_unsubscribe_event()

void sl_keyscan_driver_unsubscribe_event ( sl_keyscan_driver_process_keyscan_event_handle_t * event_handle )

Unregisters an event callback to be called on Keyscan event.

Parameters
[in] event_handle Event handle which must be unregistered (must have been registered previously).
Note
An EFM_ASSERT is thrown if the handle is not found or is NULL.

Unregisters an event callback to be called on Keyscan event.

sl_keyscan_driver_start_scan()

sl_status_t sl_keyscan_driver_start_scan ( void )

Starts the keyscan scan.

Returns
0 if successful. Error code otherwise.

sl_keyscan_driver_stop_scan()

sl_status_t sl_keyscan_driver_stop_scan ( void )

Stops the keyscan scan.

Returns
0 if successful. Error code otherwise.

Typedef Documentation

sl_keyscan_driver_process_keyscan_event

typedef void(* sl_keyscan_driver_process_keyscan_event) (uint8_t *p_keyscan_matrix, sl_keyscan_driver_status_t status)

A Keyscan event handler.

Enumeration Type Documentation

sl_keyscan_driver_status_t

KEYSCAN status values.