Cherry 8x16 keyboard matrix driver.
More...
|
cherry8x16_status_t | cherry8x16_init (const uint8_t volatile *row_port, uint16_t *column_port, const uint8_t *key_lookup_matrix) |
| Function for initializing the driver. More...
|
|
bool | cherry8x16_new_packet (const uint8_t **p_key_packet, uint8_t *p_key_packet_size) |
| Function for creating a new key packet if new data is available and key ghosting is not detected. More...
|
|
Cherry 8x16 keyboard matrix driver.
Describes return values for: cherry8x16_init
Enumerator |
---|
CHERRY8x16_OK |
Operation was succesful.
|
CHERRY8x16_NOT_DETECTED |
Product/Revision ID was not what was expected
|
CHERRY8x16_INVALID_PARAMETER |
Given parameters were not valid
|
cherry8x16_status_t cherry8x16_init |
( |
const uint8_t volatile * |
row_port, |
|
|
uint16_t * |
column_port, |
|
|
const uint8_t * |
key_lookup_matrix |
|
) |
| |
Function for initializing the driver.
- Note
- Before calling this function, setup row_port as IO inputs with pulldowns enabled and column_port as IO outputs.
- Parameters
-
row_port | Pointer to GPIO port address that is used as key matrix row input. |
column_port | Pointer to GPIO port address that is used as key matrix column output. |
key_lookup_matrix | If NULL, use a default key lookup matrix. Otherwise pointer to a 128 (8x16) element array containing HID keycodes. |
- Returns
- Return values
-
CHERRY8X16_OK | Peripheral was initialized succesfully. |
CHERRY8X16_NOT_DETECTED | Could not detect the peripheral. |
bool cherry8x16_new_packet |
( |
const uint8_t ** |
p_key_packet, |
|
|
uint8_t * |
p_key_packet_size |
|
) |
| |
Function for creating a new key packet if new data is available and key ghosting is not detected.
- Parameters
-
p_key_packet | Array that will hold the created key packet. Previously created packet will be discarded. |
p_key_packet_size | Key packet size in bytes. |
- Returns
- Return values
-
true | If new packet was created. |
false | If packet was not created. |