irrst.h
Go to the documentation of this file.
/**
* @file irrst.h
* @brief IRRST service.
*/
#pragma once
//See also: http://3dbrew.org/wiki/IR_Services http://3dbrew.org/wiki/IRRST_Shared_Memory
#include "3ds/services/hid.h" // for circlePosition definition
/// IRRST's shared memory handle.
extern Handle irrstMemHandle;
/// IRRST's shared memory.
extern vu32* irrstSharedMem;
/// IRRST's state update event
extern Handle irrstEvent;
/// Initializes IRRST.
Result irrstInit(void);
/// Exits IRRST.
void irrstExit(void);
/// Scans IRRST for input.
void irrstScanInput(void);
/**
* @brief Gets IRRST's held keys.
* @return IRRST's held keys.
*/
u32 irrstKeysHeld(void);
/**
* @brief Reads the current c-stick position.
* @param pos Pointer to output the current c-stick position to.
*/
void irrstCstickRead(circlePosition* pos);
/**
* @brief Waits for the IRRST input event to trigger.
* @param nextEvent Whether to discard the current event and wait until the next event.
*/
void irrstWaitForEvent(bool nextEvent);
/// Macro for irrstCstickRead.
#define hidCstickRead irrstCstickRead
/**
* @brief Gets the shared memory and event handles for IRRST.
* @param outMemHandle Pointer to write the shared memory handle to.
* @param outEventHandle Pointer to write the event handle to.
*/
Result IRRST_GetHandles(Handle* outMemHandle, Handle* outEventHandle);
/**
* @brief Initializes IRRST.
* @param unk1 Unknown.
* @param unk2 Unknown.
*/
Result IRRST_Initialize(u32 unk1, u8 unk2);
/// Shuts down IRRST.
Result IRRST_Shutdown(void);
hid.h
HID service.
irrstWaitForEvent
void irrstWaitForEvent(bool nextEvent)
Waits for the IRRST input event to trigger.
irrstEvent
Handle irrstEvent
IRRST's state update event.
irrstScanInput
void irrstScanInput(void)
Scans IRRST for input.
irrstCstickRead
void irrstCstickRead(circlePosition *pos)
Reads the current c-stick position.
irrstKeysHeld
u32 irrstKeysHeld(void)
Gets IRRST's held keys.
irrstMemHandle
Handle irrstMemHandle
IRRST's shared memory handle.
irrstInit
Result irrstInit(void)
Initializes IRRST.
irrstSharedMem
vu32 * irrstSharedMem
IRRST's shared memory.
IRRST_Shutdown
Result IRRST_Shutdown(void)
Shuts down IRRST.
IRRST_Initialize
Result IRRST_Initialize(u32 unk1, u8 unk2)
Initializes IRRST.
IRRST_GetHandles
Result IRRST_GetHandles(Handle *outMemHandle, Handle *outEventHandle)
Gets the shared memory and event handles for IRRST.
irrstExit
void irrstExit(void)
Exits IRRST.
circlePosition
Circle Pad position.
Definition: hid.h:52
u8
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
Handle
u32 Handle
Resource handle.
Definition: types.h:41
vu32
volatile u32 vu32
32-bit volatile unsigned integer.
Definition: types.h:33
Result
s32 Result
Function result.
Definition: types.h:42
u32
uint32_t u32
32-bit unsigned integer
Definition: types.h:23