wut  v1.5.0
Wii U Toolchain
mic.h
Go to the documentation of this file.
1 #pragma once
2 #include "wut.h"
3 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef int MICHandle;
15 
16 typedef struct MICWorkMemory MICWorkMemory;
17 typedef struct MICStatus MICStatus;
18 
19 typedef enum MICError
20 {
28 
29 typedef enum MICInstance
30 {
32  MIC_INSTANCE_1 = 1
34 
36 {
39 
41  void *sampleBuffer;
42 };
43 WUT_CHECK_OFFSET(MICWorkMemory, 0x00, sampleMaxCount);
44 WUT_CHECK_OFFSET(MICWorkMemory, 0x04, sampleBuffer);
45 WUT_CHECK_SIZE(MICWorkMemory, 0x08);
46 
47 struct MICStatus
48 {
49  int state; // 1 << 1 = Open
51  int bufferPos;
52 };
53 WUT_CHECK_OFFSET(MICStatus, 0x00, state);
54 WUT_CHECK_OFFSET(MICStatus, 0x04, availableData);
55 WUT_CHECK_OFFSET(MICStatus, 0x08, bufferPos);
56 WUT_CHECK_SIZE(MICStatus, 0x0C);
57 
62 MICInit(MICInstance instance, int unused, MICWorkMemory *workMemory,
63  MICError *outError);
64 
67 
69 MICGetState(MICHandle handle, int state, uint32_t *outStateVal);
70 
72 MICSetState(MICHandle handle, int state, uint32_t stateVal);
73 
75 MICGetStatus(MICHandle handle, MICStatus *outStatus);
76 
78 MICSetDataConsumed(MICHandle handle, int dataAmountConsumed);
79 
82 
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
size_t sampleMaxCount
Maximum amount of samples at a time must be at least 0x2800.
Definition: mic.h:38
int availableData
Definition: mic.h:50
int state
Definition: mic.h:49
void * sampleBuffer
A 0x40 aligned buffer of size sampleMaxCount * 2.
Definition: mic.h:41
int bufferPos
Definition: mic.h:51
MICError MICClose(MICHandle handle)
int MICHandle
Definition: mic.h:14
MICError MICSetState(MICHandle handle, int state, uint32_t stateVal)
MICError
Definition: mic.h:20
MICInstance
Definition: mic.h:30
MICError MICOpen(MICHandle handle)
MICHandle MICInit(MICInstance instance, int unused, MICWorkMemory *workMemory, MICError *outError)
The second parameter to MICInit is unused, any value is valid.
MICError MICSetDataConsumed(MICHandle handle, int dataAmountConsumed)
MICError MICUninit(MICHandle handle)
MICError MICGetState(MICHandle handle, int state, uint32_t *outStateVal)
MICError MICGetStatus(MICHandle handle, MICStatus *outStatus)
@ MIC_ERROR_ALREADY_CLOSED
Definition: mic.h:25
@ MIC_ERROR_NOT_OPENED
Definition: mic.h:22
@ MIC_ERROR_INVALID_INSTANCE
Definition: mic.h:26
@ MIC_ERROR_OK
Definition: mic.h:21
@ MIC_ERROR_INVALID_HANDLE
Definition: mic.h:23
@ MIC_ERROR_INIT
Definition: mic.h:24
@ MIC_INSTANCE_1
Definition: mic.h:32
@ MIC_INSTANCE_0
Definition: mic.h:31
Definition: mic.h:48