While examining various system calls that nickel makes I noticed that /dev/ntx_io is accessed a lot. So by looking at the source code for the Linux kernel I worked out what a lot of the ioctl() calls do.
I now have a program that can:
The attached is tested on a Wifi ereader with 4-bit display (m166e hardware version), but the source code of the imx357 hardware version (which I think is the 8-bit version) appears very similar.
I now have a program that can:
- Detect if the SD card is inserted.
- Detect if the SD card is read-only or read-write.
- Detect if USB is connected.
- Detect if the power button has just been pressed.
- Get the battery charge status.
- Switch on the blue LED.
- Flash the blue LED once.
The attached is tested on a Wifi ereader with 4-bit display (m166e hardware version), but the source code of the imx357 hardware version (which I think is the 8-bit version) appears very similar.