summaryrefslogtreecommitdiffstats
path: root/kbd.h
blob: 0c8566e70a035bc2ca60947cddb4ab7ae11bc0de (plain)
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
#ifndef _AVR_KBD_H_
#define _AVR_KBD_H_

#include <avr/io.h>
#include <stdint.h>
#include <stdbool.h>

#define KBD_FLAG_ERROR  (_BV(0))
#define KBD_FLAG_BREAK  (_BV(1))
#define KBD_FLAG_EXT    (_BV(2))

#define KBD_CODE_SPACE  0x29
#define KBD_CODE_UP     0xe075
#define KBD_CODE_LEFT   0xe06b
#define KBD_CODE_DOWN   0xe072
#define KBD_CODE_RIGHT  0xe074

#define KBD_CMD_RESET   0xff


void kbd_handle(uint16_t code, bool make);

void kbd_send(uint8_t command);
void kbd_init(void);

#endif /* _AVR_KBD_H_ */