1 /** 2 ****************************************************************************** 3 * @file usbh_hid_keybd.h 4 * @author MCD Application Team 5 * @brief This file contains all the prototypes for the usbh_hid_keybd.c 6 ****************************************************************************** 7 * @attention 8 * 9 * <h2><center>© Copyright (c) 2015 STMicroelectronics. 10 * All rights reserved.</center></h2> 11 * 12 * This software component is licensed by ST under Ultimate Liberty license 13 * SLA0044, the "License"; You may not use this file except in compliance with 14 * the License. You may obtain a copy of the License at: 15 * www.st.com/SLA0044 16 * 17 ****************************************************************************** 18 */ 19 20 /* Define to prevent recursive -----------------------------------------------*/ 21 #ifndef __USBH_HID_KEYBD_H 22 #define __USBH_HID_KEYBD_H 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 /* Includes ------------------------------------------------------------------*/ 29 #include "usbh_hid.h" 30 #include "usbh_hid_keybd.h" 31 32 /** @addtogroup USBH_LIB 33 * @{ 34 */ 35 36 /** @addtogroup USBH_CLASS 37 * @{ 38 */ 39 40 /** @addtogroup USBH_HID_CLASS 41 * @{ 42 */ 43 44 /** @defgroup USBH_HID_KEYBD 45 * @brief This file is the Header file for usbh_hid_keybd.c 46 * @{ 47 */ 48 49 50 /** @defgroup USBH_HID_KEYBD_Exported_Types 51 * @{ 52 */ 53 #define KEY_NONE 0x00 54 #define KEY_ERRORROLLOVER 0x01 55 #define KEY_POSTFAIL 0x02 56 #define KEY_ERRORUNDEFINED 0x03 57 #define KEY_A 0x04 58 #define KEY_B 0x05 59 #define KEY_C 0x06 60 #define KEY_D 0x07 61 #define KEY_E 0x08 62 #define KEY_F 0x09 63 #define KEY_G 0x0A 64 #define KEY_H 0x0B 65 #define KEY_I 0x0C 66 #define KEY_J 0x0D 67 #define KEY_K 0x0E 68 #define KEY_L 0x0F 69 #define KEY_M 0x10 70 #define KEY_N 0x11 71 #define KEY_O 0x12 72 #define KEY_P 0x13 73 #define KEY_Q 0x14 74 #define KEY_R 0x15 75 #define KEY_S 0x16 76 #define KEY_T 0x17 77 #define KEY_U 0x18 78 #define KEY_V 0x19 79 #define KEY_W 0x1A 80 #define KEY_X 0x1B 81 #define KEY_Y 0x1C 82 #define KEY_Z 0x1D 83 #define KEY_1_EXCLAMATION_MARK 0x1E 84 #define KEY_2_AT 0x1F 85 #define KEY_3_NUMBER_SIGN 0x20 86 #define KEY_4_DOLLAR 0x21 87 #define KEY_5_PERCENT 0x22 88 #define KEY_6_CARET 0x23 89 #define KEY_7_AMPERSAND 0x24 90 #define KEY_8_ASTERISK 0x25 91 #define KEY_9_OPARENTHESIS 0x26 92 #define KEY_0_CPARENTHESIS 0x27 93 #define KEY_ENTER 0x28 94 #define KEY_ESCAPE 0x29 95 #define KEY_BACKSPACE 0x2A 96 #define KEY_TAB 0x2B 97 #define KEY_SPACEBAR 0x2C 98 #define KEY_MINUS_UNDERSCORE 0x2D 99 #define KEY_EQUAL_PLUS 0x2E 100 #define KEY_OBRACKET_AND_OBRACE 0x2F 101 #define KEY_CBRACKET_AND_CBRACE 0x30 102 #define KEY_BACKSLASH_VERTICAL_BAR 0x31 103 #define KEY_NONUS_NUMBER_SIGN_TILDE 0x32 104 #define KEY_SEMICOLON_COLON 0x33 105 #define KEY_SINGLE_AND_DOUBLE_QUOTE 0x34 106 #define KEY_GRAVE ACCENT AND TILDE 0x35 107 #define KEY_COMMA_AND_LESS 0x36 108 #define KEY_DOT_GREATER 0x37 109 #define KEY_SLASH_QUESTION 0x38 110 #define KEY_CAPS LOCK 0x39 111 #define KEY_F1 0x3A 112 #define KEY_F2 0x3B 113 #define KEY_F3 0x3C 114 #define KEY_F4 0x3D 115 #define KEY_F5 0x3E 116 #define KEY_F6 0x3F 117 #define KEY_F7 0x40 118 #define KEY_F8 0x41 119 #define KEY_F9 0x42 120 #define KEY_F10 0x43 121 #define KEY_F11 0x44 122 #define KEY_F12 0x45 123 #define KEY_PRINTSCREEN 0x46 124 #define KEY_SCROLL LOCK 0x47 125 #define KEY_PAUSE 0x48 126 #define KEY_INSERT 0x49 127 #define KEY_HOME 0x4A 128 #define KEY_PAGEUP 0x4B 129 #define KEY_DELETE 0x4C 130 #define KEY_END1 0x4D 131 #define KEY_PAGEDOWN 0x4E 132 #define KEY_RIGHTARROW 0x4F 133 #define KEY_LEFTARROW 0x50 134 #define KEY_DOWNARROW 0x51 135 #define KEY_UPARROW 0x52 136 #define KEY_KEYPAD_NUM_LOCK_AND_CLEAR 0x53 137 #define KEY_KEYPAD_SLASH 0x54 138 #define KEY_KEYPAD_ASTERIKS 0x55 139 #define KEY_KEYPAD_MINUS 0x56 140 #define KEY_KEYPAD_PLUS 0x57 141 #define KEY_KEYPAD_ENTER 0x58 142 #define KEY_KEYPAD_1_END 0x59 143 #define KEY_KEYPAD_2_DOWN_ARROW 0x5A 144 #define KEY_KEYPAD_3_PAGEDN 0x5B 145 #define KEY_KEYPAD_4_LEFT_ARROW 0x5C 146 #define KEY_KEYPAD_5 0x5D 147 #define KEY_KEYPAD_6_RIGHT_ARROW 0x5E 148 #define KEY_KEYPAD_7_HOME 0x5F 149 #define KEY_KEYPAD_8_UP_ARROW 0x60 150 #define KEY_KEYPAD_9_PAGEUP 0x61 151 #define KEY_KEYPAD_0_INSERT 0x62 152 #define KEY_KEYPAD_DECIMAL_SEPARATOR_DELETE 0x63 153 #define KEY_NONUS_BACK_SLASH_VERTICAL_BAR 0x64 154 #define KEY_APPLICATION 0x65 155 #define KEY_POWER 0x66 156 #define KEY_KEYPAD_EQUAL 0x67 157 #define KEY_F13 0x68 158 #define KEY_F14 0x69 159 #define KEY_F15 0x6A 160 #define KEY_F16 0x6B 161 #define KEY_F17 0x6C 162 #define KEY_F18 0x6D 163 #define KEY_F19 0x6E 164 #define KEY_F20 0x6F 165 #define KEY_F21 0x70 166 #define KEY_F22 0x71 167 #define KEY_F23 0x72 168 #define KEY_F24 0x73 169 #define KEY_EXECUTE 0x74 170 #define KEY_HELP 0x75 171 #define KEY_MENU 0x76 172 #define KEY_SELECT 0x77 173 #define KEY_STOP 0x78 174 #define KEY_AGAIN 0x79 175 #define KEY_UNDO 0x7A 176 #define KEY_CUT 0x7B 177 #define KEY_COPY 0x7C 178 #define KEY_PASTE 0x7D 179 #define KEY_FIND 0x7E 180 #define KEY_MUTE 0x7F 181 #define KEY_VOLUME_UP 0x80 182 #define KEY_VOLUME_DOWN 0x81 183 #define KEY_LOCKING_CAPS_LOCK 0x82 184 #define KEY_LOCKING_NUM_LOCK 0x83 185 #define KEY_LOCKING_SCROLL_LOCK 0x84 186 #define KEY_KEYPAD_COMMA 0x85 187 #define KEY_KEYPAD_EQUAL_SIGN 0x86 188 #define KEY_INTERNATIONAL1 0x87 189 #define KEY_INTERNATIONAL2 0x88 190 #define KEY_INTERNATIONAL3 0x89 191 #define KEY_INTERNATIONAL4 0x8A 192 #define KEY_INTERNATIONAL5 0x8B 193 #define KEY_INTERNATIONAL6 0x8C 194 #define KEY_INTERNATIONAL7 0x8D 195 #define KEY_INTERNATIONAL8 0x8E 196 #define KEY_INTERNATIONAL9 0x8F 197 #define KEY_LANG1 0x90 198 #define KEY_LANG2 0x91 199 #define KEY_LANG3 0x92 200 #define KEY_LANG4 0x93 201 #define KEY_LANG5 0x94 202 #define KEY_LANG6 0x95 203 #define KEY_LANG7 0x96 204 #define KEY_LANG8 0x97 205 #define KEY_LANG9 0x98 206 #define KEY_ALTERNATE_ERASE 0x99 207 #define KEY_SYSREQ 0x9A 208 #define KEY_CANCEL 0x9B 209 #define KEY_CLEAR 0x9C 210 #define KEY_PRIOR 0x9D 211 #define KEY_RETURN 0x9E 212 #define KEY_SEPARATOR 0x9F 213 #define KEY_OUT 0xA0 214 #define KEY_OPER 0xA1 215 #define KEY_CLEAR_AGAIN 0xA2 216 #define KEY_CRSEL 0xA3 217 #define KEY_EXSEL 0xA4 218 #define KEY_KEYPAD_00 0xB0 219 #define KEY_KEYPAD_000 0xB1 220 #define KEY_THOUSANDS_SEPARATOR 0xB2 221 #define KEY_DECIMAL_SEPARATOR 0xB3 222 #define KEY_CURRENCY_UNIT 0xB4 223 #define KEY_CURRENCY_SUB_UNIT 0xB5 224 #define KEY_KEYPAD_OPARENTHESIS 0xB6 225 #define KEY_KEYPAD_CPARENTHESIS 0xB7 226 #define KEY_KEYPAD_OBRACE 0xB8 227 #define KEY_KEYPAD_CBRACE 0xB9 228 #define KEY_KEYPAD_TAB 0xBA 229 #define KEY_KEYPAD_BACKSPACE 0xBB 230 #define KEY_KEYPAD_A 0xBC 231 #define KEY_KEYPAD_B 0xBD 232 #define KEY_KEYPAD_C 0xBE 233 #define KEY_KEYPAD_D 0xBF 234 #define KEY_KEYPAD_E 0xC0 235 #define KEY_KEYPAD_F 0xC1 236 #define KEY_KEYPAD_XOR 0xC2 237 #define KEY_KEYPAD_CARET 0xC3 238 #define KEY_KEYPAD_PERCENT 0xC4 239 #define KEY_KEYPAD_LESS 0xC5 240 #define KEY_KEYPAD_GREATER 0xC6 241 #define KEY_KEYPAD_AMPERSAND 0xC7 242 #define KEY_KEYPAD_LOGICAL_AND 0xC8 243 #define KEY_KEYPAD_VERTICAL_BAR 0xC9 244 #define KEY_KEYPAD_LOGIACL_OR 0xCA 245 #define KEY_KEYPAD_COLON 0xCB 246 #define KEY_KEYPAD_NUMBER_SIGN 0xCC 247 #define KEY_KEYPAD_SPACE 0xCD 248 #define KEY_KEYPAD_AT 0xCE 249 #define KEY_KEYPAD_EXCLAMATION_MARK 0xCF 250 #define KEY_KEYPAD_MEMORY_STORE 0xD0 251 #define KEY_KEYPAD_MEMORY_RECALL 0xD1 252 #define KEY_KEYPAD_MEMORY_CLEAR 0xD2 253 #define KEY_KEYPAD_MEMORY_ADD 0xD3 254 #define KEY_KEYPAD_MEMORY_SUBTRACT 0xD4 255 #define KEY_KEYPAD_MEMORY_MULTIPLY 0xD5 256 #define KEY_KEYPAD_MEMORY_DIVIDE 0xD6 257 #define KEY_KEYPAD_PLUSMINUS 0xD7 258 #define KEY_KEYPAD_CLEAR 0xD8 259 #define KEY_KEYPAD_CLEAR_ENTRY 0xD9 260 #define KEY_KEYPAD_BINARY 0xDA 261 #define KEY_KEYPAD_OCTAL 0xDB 262 #define KEY_KEYPAD_DECIMAL 0xDC 263 #define KEY_KEYPAD_HEXADECIMAL 0xDD 264 #define KEY_LEFTCONTROL 0xE0 265 #define KEY_LEFTSHIFT 0xE1 266 #define KEY_LEFTALT 0xE2 267 #define KEY_LEFT_GUI 0xE3 268 #define KEY_RIGHTCONTROL 0xE4 269 #define KEY_RIGHTSHIFT 0xE5 270 #define KEY_RIGHTALT 0xE6 271 #define KEY_RIGHT_GUI 0xE7 272 273 typedef struct 274 { 275 uint8_t state; 276 uint8_t lctrl; 277 uint8_t lshift; 278 uint8_t lalt; 279 uint8_t lgui; 280 uint8_t rctrl; 281 uint8_t rshift; 282 uint8_t ralt; 283 uint8_t rgui; 284 uint8_t keys[6]; 285 } 286 HID_KEYBD_Info_TypeDef; 287 288 USBH_StatusTypeDef USBH_HID_KeybdInit(USBH_HandleTypeDef *phost); 289 HID_KEYBD_Info_TypeDef *USBH_HID_GetKeybdInfo(USBH_HandleTypeDef *phost); 290 uint8_t USBH_HID_GetASCIICode(HID_KEYBD_Info_TypeDef *info); 291 292 /** 293 * @} 294 */ 295 296 #ifdef __cplusplus 297 } 298 #endif 299 300 #endif /* __USBH_HID_KEYBD_H */ 301 302 /** 303 * @} 304 */ 305 306 /** 307 * @} 308 */ 309 310 /** 311 * @} 312 */ 313 314 /** 315 * @} 316 */ 317 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 318 319