I’m writing a small C driver to use the raspberry pi zero, the explorer phat and the OS developed in my university. The only thing left is the control of the analog inputs. I saw on the python code it communicates using ioctl. My OS does not have file system so i can not use ioctl. How can i read the analog inputs?
You may either want to bitbang i2c, by writing a software-only driver to manipulate the pins, or drive the i2c hardware by directly manipulating the appropriate registers.
I want to use the bcm2835 library functions to communicate, i think, with the registers. I saw the I2C address of the phat is 0x48 but my question is what i need to do to communicate with the phat and read the values of the analog inputs. Thanks.