blablabla

Dependencies:   MAG3110 MMA8451Q SLCD- TSI USBDevice mbed

Committer:
Osator
Date:
Wed Apr 16 12:20:00 2014 +0000
Revision:
0:339b7abfa147
blablabla

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Osator 0:339b7abfa147 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
Osator 0:339b7abfa147 2 *
Osator 0:339b7abfa147 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
Osator 0:339b7abfa147 4 * and associated documentation files (the "Software"), to deal in the Software without
Osator 0:339b7abfa147 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
Osator 0:339b7abfa147 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
Osator 0:339b7abfa147 7 * Software is furnished to do so, subject to the following conditions:
Osator 0:339b7abfa147 8 *
Osator 0:339b7abfa147 9 * The above copyright notice and this permission notice shall be included in all copies or
Osator 0:339b7abfa147 10 * substantial portions of the Software.
Osator 0:339b7abfa147 11 *
Osator 0:339b7abfa147 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
Osator 0:339b7abfa147 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Osator 0:339b7abfa147 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
Osator 0:339b7abfa147 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Osator 0:339b7abfa147 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Osator 0:339b7abfa147 17 */
Osator 0:339b7abfa147 18
Osator 0:339b7abfa147 19 #ifndef USBCLASS_HID_TYPES
Osator 0:339b7abfa147 20 #define USBCLASS_HID_TYPES
Osator 0:339b7abfa147 21
Osator 0:339b7abfa147 22 #include <stdint.h>
Osator 0:339b7abfa147 23
Osator 0:339b7abfa147 24 /* */
Osator 0:339b7abfa147 25 #define HID_VERSION_1_11 (0x0111)
Osator 0:339b7abfa147 26
Osator 0:339b7abfa147 27 /* HID Class */
Osator 0:339b7abfa147 28 #define HID_CLASS (3)
Osator 0:339b7abfa147 29 #define HID_SUBCLASS_NONE (0)
Osator 0:339b7abfa147 30 #define HID_PROTOCOL_NONE (0)
Osator 0:339b7abfa147 31
Osator 0:339b7abfa147 32 /* Descriptors */
Osator 0:339b7abfa147 33 #define HID_DESCRIPTOR (33)
Osator 0:339b7abfa147 34 #define HID_DESCRIPTOR_LENGTH (0x09)
Osator 0:339b7abfa147 35 #define REPORT_DESCRIPTOR (34)
Osator 0:339b7abfa147 36
Osator 0:339b7abfa147 37 /* Class requests */
Osator 0:339b7abfa147 38 #define GET_REPORT (0x1)
Osator 0:339b7abfa147 39 #define GET_IDLE (0x2)
Osator 0:339b7abfa147 40 #define SET_REPORT (0x9)
Osator 0:339b7abfa147 41 #define SET_IDLE (0xa)
Osator 0:339b7abfa147 42
Osator 0:339b7abfa147 43 /* HID Class Report Descriptor */
Osator 0:339b7abfa147 44 /* Short items: size is 0, 1, 2 or 3 specifying 0, 1, 2 or 4 (four) bytes */
Osator 0:339b7abfa147 45 /* of data as per HID Class standard */
Osator 0:339b7abfa147 46
Osator 0:339b7abfa147 47 /* Main items */
Osator 0:339b7abfa147 48 #define INPUT(size) (0x80 | size)
Osator 0:339b7abfa147 49 #define OUTPUT(size) (0x90 | size)
Osator 0:339b7abfa147 50 #define FEATURE(size) (0xb0 | size)
Osator 0:339b7abfa147 51 #define COLLECTION(size) (0xa0 | size)
Osator 0:339b7abfa147 52 #define END_COLLECTION(size) (0xc0 | size)
Osator 0:339b7abfa147 53
Osator 0:339b7abfa147 54 /* Global items */
Osator 0:339b7abfa147 55 #define USAGE_PAGE(size) (0x04 | size)
Osator 0:339b7abfa147 56 #define LOGICAL_MINIMUM(size) (0x14 | size)
Osator 0:339b7abfa147 57 #define LOGICAL_MAXIMUM(size) (0x24 | size)
Osator 0:339b7abfa147 58 #define PHYSICAL_MINIMUM(size) (0x34 | size)
Osator 0:339b7abfa147 59 #define PHYSICAL_MAXIMUM(size) (0x44 | size)
Osator 0:339b7abfa147 60 #define UNIT_EXPONENT(size) (0x54 | size)
Osator 0:339b7abfa147 61 #define UNIT(size) (0x64 | size)
Osator 0:339b7abfa147 62 #define REPORT_SIZE(size) (0x74 | size)
Osator 0:339b7abfa147 63 #define REPORT_ID(size) (0x84 | size)
Osator 0:339b7abfa147 64 #define REPORT_COUNT(size) (0x94 | size)
Osator 0:339b7abfa147 65 #define PUSH(size) (0xa4 | size)
Osator 0:339b7abfa147 66 #define POP(size) (0xb4 | size)
Osator 0:339b7abfa147 67
Osator 0:339b7abfa147 68 /* Local items */
Osator 0:339b7abfa147 69 #define USAGE(size) (0x08 | size)
Osator 0:339b7abfa147 70 #define USAGE_MINIMUM(size) (0x18 | size)
Osator 0:339b7abfa147 71 #define USAGE_MAXIMUM(size) (0x28 | size)
Osator 0:339b7abfa147 72 #define DESIGNATOR_INDEX(size) (0x38 | size)
Osator 0:339b7abfa147 73 #define DESIGNATOR_MINIMUM(size) (0x48 | size)
Osator 0:339b7abfa147 74 #define DESIGNATOR_MAXIMUM(size) (0x58 | size)
Osator 0:339b7abfa147 75 #define STRING_INDEX(size) (0x78 | size)
Osator 0:339b7abfa147 76 #define STRING_MINIMUM(size) (0x88 | size)
Osator 0:339b7abfa147 77 #define STRING_MAXIMUM(size) (0x98 | size)
Osator 0:339b7abfa147 78 #define DELIMITER(size) (0xa8 | size)
Osator 0:339b7abfa147 79
Osator 0:339b7abfa147 80 /* HID Report */
Osator 0:339b7abfa147 81 /* Where report IDs are used the first byte of 'data' will be the */
Osator 0:339b7abfa147 82 /* report ID and 'length' will include this report ID byte. */
Osator 0:339b7abfa147 83
Osator 0:339b7abfa147 84 #define MAX_HID_REPORT_SIZE (64)
Osator 0:339b7abfa147 85
Osator 0:339b7abfa147 86 typedef struct {
Osator 0:339b7abfa147 87 uint32_t length;
Osator 0:339b7abfa147 88 uint8_t data[MAX_HID_REPORT_SIZE];
Osator 0:339b7abfa147 89 } HID_REPORT;
Osator 0:339b7abfa147 90
Osator 0:339b7abfa147 91 #endif