fxos8700cq_linaro.c
//sends an I2C command to the specified slave
sends an I2C command to the specified slave
sends an I2C command to the specified slave
void I2CAGSend(uint32_t ui32SlaveAddress, uint8_t ui32SlaveRegister,
                    uint8_t *pTransmitData, uint8_t ui8NumBytes)
{
    int file;
    file = open("/dev/i2c-1", O_RDWR);
    ioctl(file, I2C_SLAVE, ui32SlaveAddress);
    i2c_smbus_write_i2c_block_data(file, ui32SlaveRegister,ui8NumBytes,pTransmitData);
    close(file);
}
void I2CAGSend ( uint32_t ui32SlaveAddress , uint8_t ui32SlaveRegister , uint8_t * pTransmitData , uint8_t ui8NumBytes ) { int file ; file = open ( " " , O_RDWR ) ; ioctl ( file , I2C_SLAVE , ui32SlaveAddress ) ; i2c_smbus_write_i2c_block_data ( file , ui32SlaveRegister , ui8NumBytes , pTransmitData ) ; close ( file ) ; }
sends an I2C command to the specified slave
sends an I2C command to the specified slave
//specify that we are reading from an I2C device //specify that we are writing (a register address) to the //slave device //return block data pulled from the specified register //close the handler used to read from device