Implement GSPLCD_SetBrightness and GSPLCD_SetBrightnessRaw (#363)
This commit is contained in:
parent
57152061b0
commit
f05c56435d
@ -42,4 +42,18 @@ Result GSPLCD_GetVendors(u8 *vendors);
|
||||
* @param screen Screen to get the brightness value of.
|
||||
* @param brightness Brightness value returned.
|
||||
*/
|
||||
Result GSPLCD_GetBrightness(u32 screen, u32 *brightness);
|
||||
Result GSPLCD_GetBrightness(u32 screen, u32 *brightness);
|
||||
|
||||
/**
|
||||
* @brief Sets the LCD screens' brightness.
|
||||
* @param screen Screen to set the brightness value of.
|
||||
* @param brightness Brightness value set.
|
||||
*/
|
||||
Result GSPLCD_SetBrightness(u32 screen, u32 brightness);
|
||||
|
||||
/**
|
||||
* @brief Sets the LCD screens' raw brightness.
|
||||
* @param screen Screen to set the brightness value of.
|
||||
* @param brightness Brightness value set.
|
||||
*/
|
||||
Result GSPLCD_SetBrightnessRaw(u32 screen, u32 brightness);
|
@ -81,3 +81,30 @@ Result GSPLCD_GetBrightness(u32 screen, u32 *brightness)
|
||||
return cmdbuf[2];
|
||||
}
|
||||
|
||||
Result GSPLCD_SetBrightness(u32 screen, u32 brightness)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x0B,2,0); // 0xB0080
|
||||
cmdbuf[1] = screen;
|
||||
cmdbuf[2] = brightness;
|
||||
|
||||
Result ret = 0;
|
||||
if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) return ret;
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
Result GSPLCD_SetBrightnessRaw(u32 screen, u32 brightness)
|
||||
{
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x0A,2,0); // 0xA0080
|
||||
cmdbuf[1] = screen;
|
||||
cmdbuf[2] = brightness;
|
||||
|
||||
Result ret = 0;
|
||||
if (R_FAILED(ret = svcSendSyncRequest(gspLcdHandle))) return ret;
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
Loading…
Reference in New Issue
Block a user