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.

TMS570LS1224: I2C Interrupts for the TMS570

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Hi,

I wanted to use the transmit data & receive data interrupt in I2C.

The example code given with halcogen is in polling mode.

Please could you share me an example code using I2C transmit and receive, if available?

Thanks and regards.

  • Hello,
    There is an example code for TMS570LS31x_21x MCUs under HALCoGen example folders.
    void i2cReceive(i2cBASE_t *i2c, uint32 length, uint8 * data) function was called first to setup receive operation.
    This is from function declaration:
    "Receive a block of 'length' bytes long and place it into the
    * data buffer pointed to by 'data'. If interrupts have been
    * enabled the data is received using interrupt mode, otherwise
    * polling mode is used. In interrupt mode receive is setup and
    * the routine returns immediately, i2cReceive must not be called
    * again until the transfer is complete, when the i2cNotification
    * callback will be called. In polling mode, i2cReceive will not
    * return until the transfer is complete. "

    void i2cSend(i2cBASE_t *i2c, uint32 length, uint8 * data) function is used for sending data. In interrupt mode transmission of the first byte is started and the routine returns immediately.

    This is from functio declaration:
    "Send a block of data pointed to by 'data' and 'length' bytes
    * long. If interrupts have been enabled the data is sent using
    * interrupt mode, otherwise polling mode is used. In interrupt
    * mode transmission of the first byte is started and the routine
    * returns immediately, i2cSend must not be called again until the
    * transfer is complete, when the i2cNotification callback will
    * be called. In polling mode, i2cSend will not return until
    * the transfer is complete."

    Hope this helps.

    Best regards,
    Miro