usbhhid.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // usbhhid.h - This hold the host driver for hid class.
4 //
5 // Copyright (c) 2008-2017 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Texas Instruments (TI) is supplying this software for use solely and
9 // exclusively on TI's microcontroller products. The software is owned by
10 // TI and/or its suppliers, and is protected under applicable copyright
11 // laws. You may not combine this software with "viral" open-source
12 // software in order to form a larger program.
13 //
14 // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
15 // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
16 // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
18 // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
19 // DAMAGES, FOR ANY REASON WHATSOEVER.
20 //
21 //*****************************************************************************
22 
23 #ifndef __USBHHID_H__
24 #define __USBHHID_H__
25 
26 //*****************************************************************************
27 //
28 // If building with a C++ compiler, make all of the definitions in this header
29 // have a C binding.
30 //
31 //*****************************************************************************
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 //*****************************************************************************
38 //
41 //
42 //*****************************************************************************
43 
44 typedef struct tHIDInstance tHIDInstance;
45 
46 //*****************************************************************************
47 //
48 // These defines are the the events that will be passed in the ui32Event
49 // parameter of the callback from the driver.
50 //
51 //*****************************************************************************
52 #define USBH_EVENT_HID_SETRPT USBH_HID_EVENT_BASE + 0
53 #define USBH_EVENT_HID_REPORT USBH_HID_EVENT_BASE + 1
54 
55 //
57 //
58 #define USBH_EVENT_HID_KB_PRESS USBH_HID_EVENT_BASE + 16
59 
60 //
62 //
63 #define USBH_EVENT_HID_KB_REL USBH_HID_EVENT_BASE + 17
64 
65 //
67 //
68 #define USBH_EVENT_HID_KB_MOD USBH_HID_EVENT_BASE + 18
69 
70 //
72 //
73 #define USBH_EVENT_HID_MS_PRESS USBH_HID_EVENT_BASE + 32
74 
75 //
77 //
78 #define USBH_EVENT_HID_MS_REL USBH_HID_EVENT_BASE + 33
79 
80 //
82 //
83 #define USBH_EVENT_HID_MS_X USBH_HID_EVENT_BASE + 34
84 
85 //
87 //
88 #define USBH_EVENT_HID_MS_Y USBH_HID_EVENT_BASE + 35
89 
90 //*****************************************************************************
91 //
94 //
95 //*****************************************************************************
96 typedef enum
97 {
98  //
101  //
103 
104  //
106  //
108 
109  //
111  //
113 
114  //
116  //
118 }
120 
121 //*****************************************************************************
122 //
123 // Close the Doxygen group.
125 //
126 //*****************************************************************************
127 
128 //*****************************************************************************
129 //
130 // Prototypes.
131 //
132 //*****************************************************************************
133 extern tHIDInstance * USBHHIDOpen(tHIDSubClassProtocol iDeviceType,
135  void *pvCBData);
136 extern void USBHHIDClose(tHIDInstance *psHIDInstance);
137 extern uint32_t USBHHIDGetReportDescriptor(tHIDInstance *psHIDInstance,
138  uint8_t *pui8Buffer,
139  uint32_t ui32Size);
140 extern uint32_t USBHHIDSetIdle(tHIDInstance *psHIDInstance, uint8_t ui8Duration,
141  uint8_t ui8ReportID);
142 extern uint32_t USBHHIDSetProtocol(tHIDInstance *psHIDInstance,
143  uint32_t ui32BootProtocol);
144 extern uint32_t USBHHIDSetReport(tHIDInstance *psHIDInstance,
145  uint32_t ui32Interface, uint8_t *pui8Data,
146  uint32_t ui32Size);
147 extern uint32_t USBHHIDGetReport(tHIDInstance *psHIDInstance,
148  uint32_t ui32Interface, uint8_t *pui8Data,
149  uint32_t ui32Size);
150 extern uint32_t USBHHIDLPMSleep(tHIDInstance *psHIDInstance);
151 extern uint32_t USBHHIDLPMStatus(tHIDInstance *psHIDInstance);
152 
154 
155 //*****************************************************************************
156 //
157 // Mark the end of the C bindings section for C++ compilers.
158 //
159 //*****************************************************************************
160 #ifdef __cplusplus
161 }
162 #endif
163 
164 #endif // __USBHHID_H__
uint32_t USBHHIDGetReportDescriptor(tHIDInstance *psHIDInstance, uint8_t *pui8Buffer, uint32_t ui32Size)
Definition: usbhhid.c:479
tUSBCallback pfnCallback
Definition: usbhhid.c:70
tHIDSubClassProtocol iDeviceType
Definition: usbhhid.c:80
tHIDSubClassProtocol
Definition: usbhhid.h:96
Definition: usbdhid.h:705
uint32_t USBHHIDLPMStatus(tHIDInstance *psHIDInstance)
Definition: usbhhid.c:731
Definition: usbhhid.h:102
const tUSBHostClassDriver g_sUSBHIDClassDriver
Definition: usbhhid.c:101
uint32_t USBHHIDSetProtocol(tHIDInstance *psHIDInstance, uint32_t ui32BootProtocol)
Definition: usbhhid.c:537
uint32_t USBHHIDSetIdle(tHIDInstance *psHIDInstance, uint8_t ui8Duration, uint8_t ui8ReportID)
Definition: usbhhid.c:423
This is a keyboard device.
Definition: usbhhid.h:107
Definition: usbhost.h:156
This is a mouse device.
Definition: usbhhid.h:112
uint32_t USBHHIDSetReport(tHIDInstance *psHIDInstance, uint32_t ui32Interface, uint8_t *pui8Data, uint32_t ui32Size)
Definition: usbhhid.c:642
uint32_t(* tUSBCallback)(void *pvCBData, uint32_t ui32Event, uint32_t ui32MsgParam, void *pvMsgData)
Definition: usblib.h:1220
uint32_t USBHHIDLPMSleep(tHIDInstance *psHIDInstance)
Definition: usbhhid.c:703
uint32_t USBHHIDGetReport(tHIDInstance *psHIDInstance, uint32_t ui32Interface, uint8_t *pui8Data, uint32_t ui32Size)
Definition: usbhhid.c:608
void * pvCBData
Definition: usbhhid.c:75
void USBHHIDClose(tHIDInstance *psHIDInstance)
Definition: usbhhid.c:186
This is a vendor specific device.
Definition: usbhhid.h:117
tHIDInstance * USBHHIDOpen(tHIDSubClassProtocol iDeviceType, tUSBCallback pfnCallback, void *pvCBData)
Definition: usbhhid.c:137
Copyright 2018, Texas Instruments Incorporated