This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Multiple I2C devices with Starterware

Other Parts Discussed in Thread: OMAPL138

OMAP-L138-EP

Starterware 1.10.04.01

CCS 6.x

All:

It looks like the Starterware examples assume a single slave for I2C. If multiple I2C devices are attached, would one need to alter the functions used so that an address could be passed, depending on the device being communicated with?

  • You may need to call the "SetupI2C" again with newer slave address for i2c transfer with newer i2c device.

    C:\ti\OMAPL138_StarterWare_1_10_04_01\drivers\i2c.c
    /**
    * \brief Sets the address that the I2C Master will place on the bus.\n
    *
    * \param baseAddr is the Memory address of the I2C instance used \n
    * \param slaveAddr slave address \n
    *
    * \return None \n
    **/
    void I2CMasterSlaveAddrSet(unsigned int baseAddr, unsigned int slaveAddr)
    {
    /*Set the address of the slave with which the master will communicate.*/
    HWREG(baseAddr + I2C_ICSAR) = slaveAddr;
    }