libctru v2.5.0
Loading...
Searching...
No Matches
ir.h
Go to the documentation of this file.
1/**
2 * @file ir.h
3 * @brief IR service.
4 */
5#pragma once
6
7/**
8 * @brief Initializes IRU.
9 * The permissions for the specified memory is set to RO. This memory must be already mapped.
10 * @param sharedmem_addr Address of the shared memory block to use.
11 * @param sharedmem_size Size of the shared memory block.
12 */
13Result iruInit(u32 *sharedmem_addr, u32 sharedmem_size);
14
15/// Shuts down IRU.
16void iruExit(void);
17
18/**
19 * @brief Gets the IRU service handle.
20 * @return The IRU service handle.
21 */
23
24/**
25 * @brief Sends IR data.
26 * @param buf Buffer to send data from.
27 * @param size Size of the buffer.
28 * @param wait Whether to wait for the data to be sent.
29 */
30Result iruSendData(u8 *buf, u32 size, bool wait);
31
32/**
33 * @brief Receives IR data.
34 * @param buf Buffer to receive data to.
35 * @param size Size of the buffer.
36 * @param flag Flags to receive data with.
37 * @param transfercount Pointer to output the number of bytes read to.
38 * @param wait Whether to wait for the data to be received.
39 */
40Result iruRecvData(u8 *buf, u32 size, u8 flag, u32 *transfercount, bool wait);
41
42/// Initializes the IR session.
44
45/// Shuts down the IR session.
47
48/**
49 * @brief Begins sending data.
50 * @param buf Buffer to send.
51 * @param size Size of the buffer.
52 */
54
55/// Waits for a send operation to complete.
57
58/**
59 * @brief Begins receiving data.
60 * @param size Size of the data to receive.
61 * @param flag Flags to use when receiving.
62 */
64
65/**
66 * @brief Waits for a receive operation to complete.
67 * @param transfercount Pointer to output the number of bytes read to.
68 */
70
71/**
72 * @brief Sets the IR bit rate.
73 * @param value Bit rate to set.
74 */
76
77/**
78 * @brief Gets the IR bit rate.
79 * @param out Pointer to write the bit rate to.
80 */
82
83/**
84 * @brief Sets the IR LED state.
85 * @param value IR LED state to set.
86 */
88
89/**
90 * @brief Gets the IR LED state.
91 * @param out Pointer to write the IR LED state to.
92 */
94
95/**
96 * @brief Gets an event which is signaled once a send finishes.
97 * @param out Pointer to write the event handle to.
98 */
100
101/**
102 * @brief Gets an event which is signaled once a receive finishes.
103 * @param out Pointer to write the event handle to.
104 */
Result iruInit(u32 *sharedmem_addr, u32 sharedmem_size)
Initializes IRU.
Result IRU_WaitSendTransfer(void)
Waits for a send operation to complete.
Result IRU_GetIRLEDRecvState(u32 *out)
Gets the IR LED state.
void iruExit(void)
Shuts down IRU.
Result IRU_SetIRLEDState(u32 value)
Sets the IR LED state.
Result IRU_GetSendFinishedEvent(Handle *out)
Gets an event which is signaled once a send finishes.
Result IRU_Shutdown(void)
Shuts down the IR session.
Result iruRecvData(u8 *buf, u32 size, u8 flag, u32 *transfercount, bool wait)
Receives IR data.
Handle iruGetServHandle(void)
Gets the IRU service handle.
Result IRU_Initialize(void)
Initializes the IR session.
Result IRU_WaitRecvTransfer(u32 *transfercount)
Waits for a receive operation to complete.
Result IRU_SetBitRate(u8 value)
Sets the IR bit rate.
Result iruSendData(u8 *buf, u32 size, bool wait)
Sends IR data.
Result IRU_GetRecvFinishedEvent(Handle *out)
Gets an event which is signaled once a receive finishes.
Result IRU_StartSendTransfer(u8 *buf, u32 size)
Begins sending data.
Result IRU_StartRecvTransfer(u32 size, u8 flag)
Begins receiving data.
Result IRU_GetBitRate(u8 *out)
Gets the IR bit rate.
uint8_t u8
would be nice if newlib had this already
Definition types.h:21
u32 Handle
Resource handle.
Definition types.h:41
s32 Result
Function result.
Definition types.h:42
uint32_t u32
32-bit unsigned integer
Definition types.h:23