]>
git.gir.st - tmk_keyboard.git/blob - host.h
8 #define REPORT_ID_MOUSE 1
9 #define REPORT_ID_SYSTEM 2
10 #define REPORT_ID_AUDIO 3
12 /* keyboard Modifiers in boot protocol report */
13 #define BIT_LCTRL (1<<0)
14 #define BIT_LSHIFT (1<<1)
15 #define BIT_LALT (1<<2)
16 #define BIT_LGUI (1<<3)
17 #define BIT_RCTRL (1<<4)
18 #define BIT_RSHIFT (1<<5)
19 #define BIT_RALT (1<<6)
20 #define BIT_RGUI (1<<7)
21 #define BIT_LCTL BIT_LCTRL
22 #define BIT_RCTL BIT_RCTRL
23 #define BIT_LSFT BIT_LSHIFT
24 #define BIT_RSFT BIT_RSHIFT
27 #define MOUSE_BTN1 (1<<0)
28 #define MOUSE_BTN2 (1<<1)
29 #define MOUSE_BTN3 (1<<2)
30 #define MOUSE_BTN4 (1<<3)
31 #define MOUSE_BTN5 (1<<4)
33 // Consumer Page(0x0C) Consumer Control(0x01)
34 #define AUDIO_VOL_UP (1<<0)
35 #define AUDIO_VOL_DOWN (1<<1)
36 #define AUDIO_MUTE (1<<2)
38 // Generic Desktop Page(0x01) System Control(0x80)
39 #define SYSTEM_POWER_DOWN (1<<0)
40 #define SYSTEM_SLEEP (1<<1)
41 #define SYSTEM_WAKE_UP (1<<2)
44 #if defined(HOST_PJRC)
46 # if defined(KBD2_REPORT_KEYS) && KBD2_REPORT_KEYS > KBD_REPORT_KEYS
47 # define REPORT_KEYS KBD2_REPORT_KEYS
49 # define REPORT_KEYS KBD_REPORT_KEYS
51 #elif defined(HOST_VUSB)
52 # define REPORT_KEYS 6
58 uint8_t keys
[REPORT_KEYS
];
71 #ifdef USB_NKRO_ENABLE
72 extern bool keyboard_nkro
;
75 extern report_keyboard_t
*keyboard_report
;
76 extern report_keyboard_t
*keyboard_report_prev
;
79 uint8_t host_keyboard_leds(void);
81 /* keyboard report operations */
82 void host_add_key(uint8_t key
);
83 void host_add_mod_bit(uint8_t mod
);
84 void host_set_mods(uint8_t mods
);
85 void host_add_code(uint8_t code
);
86 void host_swap_keyboard_report(void);
87 void host_clear_keyboard_report(void);
88 uint8_t host_has_anykey(void);
89 uint8_t host_get_first_key(void);
92 void host_send_keyboard_report(void);
93 #if defined(MOUSEKEY_ENABLE) || defined(PS2_MOUSE_ENABLE)
94 void host_mouse_send(report_mouse_t
*report
);
96 #ifdef USB_EXTRA_ENABLE
97 void host_system_send(uint8_t data
);
98 void host_audio_send(uint8_t data
);