libctru  v1.6.0
mcuhwc.h
Go to the documentation of this file.
1 /**
2  * @file mcuhwc.h
3  * @brief mcuHwc service.
4  */
5 #pragma once
6 
7 typedef enum
8 {
9  LED_NORMAL = 1, ///< The normal mode of the led
10  LED_SLEEP_MODE, ///< The led pulses slowly as it does in the sleep mode
11  LED_OFF, ///< Switch off power led
12  LED_RED, ///< Red state of the led
13  LED_BLUE, ///< Blue state of the led
14  LED_BLINK_RED, ///< Blinking red state of power led and notification led
16 
17 /// Initializes mcuHwc.
18 Result mcuHwcInit(void);
19 
20 /// Exits mcuHwc.
21 void mcuHwcExit(void);
22 
23 /**
24  * @brief Reads data from an i2c device3 register
25  * @param reg Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info
26  * @param data Pointer to write the data to.
27  * @param size Size of data to be read
28  */
29 Result MCUHWC_ReadRegister(u8 reg, void *data, u32 size);
30 
31 /**
32  * @brief Writes data to a i2c device3 register
33  * @param reg Register number. See https://www.3dbrew.org/wiki/I2C_Registers#Device_3 for more info
34  * @param data Pointer to write the data to.
35  * @param size Size of data to be written
36  */
37 Result MCUHWC_WriteRegister(u8 reg, const void *data, u32 size);
38 
39 /**
40  * @brief Gets the battery voltage
41  * @param voltage Pointer to write the battery voltage to.
42  */
44 
45 /**
46  * @brief Gets the battery level
47  * @param level Pointer to write the current battery level to.
48  */
50 
51 /**
52  * @brief Gets the sound slider level
53  * @param level Pointer to write the slider level to.
54  */
56 
57 /**
58  * @brief Sets Wifi LED state
59  * @param state State of Wifi LED. (True/False)
60  */
61 Result MCUHWC_SetWifiLedState(bool state);
62 
63 /**
64  * @brief Sets Power LED state
65  * @param state powerLedState State of power LED.
66  */
68 
69 /**
70  * @brief Gets 3d slider level
71  * @param level Pointer to write 3D slider level to.
72  */
74 
75 /**
76  * @brief Gets the major MCU firmware version
77  * @param out Pointer to write the major firmware version to.
78  */
80 
81 /**
82  * @brief Gets the minor MCU firmware version
83  * @param out Pointer to write the minor firmware version to.
84  */
The led pulses slowly as it does in the sleep mode.
Definition: mcuhwc.h:10
s32 Result
Function result.
Definition: types.h:42
void mcuHwcExit(void)
Exits mcuHwc.
The normal mode of the led.
Definition: mcuhwc.h:9
Result MCUHWC_Get3dSliderLevel(u8 *level)
Gets 3d slider level.
powerLedState
Definition: mcuhwc.h:7
Result MCUHWC_GetSoundSliderLevel(u8 *level)
Gets the sound slider level.
Result MCUHWC_GetFwVerHigh(u8 *out)
Gets the major MCU firmware version.
Red state of the led.
Definition: mcuhwc.h:12
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
Result MCUHWC_GetBatteryVoltage(u8 *voltage)
Gets the battery voltage.
uint32_t u32
32-bit unsigned integer
Definition: types.h:23
Result mcuHwcInit(void)
Initializes mcuHwc.
Result MCUHWC_ReadRegister(u8 reg, void *data, u32 size)
Reads data from an i2c device3 register.
Blinking red state of power led and notification led.
Definition: mcuhwc.h:14
Switch off power led.
Definition: mcuhwc.h:11
Result MCUHWC_SetPowerLedState(powerLedState state)
Sets Power LED state.
Result MCUHWC_SetWifiLedState(bool state)
Sets Wifi LED state.
Result MCUHWC_WriteRegister(u8 reg, const void *data, u32 size)
Writes data to a i2c device3 register.
Result MCUHWC_GetFwVerLow(u8 *out)
Gets the minor MCU firmware version.
Result MCUHWC_GetBatteryLevel(u8 *level)
Gets the battery level.
Blue state of the led.
Definition: mcuhwc.h:13