从官方读取屏幕背光值 Raspberry Pi 7" Display
Read the screen backlight value from officially Raspberry Pi 7" Display
我正在尝试从官方 Raspberry 7" Touch LCD 获取实际屏幕背光值。我知道 "set" 命令是 0x86,但 "get" 命令是什么?猜测会为 0x85 或 0x87。
这是我正在尝试开始工作的代码示例:
public async Task<bool> IsDimmed()
{
string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
I2cConnectionSettings i2CConnectionSettings = new I2cConnectionSettings(0x45);
IReadOnlyList<DeviceInformation> deviceInformationCollection = await DeviceInformation.FindAllAsync(i2cDeviceSelector);
if (deviceInformationCollection.Count > 0)
{
var i2CDevice = await I2cDevice.FromIdAsync(deviceInformationCollection[0].Id, i2CConnectionSettings);
var readBuffer = new byte[1];
var command = new byte[] { 0x85 };
try
{
i2CDevice.WriteRead(command, readBuffer);
i2CDevice.Dispose();
if (readBuffer[0] < 0xff) return true;
}
catch { }
}
return false;
}
我希望 "readBuffer" 具有从 0x00 到 0xff 的实际亮度值。
我试图找到获取触摸屏背光值的命令,但没有找到任何有用的信息。 MSDN 论坛上有一个 topic,我想你可以从提到的 IoTGirl 那里得到一些有用的信息。
There is not a traditional Windows display driver for RPix. All
display rendering is done by VC4 firmware (GPU microcode managed by Pi
Foundation).
Further to Andre's response, the I2c channel between LCD panel and VC4
is not exposed to Windows, because VC4 takes full ownership of that
I2c channel.
Even if it could be accomplished, sharing the same i2c between Windows
and VC4 will be problematic. It for sure will break touch
functionality.
我正在尝试从官方 Raspberry 7" Touch LCD 获取实际屏幕背光值。我知道 "set" 命令是 0x86,但 "get" 命令是什么?猜测会为 0x85 或 0x87。
这是我正在尝试开始工作的代码示例:
public async Task<bool> IsDimmed()
{
string i2cDeviceSelector = I2cDevice.GetDeviceSelector();
I2cConnectionSettings i2CConnectionSettings = new I2cConnectionSettings(0x45);
IReadOnlyList<DeviceInformation> deviceInformationCollection = await DeviceInformation.FindAllAsync(i2cDeviceSelector);
if (deviceInformationCollection.Count > 0)
{
var i2CDevice = await I2cDevice.FromIdAsync(deviceInformationCollection[0].Id, i2CConnectionSettings);
var readBuffer = new byte[1];
var command = new byte[] { 0x85 };
try
{
i2CDevice.WriteRead(command, readBuffer);
i2CDevice.Dispose();
if (readBuffer[0] < 0xff) return true;
}
catch { }
}
return false;
}
我希望 "readBuffer" 具有从 0x00 到 0xff 的实际亮度值。
我试图找到获取触摸屏背光值的命令,但没有找到任何有用的信息。 MSDN 论坛上有一个 topic,我想你可以从提到的 IoTGirl 那里得到一些有用的信息。
There is not a traditional Windows display driver for RPix. All display rendering is done by VC4 firmware (GPU microcode managed by Pi Foundation).
Further to Andre's response, the I2c channel between LCD panel and VC4 is not exposed to Windows, because VC4 takes full ownership of that I2c channel.
Even if it could be accomplished, sharing the same i2c between Windows and VC4 will be problematic. It for sure will break touch functionality.