|
DeviceIOControl来改变LCD背光电源的状态以实现背光灯的亮灭控制。 需要一下几方面支持
1、驱动实现 DeviceIoControl
BOOL BspBacklightIoctrl( DWORD hOpenContext,
DWORD dwCode,
PBYTE pBufIn,
DWORD dwLenIn,
PBYTE pBufOut,
DWORD dwLenOut,
PDWORD pdwActualOut)
。。。
uLevel = *(ULONG *)pBufIn;
RETAILMSG(goodmsg,(TEXT("BspBacklightIoctrl----uLevel=%d g_dwCurrLevel =%d \r\n"),uLevel,g_dwCurrLevel));
if (uLevel == BKL_ON)
{
BspBacklightSetLevel(g_dwCurrLevel);
}
else if (uLevel == BKL_OFF)
{
BspBacklightSetLevel(BKL_OFF);
}
---------------------------
2、调用
bResult = DeviceIoControl(hDevice, // device to be queried
IOCTL_POWER_SET, // operation to perform
???, ?, // no input buffer
NULL, 0, // output buffer
&junk, // # bytes returned
(LPOVERLAPPED) NULL); // synchronous I/O
控制背光。
仔细看这个例子 如何实现 D0 D1 D2 D3 D4的 功能, |
|