wut  v1.5.0
Wii U Toolchain
im.h
Go to the documentation of this file.
1 #pragma once
2 #include <wut.h>
3 #include <coreinit/ios.h>
4 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 typedef struct IMRequest IMRequest;
18 typedef struct IMParameters IMParameters;
19 typedef struct IMDeviceStateEx IMDeviceStateEx;
20 typedef uint32_t IMEventMask;
21 
22 typedef enum IMPadType
23 {
30 
31 typedef enum IMDeviceState
32 {
40 
41 struct WUT_PACKED IMRequest
42 {
43  uint8_t args[0x80];
44  IOSVec ioctlVecs[2];
46  int32_t request;
49  void *copySrc;
50  void *copyDst;
51  uint32_t copySize;
52 };
53 WUT_CHECK_OFFSET(IMRequest, 0x80, ioctlVecs);
54 WUT_CHECK_OFFSET(IMRequest, 0x98, handle);
55 WUT_CHECK_OFFSET(IMRequest, 0x9C, request);
56 WUT_CHECK_OFFSET(IMRequest, 0xA0, asyncCallback);
57 WUT_CHECK_OFFSET(IMRequest, 0xA4, asyncCallbackContext);
58 WUT_CHECK_OFFSET(IMRequest, 0xA8, copySrc);
59 WUT_CHECK_OFFSET(IMRequest, 0xAC, copyDst);
60 WUT_CHECK_OFFSET(IMRequest, 0xB0, copySize);
61 WUT_CHECK_SIZE(IMRequest, 0xB4);
62 
64 {
68  int32_t index;
69 };
70 WUT_CHECK_OFFSET(IMHomeButtonParams, 0x0, type);
71 WUT_CHECK_OFFSET(IMHomeButtonParams, 0x4, index);
72 WUT_CHECK_SIZE(IMHomeButtonParams, 0x8);
73 
75 {
76  uint32_t resetEnabled;
77  uint32_t dimEnabled;
78  uint32_t dimPeriod;
79  uint32_t apdEnabled;
80  uint32_t apdPeriod;
81 };
82 WUT_CHECK_OFFSET(IMParameters, 0x00, resetEnabled);
83 WUT_CHECK_OFFSET(IMParameters, 0x04, dimEnabled);
84 WUT_CHECK_OFFSET(IMParameters, 0x08, dimPeriod);
85 WUT_CHECK_OFFSET(IMParameters, 0x0C, apdEnabled);
86 WUT_CHECK_OFFSET(IMParameters, 0x10, apdPeriod);
87 WUT_CHECK_SIZE(IMParameters, 0x14);
88 
90 {
93 };
94 WUT_CHECK_OFFSET(IMDeviceStateEx, 0x0, state);
95 WUT_CHECK_OFFSET(IMDeviceStateEx, 0x4, params);
96 WUT_CHECK_SIZE(IMDeviceStateEx, 0xC);
97 
98 typedef enum IMParameter
99 {
113 
114 typedef enum IMTimer
115 {
119 
120 typedef enum IMEvent
121 {
122  IM_EVENT_ACTIVE = 1 << 0,
124  IM_EVENT_DIM = 1 << 2,
125  IM_EVENT_UNDIM = 1 << 3,
127  IM_EVENT_APD = 1 << 4,
129  IM_EVENT_POWER = 1 << 5,
131  IM_EVENT_HOME = 1 << 6,
133  IM_EVENT_SYNC = 1 << 7,
134  IM_EVENT_RESET = 1 << 8,
138 
139 IOSHandle
140 IM_Open(void);
141 
142 IOSError
144 
145 IOSError
147  IMRequest *request,
148  IMHomeButtonParams *output,
149  IOSAsyncCallbackFn asyncCallback,
150  void *asyncCallbackContext);
151 
152 IOSError
154  IMRequest *request,
155  IMParameter parameter,
156  uint32_t *output,
157  IOSAsyncCallbackFn asyncCallback,
158  void *asyncCallbackContext);
159 
160 IOSError
162 
163 IOSError
165  IMRequest *request,
166  IMParameter parameter,
167  uint32_t *output,
168  IOSAsyncCallbackFn asyncCallback,
169  void *asyncCallbackContext);
170 
171 IOSError
173  uint32_t *outValue);
174 
175 IOSError
177  uint32_t *outValue);
178 
179 IOSError
181  IMRequest *request,
182  IMTimer timer,
183  uint32_t *output,
184  IOSAsyncCallbackFn asyncCallback,
185  void *asyncCallbackContext);
186 
187 IOSError
189  uint32_t *outSeconds);
190 
191 IOSError
193  IMRequest *request,
194  IMParameter parameter,
195  uint32_t value,
196  IOSAsyncCallbackFn asyncCallback,
197  void *asyncCallbackContext);
198 
199 IOSError
201  uint32_t value);
202 
203 IOSError
205  IMRequest *request,
206  IMEventMask *event,
207  IOSAsyncCallbackFn asyncCallback,
208  void *asyncCallbackContext);
209 
210 IOSError
212  IMRequest *request,
213  IOSAsyncCallbackFn asyncCallback,
214  void *asyncCallbackContext);
215 
216 IOSError
218  IMRequest *request,
219  IMDeviceState state,
220  IOSAsyncCallbackFn asyncCallback,
221  void *asyncCallbackContext);
222 
223 IOSError
225  IMRequest *request,
226  IMDeviceStateEx *state,
227  IOSAsyncCallbackFn asyncCallback,
228  void *asyncCallbackContext);
229 
230 #ifdef __cplusplus
231 }
232 #endif
233 
uint32_t apdPeriod
Definition: im.h:80
void * copySrc
Definition: im.h:49
uint32_t dimEnabled
Definition: im.h:77
IOSAsyncCallbackFn asyncCallback
Definition: im.h:47
void * asyncCallbackContext
Definition: im.h:48
void * copyDst
Definition: im.h:50
uint32_t dimPeriod
Definition: im.h:78
IMHomeButtonParams params
Definition: im.h:92
uint32_t copySize
Definition: im.h:51
IMDeviceState state
Definition: im.h:91
IOSHandle handle
Definition: im.h:45
uint32_t apdEnabled
Definition: im.h:79
IMPadType type
The controller type which pressed the home button.
Definition: im.h:66
int32_t index
The controller index which pressed the home button.
Definition: im.h:68
int32_t request
Definition: im.h:46
uint32_t resetEnabled
Definition: im.h:76
IOSError IM_SetRuntimeParameter(IMParameter parameter, uint32_t value)
IOSError IM_GetNvParameter(IOSHandle handle, IMRequest *request, IMParameter parameter, uint32_t *output, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IOSError IM_GetHomeButtonParams(IOSHandle handle, IMRequest *request, IMHomeButtonParams *output, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IOSError IM_SetDeviceStateEx(IOSHandle handle, IMRequest *request, IMDeviceStateEx *state, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IMTimer
Definition: im.h:115
IOSError IM_GetNvParameterWithoutHandleAndItb(IMParameter parameter, uint32_t *outValue)
IOSHandle IM_Open(void)
IOSError IM_GetParameters(IMParameters *parameters)
IOSError IM_GetRuntimeParameter(IMParameter parameter, uint32_t *outValue)
IOSError IM_SetParameter(IOSHandle handle, IMRequest *request, IMParameter parameter, uint32_t value, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IOSError IM_CancelGetEventNotify(IOSHandle handle, IMRequest *request, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
uint32_t IMEventMask
Definition: im.h:20
IOSError IM_GetTimerRemainingSeconds(IMTimer timer, uint32_t *outSeconds)
IOSError IM_GetParameter(IOSHandle handle, IMRequest *request, IMParameter parameter, uint32_t *output, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IOSError IM_SetDeviceState(IOSHandle handle, IMRequest *request, IMDeviceState state, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IMPadType
Definition: im.h:23
IMParameter
Definition: im.h:99
IOSError IM_GetTimerRemaining(IOSHandle handle, IMRequest *request, IMTimer timer, uint32_t *output, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IMEvent
Definition: im.h:121
IMDeviceState
Definition: im.h:32
IOSError IM_GetEventNotify(IOSHandle handle, IMRequest *request, IMEventMask *event, IOSAsyncCallbackFn asyncCallback, void *asyncCallbackContext)
IOSError IM_Close(IOSHandle handle)
@ IM_TIMER_APD
Definition: im.h:117
@ IM_TIMER_DIM
Definition: im.h:116
@ IM_PAD_TYPE_WII_REMOTE
Definition: im.h:25
@ IM_PAD_TYPE_WIIU_PRO_CONTROLLER
Definition: im.h:26
@ IM_PAD_TYPE_NONE
Definition: im.h:24
@ IM_PAD_TYPE_WII_REMOTE_EXTENSION
Definition: im.h:27
@ IM_PAD_TYPE_WIIU_GAMEPAD
Definition: im.h:28
@ IM_PARAMETER_APD_OCCURED
Definition: im.h:108
@ IM_PARAMETER_APD_PERIOD
Definition: im.h:104
@ IM_PARAMETER_DIM_ENABLE_TV
Definition: im.h:109
@ IM_PARAMETER_INACTIVE_SECONDS
Definition: im.h:100
@ IM_PARAMETER_DIM_PERIOD
Definition: im.h:102
@ IM_PARAMETER_DIM_ENABLE_DRC
Definition: im.h:110
@ IM_PARAMETER_APD_ENABLED
Definition: im.h:103
@ IM_PARAMETER_POWER_OFF_ENABLE
Definition: im.h:107
@ IM_PARAMETER_MAX
Definition: im.h:111
@ IM_PARAMETER_RESET_SECONDS
Definition: im.h:106
@ IM_PARAMETER_DIM_ENABLED
Definition: im.h:101
@ IM_PARAMETER_RESET_ENABLE
Definition: im.h:105
@ IM_EVENT_CANCELLED
Event notify was cancelled.
Definition: im.h:136
@ IM_EVENT_POWER
Controller power button was pressed.
Definition: im.h:129
@ IM_EVENT_DIM
Definition: im.h:124
@ IM_EVENT_SYNC
Console sync button was pressed.
Definition: im.h:133
@ IM_EVENT_APD
Automatic power down.
Definition: im.h:127
@ IM_EVENT_UNDIM
Definition: im.h:125
@ IM_EVENT_HOME
Home button was pressed.
Definition: im.h:131
@ IM_EVENT_RESET
Definition: im.h:134
@ IM_EVENT_INACTIVE
Definition: im.h:123
@ IM_EVENT_ACTIVE
Definition: im.h:122
@ IM_DEVICE_STATE_POWER
Definition: im.h:37
@ IM_DEVICE_STATE_SYNC
Definition: im.h:38
@ IM_DEVICE_STATE_HOME
Definition: im.h:36
@ IM_DEVICE_STATE_CLEAR
Definition: im.h:33
@ IM_DEVICE_STATE_INACTIVE
Definition: im.h:34
@ IM_DEVICE_STATE_ACTIVE
Definition: im.h:35
Definition: im.h:42
IOSError
Definition: ios.h:25
void(* IOSAsyncCallbackFn)(IOSError, void *)
Definition: ios.h:87
int32_t IOSHandle
Definition: ios.h:15
Definition: ios.h:72