libctru  v1.6.0
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  */
13 Result iruInit(u32 *sharedmem_addr, u32 sharedmem_size);
14 
15 /// Shuts down IRU.
16 void 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  */
30 Result 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  */
40 Result iruRecvData(u8 *buf, u32 size, u8 flag, u32 *transfercount, bool wait);
41 
42 /// Initializes the IR session.
44 
45 /// Shuts down the IR session.
46 Result IRU_Shutdown(void);
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  */
69 Result IRU_WaitRecvTransfer(u32 *transfercount);
70 
71 /**
72  * @brief Sets the IR bit rate.
73  * @param value Bit rate to set.
74  */
75 Result IRU_SetBitRate(u8 value);
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  */
Result iruRecvData(u8 *buf, u32 size, u8 flag, u32 *transfercount, bool wait)
Receives IR data.
s32 Result
Function result.
Definition: types.h:42
void iruExit(void)
Shuts down IRU.
u32 Handle
Resource handle.
Definition: types.h:41
Result IRU_Initialize(void)
Initializes the IR session.
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
Result IRU_GetBitRate(u8 *out)
Gets the IR bit rate.
Result IRU_WaitSendTransfer(void)
Waits for a send operation to complete.
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
Result IRU_WaitRecvTransfer(u32 *transfercount)
Waits for a receive operation to complete.
Handle iruGetServHandle(void)
Gets the IRU service handle.
Result IRU_Shutdown(void)
Shuts down the IR session.
Result IRU_SetBitRate(u8 value)
Sets the IR bit rate.
Result iruInit(u32 *sharedmem_addr, u32 sharedmem_size)
Initializes IRU.
Result iruSendData(u8 *buf, u32 size, bool wait)
Sends IR data.
Result IRU_StartRecvTransfer(u32 size, u8 flag)
Begins receiving data.
Result IRU_SetIRLEDState(u32 value)
Sets the IR LED state.
Result IRU_StartSendTransfer(u8 *buf, u32 size)
Begins sending data.
Result IRU_GetIRLEDRecvState(u32 *out)
Gets the IR LED state.