Smart Remote 3 nRF52 v1.2
Macros | Functions
Matrix keyboard driver

This header file defines the prototypes for keyboard matrix driver functions. More...

Macros

#define DRV_KEYBOARD_MAX_KEYS   6
 Maximum number of simultaneously held keys.
 

Functions

ret_code_t drv_keyboard_disable (void)
 Disable keyboard scanning. More...
 
ret_code_t drv_keyboard_enable (void)
 Enable keyboard scanning. More...
 
ret_code_t drv_keyboard_init (drv_keyboard_event_handler_t keyboard_event_handler)
 Keyboard driver initialization. More...
 
ret_code_t drv_keyboard_keys_get (uint8_t *p_pressed_keys, uint8_t *p_number_of_pressed_keys, bool *p_keys_blocked)
 Get the state of keyboard matrix. More...
 
bool drv_keyboard_shutdown (bool wakeup)
 Shutdown keyboard and prepare it for sleeping. More...
 

Detailed Description

This header file defines the prototypes for keyboard matrix driver functions.

Function Documentation

ret_code_t drv_keyboard_disable ( void  )

Disable keyboard scanning.

Returns
NRF_SUCCESS on success, otherwise an error code.
ret_code_t drv_keyboard_enable ( void  )

Enable keyboard scanning.

Returns
NRF_SUCCESS on success, otherwise an error code.
ret_code_t drv_keyboard_init ( drv_keyboard_event_handler_t  keyboard_event_handler)

Keyboard driver initialization.

Parameters
[in]keyboard_event_handlerHandler for data read from the keyboard.
Returns
NRF_SUCCESS on success, otherwise an error code.
ret_code_t drv_keyboard_keys_get ( uint8_t *  p_pressed_keys,
uint8_t *  p_number_of_pressed_keys,
bool *  p_keys_blocked 
)

Get the state of keyboard matrix.

One scan performed as a blocking function. Functional only when pulling is disabled. Returns an error otherwise.

Parameters
[out]p_pressed_keysPointer to the pressed_keys array. The array should have at least KEY_VECTOR_SIZE elements.
[out]p_number_of_pressed_keysNumber of pressed keys.
[out]p_keys_blockedTrue, if some keys are blocked and cannot be read.
Returns
NRF_SUCCESS on success, otherwise an error code.
bool drv_keyboard_shutdown ( bool  wakeup)

Shutdown keyboard and prepare it for sleeping.

Parameters
[in]wakeupIf false, go to deepest sleep and do not prepare to wake up the system.
Returns
True if the module is ready for shutdown, false otherwise.

Documentation feedback | Developer Zone | Subscribe | Updated