an adapter from any connected PS/2 keyboard to USB HID output

Dependencies:   mbed

Translates PS/2 scancodes from keyboard to USB HID output. Keyboard LEDs not working for now, but key are handled.

Committer:
pilzm
Date:
Sun Jun 07 14:36:40 2020 +0000
Revision:
5:61ad1a6be0fd
An adapter from PS/2 keyboard without USB mode to USB HID keyboard output

Who changed what in which revision?

UserRevisionLine numberNew contents of line
pilzm 5:61ad1a6be0fd 1 #ifndef _KEYMAPS_H_
pilzm 5:61ad1a6be0fd 2 #define _KEYMAPS_H_
pilzm 5:61ad1a6be0fd 3
pilzm 5:61ad1a6be0fd 4 #include "mbed.h"
pilzm 5:61ad1a6be0fd 5 /**
pilzm 5:61ad1a6be0fd 6 * Layout transition is usually handled by host OS
pilzm 5:61ad1a6be0fd 7 * if not, a different layout can be forced here
pilzm 5:61ad1a6be0fd 8 */
pilzm 5:61ad1a6be0fd 9 enum LAYOUTS {
pilzm 5:61ad1a6be0fd 10 LO_US=1,
pilzm 5:61ad1a6be0fd 11 LO_DE,
pilzm 5:61ad1a6be0fd 12 LO_UK
pilzm 5:61ad1a6be0fd 13 };
pilzm 5:61ad1a6be0fd 14
pilzm 5:61ad1a6be0fd 15 class Keymaps
pilzm 5:61ad1a6be0fd 16 {
pilzm 5:61ad1a6be0fd 17 public:
pilzm 5:61ad1a6be0fd 18 /**
pilzm 5:61ad1a6be0fd 19 * Constructor
pilzm 5:61ad1a6be0fd 20 *
pilzm 5:61ad1a6be0fd 21 *
pilzm 5:61ad1a6be0fd 22 * @param layout: Layout of PS/2 keyboard, for handling of additional/alternate keys
pilzm 5:61ad1a6be0fd 23 * @param ext: keymap for keys with E0-prefixed PS/2-scancodes
pilzm 5:61ad1a6be0fd 24 *
pilzm 5:61ad1a6be0fd 25 */
pilzm 5:61ad1a6be0fd 26 Keymaps(LAYOUTS layout, bool ext);
pilzm 5:61ad1a6be0fd 27
pilzm 5:61ad1a6be0fd 28 /**
pilzm 5:61ad1a6be0fd 29 * Array that references USB HID codes from PS/2 scancode suffix
pilzm 5:61ad1a6be0fd 30 */
pilzm 5:61ad1a6be0fd 31 uint8_t K[255];
pilzm 5:61ad1a6be0fd 32 };
pilzm 5:61ad1a6be0fd 33 #endif