I am trying to get the actual screen backlight value from the official Raspberry 7" Touch LCD. I know that the "set" command is 0x86 but what is the "get" command? A guess would be 0x85 or 0x87.
Here is a Code example which I am trying to get to work:
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;
}
I expect the "readBuffer" to have the actual brightness value from 0x00 to 0xff.
I have tried to find the command to get the touch screen backlight value,but did not find any helpful info about this. There is a topic on MSDN forum, i think you can get some helpful information from IoTGirl mentioned.
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.