Add MCUHWC_SetInfoLedPattern (#549)
This commit is contained in:
parent
cc5b884d7d
commit
5f06a037d7
@ -4,8 +4,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
LED_NORMAL = 1, ///< The normal mode of the led
|
||||
LED_SLEEP_MODE, ///< The led pulses slowly as it does in the sleep mode
|
||||
LED_OFF, ///< Switch off power led
|
||||
@ -14,6 +13,17 @@ typedef enum
|
||||
LED_BLINK_RED, ///< Blinking red state of power led and notification led
|
||||
} powerLedState;
|
||||
|
||||
typedef struct InfoLedPattern
|
||||
{
|
||||
u8 delay; ///< Delay between pattern values, 1/16th of a second (1 second = 0x10)
|
||||
u8 smoothing; ///< Smoothing between pattern values (higher = smoother)
|
||||
u8 loopDelay; ///< Delay between pattern loops, 1/16th of a second (1 second = 0x10, 0xFF = pattern is played only once)
|
||||
u8 blinkSpeed; ///< Blink speed, when smoothing == 0x00
|
||||
u8 redPattern[32]; ///< Pattern for red component
|
||||
u8 greenPattern[32]; ///< Pattern for green component
|
||||
u8 bluePattern[32]; ///< Pattern for blue component
|
||||
} InfoLedPattern;
|
||||
|
||||
/// Initializes mcuHwc.
|
||||
Result mcuHwcInit(void);
|
||||
|
||||
@ -66,6 +76,12 @@ Result MCUHWC_GetSoundSliderLevel(u8 *level);
|
||||
*/
|
||||
Result MCUHWC_SetWifiLedState(bool state);
|
||||
|
||||
/**
|
||||
* @brief Sets the notification LED pattern
|
||||
* @param pattern Pattern for the notification LED.
|
||||
*/
|
||||
Result MCUHWC_SetInfoLedPattern(const InfoLedPattern* pattern);
|
||||
|
||||
/**
|
||||
* @brief Sets Power LED state
|
||||
* @param state powerLedState State of power LED.
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <string.h>
|
||||
#include <3ds/types.h>
|
||||
#include <3ds/svc.h>
|
||||
#include <3ds/synchronization.h>
|
||||
@ -114,6 +115,22 @@ Result MCUHWC_SetWifiLedState(bool state)
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
||||
Result MCUHWC_SetInfoLedPattern(const InfoLedPattern* pattern)
|
||||
{
|
||||
Result ret = 0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x0A,25,0); // 0xA0640
|
||||
cmdbuf[1] = ((u32)pattern->blinkSpeed << 24) | ((u32)pattern->loopDelay << 16) | ((u32)pattern->smoothing << 8) | pattern->delay;
|
||||
memcpy(&cmdbuf[2], pattern->redPattern, sizeof(pattern->redPattern));
|
||||
memcpy(&cmdbuf[10], pattern->greenPattern, sizeof(pattern->greenPattern));
|
||||
memcpy(&cmdbuf[18], pattern->bluePattern, sizeof(pattern->bluePattern));
|
||||
|
||||
if(R_FAILED(ret = svcSendSyncRequest(mcuHwcHandle))) return ret;
|
||||
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
||||
Result MCUHWC_GetSoundSliderLevel(u8 *level)
|
||||
{
|
||||
Result ret = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user