wut v1.8.0
Wii U Toolchain
Loading...
Searching...
No Matches
hid.h
Go to the documentation of this file.
1#pragma once
2#include <wut.h>
3
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13typedef struct HIDClient HIDClient;
14typedef struct HIDDevice HIDDevice;
15
21
22typedef int32_t
24 HIDDevice *device,
25 HIDAttachEvent attach);
26
27typedef void
28(*HIDCallback)(uint32_t handle,
29 int32_t error,
30 uint8_t *buffer,
31 uint32_t bytesTransferred,
32 void *userContext);
33
35{
36 uint32_t handle;
38 uint16_t vid;
39 uint16_t pid;
41 uint8_t subClass;
42 uint8_t protocol;
43 WUT_PADDING_BYTES(1);
46};
47WUT_CHECK_OFFSET(HIDDevice, 0x00, handle);
48WUT_CHECK_OFFSET(HIDDevice, 0x04, physicalDeviceInst);
49WUT_CHECK_OFFSET(HIDDevice, 0x08, vid);
50WUT_CHECK_OFFSET(HIDDevice, 0x0A, pid);
51WUT_CHECK_OFFSET(HIDDevice, 0x0C, interfaceIndex);
52WUT_CHECK_OFFSET(HIDDevice, 0x0D, subClass);
53WUT_CHECK_OFFSET(HIDDevice, 0x0E, protocol);
54WUT_CHECK_OFFSET(HIDDevice, 0x10, maxPacketSizeRx);
55WUT_CHECK_OFFSET(HIDDevice, 0x12, maxPacketSizeTx);
56WUT_CHECK_SIZE(HIDDevice, 0x14);
57
63WUT_CHECK_OFFSET(HIDClient, 0x00, next);
64WUT_CHECK_OFFSET(HIDClient, 0x04, attachCallback);
65WUT_CHECK_SIZE(HIDClient, 0x08);
66
67
68int32_t
70
71int32_t
73
74int32_t
76 HIDAttachCallback attachCallback);
77
78int32_t
80
81int32_t
82HIDGetDescriptor(uint32_t handle,
83 uint8_t descriptorType,
84 uint8_t descriptorIndex,
85 uint16_t languageId,
86 uint8_t *buffer,
87 uint32_t bufferLength,
88 HIDCallback callback,
89 void *userContext);
90
91int32_t
92HIDSetDescriptor(uint32_t handle,
93 uint8_t descriptorType,
94 uint8_t descriptorIndex,
95 uint16_t languageId,
96 uint8_t *buffer,
97 uint32_t bufferLength,
98 HIDCallback callback,
99 void *userContext);
100
101int32_t
102HIDGetReport(uint32_t handle,
103 uint8_t reportType,
104 uint8_t reportId,
105 uint8_t *buffer,
106 uint32_t bufferLength,
107 HIDCallback callback,
108 void *userContext);
109
110int32_t
111HIDSetReport(uint32_t handle,
112 uint8_t reportType,
113 uint8_t reportId,
114 uint8_t *buffer,
115 uint32_t bufferLength,
116 HIDCallback callback,
117 void *userContext);
118
119int32_t
120HIDGetIdle(uint32_t handle,
121 uint8_t interfaceIndex,
122 uint8_t reportId,
123 uint8_t* duration,
124 HIDCallback callback,
125 void *userContext);
126
127int32_t
128HIDSetIdle(uint32_t handle,
129 uint8_t interfaceIndex,
130 uint8_t reportId,
131 uint8_t duration,
132 HIDCallback callback,
133 void *userContext);
134
135int32_t
136HIDSetProtocol(uint32_t handle,
137 uint8_t interfaceIndex,
138 uint8_t protocol,
139 HIDCallback callback,
140 void *userContext);
141
142int32_t
143HIDGetProtocol(uint32_t handle,
144 uint8_t interfaceIndex,
145 uint8_t *protocol,
146 HIDCallback callback,
147 void *userContext);
148
149int32_t
150HIDRead(uint32_t handle,
151 uint8_t *buffer,
152 uint32_t bufferLength,
153 HIDCallback callback,
154 void *userContext);
155
156int32_t
157HIDWrite(uint32_t handle,
158 uint8_t *buffer,
159 uint32_t bufferLength,
160 HIDCallback hc,
161 void *userContext);
162
163#ifdef __cplusplus
164}
165#endif
166
uint8_t subClass
Definition hid.h:41
HIDAttachCallback attachCallback
Definition hid.h:61
uint16_t maxPacketSizeRx
Definition hid.h:44
HIDClient * next
Definition hid.h:60
uint8_t interfaceIndex
Definition hid.h:40
uint16_t maxPacketSizeTx
Definition hid.h:45
uint16_t pid
Definition hid.h:39
uint32_t handle
Definition hid.h:36
uint16_t vid
Definition hid.h:38
uint8_t protocol
Definition hid.h:42
uint32_t physicalDeviceInst
Definition hid.h:37
HIDAttachEvent
Definition hid.h:17
int32_t HIDGetDescriptor(uint32_t handle, uint8_t descriptorType, uint8_t descriptorIndex, uint16_t languageId, uint8_t *buffer, uint32_t bufferLength, HIDCallback callback, void *userContext)
int32_t(* HIDAttachCallback)(HIDClient *client, HIDDevice *device, HIDAttachEvent attach)
Definition hid.h:23
int32_t HIDSetReport(uint32_t handle, uint8_t reportType, uint8_t reportId, uint8_t *buffer, uint32_t bufferLength, HIDCallback callback, void *userContext)
int32_t HIDAddClient(HIDClient *client, HIDAttachCallback attachCallback)
void(* HIDCallback)(uint32_t handle, int32_t error, uint8_t *buffer, uint32_t bytesTransferred, void *userContext)
Definition hid.h:28
int32_t HIDTeardown()
int32_t HIDGetIdle(uint32_t handle, uint8_t interfaceIndex, uint8_t reportId, uint8_t *duration, HIDCallback callback, void *userContext)
int32_t HIDGetReport(uint32_t handle, uint8_t reportType, uint8_t reportId, uint8_t *buffer, uint32_t bufferLength, HIDCallback callback, void *userContext)
int32_t HIDWrite(uint32_t handle, uint8_t *buffer, uint32_t bufferLength, HIDCallback hc, void *userContext)
int32_t HIDDelClient(HIDClient *client)
int32_t HIDRead(uint32_t handle, uint8_t *buffer, uint32_t bufferLength, HIDCallback callback, void *userContext)
int32_t HIDSetup()
int32_t HIDSetIdle(uint32_t handle, uint8_t interfaceIndex, uint8_t reportId, uint8_t duration, HIDCallback callback, void *userContext)
int32_t HIDGetProtocol(uint32_t handle, uint8_t interfaceIndex, uint8_t *protocol, HIDCallback callback, void *userContext)
int32_t HIDSetDescriptor(uint32_t handle, uint8_t descriptorType, uint8_t descriptorIndex, uint16_t languageId, uint8_t *buffer, uint32_t bufferLength, HIDCallback callback, void *userContext)
int32_t HIDSetProtocol(uint32_t handle, uint8_t interfaceIndex, uint8_t protocol, HIDCallback callback, void *userContext)
@ HID_DEVICE_DETACH
Definition hid.h:18
@ HID_DEVICE_ATTACH
Definition hid.h:19