fxos8700cq_tiva.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 *pReceiveData, uint8_t ui8NumBytes)
{
    I2CMasterSlaveAddrSet(I2C0_BASE, ui32SlaveAddress, false);
    I2CMasterDataPut(I2C0_BASE, ui32SlaveRegister);
    I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_START);
    while(I2CMasterBusy(I2C0_BASE));
    uint8_t ui8Counter;
    for (ui8Counter = 0; ui8Counter <= (ui8NumBytes - 2); ui8Counter++ )
    {
        I2CMasterDataPut(I2C0_BASE, pReceiveData[ui8Counter]);
        I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);
        while(I2CMasterBusy(I2C0_BASE));
    }
    I2CMasterDataPut(I2C0_BASE, pReceiveData[ui8NumBytes - 1]);
    I2CMasterControl(I2C0_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);
    while(I2CMasterBusy(I2C0_BASE));
}
void I2CAGSend ( uint32_t ui32SlaveAddress , uint8_t ui32SlaveRegister , uint8_t * pReceiveData , uint8_t ui8NumBytes ) { I2CMasterSlaveAddrSet ( I2C0_BASE , ui32SlaveAddress , false ) ; I2CMasterDataPut ( I2C0_BASE , ui32SlaveRegister ) ; I2CMasterControl ( I2C0_BASE , I2C_MASTER_CMD_BURST_SEND_START ) ; while ( I2CMasterBusy ( I2C0_BASE ) ) ; uint8_t ui8Counter ; for ( ui8Counter = 0 ; ui8Counter <= ( ui8NumBytes - 2 ) ; ui8Counter ++ ) { I2CMasterDataPut ( I2C0_BASE , pReceiveData [ ui8Counter ] ) ; I2CMasterControl ( I2C0_BASE , I2C_MASTER_CMD_BURST_SEND_CONT ) ; while ( I2CMasterBusy ( I2C0_BASE ) ) ; } I2CMasterDataPut ( I2C0_BASE , pReceiveData [ ui8NumBytes - 1 ] ) ; I2CMasterControl ( I2C0_BASE , I2C_MASTER_CMD_BURST_SEND_FINISH ) ; while ( I2CMasterBusy ( I2C0_BASE ) ) ; }
sends an I2C command to the specified slave
sends an I2C command to the specified slave
// Tell the master module what address it will place on the bus when // communicating with the slave. //Put the register to be sent into FIFO //Initiate send of data from the MCU // Wait until MCU is done transferring. //put next piece of data into I2C FIFO //send next data that was just placed into FIFO // Wait until MCU is done transferring. //put next piece of data into I2C FIFO //send next data that was just placed into FIFO // Wait until MCU is done transferring.