Keyboard driver.
Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdint.h>
Data Structures | |
struct | keyboard_event |
Struct to hold a keycode and the related event. More... | |
Macros | |
Keyboard definitions | |
#define | KEYBOARD_NO_KEY 0 |
#define | KEYBOARD_UP 38 |
#define | KEYBOARD_UP_MASK 2 |
#define | KEYBOARD_DOWN 40 |
#define | KEYBOARD_DOWN_MASK 4 |
#define | KEYBOARD_ENTER 13 |
#define | KEYBOARD_ENTER_MASK 1 |
#define | KEYBOARD_BACK 8 |
#define | KEYBOARD_BACK_MASK 8 |
Typedefs | |
typedef uint8_t | keycode_t |
Type to contain keycode. More... | |
Enumerations | |
enum | keyboard_event_type { KEYBOARD_NO_EVENT, KEYBOARD_PRESS, KEYBOARD_RELEASE, KEYBOARD_NO_EVENT, KEYBOARD_PRESS, KEYBOARD_RELEASE } |
Keyboard event types. More... | |
Functions | |
void | keyboard_get_key_state (struct keyboard_event *key) |
Check the status of the keyboard. More... | |
#define KEYBOARD_BACK 8 |
#define KEYBOARD_BACK_MASK 8 |
#define KEYBOARD_DOWN 40 |
#define KEYBOARD_DOWN_MASK 4 |
#define KEYBOARD_ENTER 13 |
#define KEYBOARD_ENTER_MASK 1 |
#define KEYBOARD_NO_KEY 0 |
#define KEYBOARD_UP 38 |
#define KEYBOARD_UP_MASK 2 |
typedef uint8_t keycode_t |
Type to contain keycode.
enum keyboard_event_type |
void keyboard_get_key_state | ( | struct keyboard_event * | keybuffer | ) |
Check the status of the keyboard.
keybuffer | a keyboard_event struct to store keyboard status |
This function checks what keys have been pressed or released, updating their status and saving the current key change (if any) in the specified buffer.
keybuffer | Pointer to keyboard_event struct to store status. |
References cdc_getkey(), check_touch_key_pressed(), gpio_pin_is_high, gpio_pin_is_low, key, key_state, KEYBOARD_BACK, KEYBOARD_BACK_MASK, KEYBOARD_DOWN, KEYBOARD_DOWN_MASK, KEYBOARD_ENTER, KEYBOARD_ENTER_MASK, KEYBOARD_NO_EVENT, KEYBOARD_NO_KEY, KEYBOARD_PRESS, KEYBOARD_RELEASE, KEYBOARD_UP, KEYBOARD_UP_MASK, keyboard_event::keycode, touch_key_is_pressed(), and keyboard_event::type.
Referenced by button_splash(), date_time_application(), display_date_time_application(), lightsensor_application(), main(), ntc_sensor_application(), oven_classb_error_insertion(), production_date_application(), set_date_application(), set_time_application(), show_button_splash(), show_explain_splash(), and timezone_select_application().