Hi,
I’m an absolute noob on Windows development. I’m mostly a linux guy.
I’m tring to write a driver to add support for a sensor under Windows; the device is a chromebook so linux support is native and its working fine.
The sensor is a simple I2C device, It simply works by reading two registers.
I’ve read some articles on the Microsoft documentation website and I’ve started to write some code.
I’ve started with the sample ADL345acc driver. I’ve cloned the repository. Copied the project files to a new directory and I’ve created a new project based on thoose.
I’ve then started to look into the “sensor combo driver” to see the ALS parameters to send back to the OS.
I “should” have wrote a more or less complete driver. But the device/driver fails after installing the driver. (At least it matches the ACPI _HID and get probably loaded.)
Now, I have no idea on how I can troubleshoot it. As far I know the demo driver have a lot of debug informations on some sort of output.
And I would like to know how can I access that information to see whats going wrong.
The sensor flow:
It is quite simple. Only polling, no HW threshold. (The sensor have an active low IRQ pin but only for threshold Overflow/Undeflow)
- Write 0x00 on register 0x08
- Write 0x01 on register 0x01
- Write (0x05 << 5) on register 0x00 to start the sensor
- Start a timer to poll the sensor
- On timer expire read the sensor data: Read register 0x02 and 0x03, combine them to have the 16bit ADC value and multiply it by scale.)
References:
- My ALS driver: https://github.com/hitech95/ISL29018_Windows_Driver
- Data fields for ALS: https://docs.microsoft.com/en-us/windows-hardware/drivers/sensors/light-sensor-data-fields
- MS Documentation on Universal sensor driver: https://docs.microsoft.com/en-us/windows-hardware/drivers/sensors/write-and-deploy-your-universal-sensor-driver.
- ADXL345Acc Driver: https://github.com/microsoft/Windows-driver-samples/tree/master/sensors/ADXL345Acc
- Sensor Combo Driver: https://github.com/microsoft/Windows-driver-samples/tree/master/sensors/SensorsComboDriver
- The device is an ILS29023 even if the driver is called ISL29018. The ISL29018 also have proximity but works in the same way.
- This is the ACPI node of the sensor: https://github.com/hitech95/ISL29018_Windows_Driver/blob/master/ISL29018.asl
Another question that i’m having is about the GUID, how can I generate one? Rightnow i’m using the one provided by the Sensor combo sample
Any help would be great, for me writing a MS/Windows driver is a lot harder than the one for Linux due to lack of experience.
Regards,
Nicolò