CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
Keypad

Direct polling of the 12-button keypad. More...

Macros

#define KEY_0   0
#define KEY_1   1
#define KEY_2   2
#define KEY_3   3
#define KEY_4   4
#define KEY_5   5
#define KEY_6   6
#define KEY_7   7
#define KEY_8   8
#define KEY_9   9
#define KEY_Y   10
#define KEY_N   11

Functions

bool host_key_pressed (uint8_t key)
 True while key is currently held down.
int host_key_consume_next (uint8_t *out_key)
 Pop the next queued key press, if any.

Detailed Description

Direct polling of the 12-button keypad.

Macro Definition Documentation

◆ KEY_0

#define KEY_0   0

Definition at line 1250 of file host_api.h.

◆ KEY_1

#define KEY_1   1

Definition at line 1251 of file host_api.h.

◆ KEY_2

#define KEY_2   2

Definition at line 1252 of file host_api.h.

◆ KEY_3

#define KEY_3   3

Definition at line 1253 of file host_api.h.

◆ KEY_4

#define KEY_4   4

Definition at line 1254 of file host_api.h.

◆ KEY_5

#define KEY_5   5

Definition at line 1255 of file host_api.h.

◆ KEY_6

#define KEY_6   6

Definition at line 1256 of file host_api.h.

◆ KEY_7

#define KEY_7   7

Definition at line 1257 of file host_api.h.

◆ KEY_8

#define KEY_8   8

Definition at line 1258 of file host_api.h.

◆ KEY_9

#define KEY_9   9

Definition at line 1259 of file host_api.h.

◆ KEY_N

#define KEY_N   11

Definition at line 1261 of file host_api.h.

◆ KEY_Y

#define KEY_Y   10

Definition at line 1260 of file host_api.h.

Function Documentation

◆ host_key_consume_next()

int host_key_consume_next ( uint8_t * out_key)

Pop the next queued key press, if any.

Parameters
out_keyReceives the KEY_* code on success.
Returns
HOST_OK when a key was returned, HOST_ERR_NOT_FOUND when the queue was empty.

Definition at line 44 of file host_api_keypad.cpp.

References cdc::hal::getKeypadInstance(), HOST_ERR_GENERIC, HOST_ERR_INVALID_ARG, HOST_ERR_NOT_FOUND, HOST_OK, and cdc::hal::KEY_NONE.

Referenced by cdc::plugin_manager::w_host_key_consume_next().

◆ host_key_pressed()

bool host_key_pressed ( uint8_t key)

True while key is currently held down.

Definition at line 36 of file host_api_keypad.cpp.

References cdc::hal::getKeypadInstance(), and cdc::hal::KEY_NONE.

Referenced by cdc::plugin_manager::w_host_key_pressed().