summaryrefslogtreecommitdiff
path: root/firmware/src/keyboard.h
blob: 3f492e915511b040249f367e737a41bd432db9fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* 
 * File:   keyboard.h
 * Author: Camil Staps <info@camilstaps.nl>
 *
 * Created on August 30, 2015, 11:29 AM
 */

#ifndef KEYBOARD_H
#define	KEYBOARD_H

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include "usb/usb_hid.h"

#ifdef	__cplusplus
extern "C" {
#endif

bool keyboard_init();
void keyboard_setKeyHandler(void(*keyHandler)(USB_HID_KEYBOARD_KEYPAD));
void keyboard_handleKeys(void);

void BSP_USBVBUSPowerEnable(uint8_t port, bool enable);
bool BSP_USBVBUSSwitchOverCurrentDetect(uint8_t port);

const static char *keyboard_keyValue[] = { 
        "No event indicated", "ErrorRoll Over", "POSTFail", "Error Undefined",
        "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
        "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
        "1", "2", "3", "4", "5", "6", "7", "8", "9", "0",
        "ENTER", "ESCAPE", "BACKSPACE", "TAB", "SPACEBAR",
        "-", "=", "[", "]", "\\0", "~", ";", "'", "GRAVE ACCENT", ",", ".", "/",
        "CAPS LOCK",
        "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12" 
};

#ifdef	__cplusplus
}
#endif

#endif	/* KEYBOARD_H */