libctru v2.5.0
Loading...
Searching...
No Matches
irrst.h
Go to the documentation of this file.
1/**
2 * @file irrst.h
3 * @brief IRRST service.
4 */
5#pragma once
6
7//See also: http://3dbrew.org/wiki/IR_Services http://3dbrew.org/wiki/IRRST_Shared_Memory
8
9#include "3ds/services/hid.h" // for circlePosition definition
10
11/// IRRST's shared memory handle.
13
14/// IRRST's shared memory.
15extern vu32* irrstSharedMem;
16
17/// IRRST's state update event
18extern Handle irrstEvent;
19
20/// Initializes IRRST.
22
23/// Exits IRRST.
24void irrstExit(void);
25
26/// Scans IRRST for input.
27void irrstScanInput(void);
28
29/**
30 * @brief Gets IRRST's held keys.
31 * @return IRRST's held keys.
32 */
34
35/**
36 * @brief Reads the current c-stick position.
37 * @param pos Pointer to output the current c-stick position to.
38 */
40
41/**
42 * @brief Waits for the IRRST input event to trigger.
43 * @param nextEvent Whether to discard the current event and wait until the next event.
44 */
45void irrstWaitForEvent(bool nextEvent);
46
47/// Macro for irrstCstickRead.
48#define hidCstickRead irrstCstickRead
49
50/**
51 * @brief Gets the shared memory and event handles for IRRST.
52 * @param outMemHandle Pointer to write the shared memory handle to.
53 * @param outEventHandle Pointer to write the event handle to.
54 */
55Result IRRST_GetHandles(Handle* outMemHandle, Handle* outEventHandle);
56
57/**
58 * @brief Initializes IRRST.
59 * @param unk1 Unknown.
60 * @param unk2 Unknown.
61 */
63
64/// Shuts down IRRST.
HID service.
void irrstWaitForEvent(bool nextEvent)
Waits for the IRRST input event to trigger.
Handle irrstEvent
IRRST's state update event.
void irrstScanInput(void)
Scans IRRST for input.
void irrstCstickRead(circlePosition *pos)
Reads the current c-stick position.
u32 irrstKeysHeld(void)
Gets IRRST's held keys.
Handle irrstMemHandle
IRRST's shared memory handle.
Result irrstInit(void)
Initializes IRRST.
vu32 * irrstSharedMem
IRRST's shared memory.
Result IRRST_Shutdown(void)
Shuts down IRRST.
Result IRRST_Initialize(u32 unk1, u8 unk2)
Initializes IRRST.
Result IRRST_GetHandles(Handle *outMemHandle, Handle *outEventHandle)
Gets the shared memory and event handles for IRRST.
void irrstExit(void)
Exits IRRST.
Circle Pad position.
Definition hid.h:52
uint8_t u8
would be nice if newlib had this already
Definition types.h:21
u32 Handle
Resource handle.
Definition types.h:41
volatile u32 vu32
32-bit volatile unsigned integer.
Definition types.h:33
s32 Result
Function result.
Definition types.h:42
uint32_t u32
32-bit unsigned integer
Definition types.h:23