]>
git.gir.st - tmk_keyboard.git/blob - converter/adb_usb/adb_blargg.h
1 // Basic support for ADB keyboard
9 // Sets up ADB bus. Doesn't send anything to keyboard.
10 void adb_host_init( void );
12 // Receives key press event from keyboard.
13 // 0xKKFF: one key changed state
14 // 0xKKKK: two keys changed state
15 enum { adb_host_nothing
= 0 }; // no keys changed state
16 enum { adb_host_error
= 0xFFFE }; // receive error
17 uint16_t adb_host_kbd_recv( void );
19 // Current state of keyboard modifiers and a few other keys
20 // Returns adb_host_nothing if keyboard didn't respond.
21 // Returns adb_host_error if error receiving.
22 uint16_t adb_host_kbd_modifiers( void );
24 // Sends command and two bytes of data to keyboard
25 void adb_host_listen( uint8_t cmd
, uint8_t data_h
, uint8_t data_l
);
27 // Sets keyboard LEDs. Note that bits are inverted here, so 1 means off, 0 means on.
28 void adb_host_kbd_led( uint8_t led
);
30 // State of power switch (false = pressed), or true if unsupported
31 bool adb_host_psw( void );
35 #define ADB_POWER 0x7F