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