/* Includes ------------------------------------------------------------------*/ /* * libc */ #include /* * LIBOPENCM3 */ #include #include #include #include #include #include #include #include #include "sensors/sensors.h" u8 channelAddr[IQ65033_MAX_CHANNEL] = {0x1e, 0x1f, 0x21, 0x22, 0x23, 0x28}; int iq65033Config(uint32_t i2cChannel, u8 address) { return 0; } int iq65033Read(uint32_t i2cChannel, u8 address, u8 dataChannel) { int iRtn; u8 buff[2]; int val = 0; buff[0] = channelAddr[dataChannel]; // read register iRtn = I2C_Write(i2cChannel, I2C_MASTER, buff, 1, address); if (iRtn == -1) return (-1); iRtn = I2C_Read(i2cChannel, I2C_MASTER, buff, 1, address); if (iRtn == -1) return (-1); iRtn = I2C_Read(i2cChannel, I2C_MASTER, buff, 1, address); if (iRtn == -1) return (-1); val = (int)buff[0]; return (val); }