Platform/ECM3532/DSP/hw/csp/ecm3532/src/eta_csp_i2c.c
/***************************************************************************/
/**
 *
 * EtaCspI2cTransferDmaConfig - Enable DMA transfers from/to I2C device.
 *
 * NOTE: Call this function first, if you need to read from (write to) a
 * I2C device using a DMA transfer. This function also puts the internal
 * state machine to "new I2C transaction start" state. So, make sure any
 * pending I2C transactions are finished before calling this. You can use
 * EtaCspI2cDonePoll() for this.
 ******************************************************************************/
Enable DMA transfers from/to I2C device.
NOTE: Call this function first, if you need to read from (write to) a
I2C device using a DMA transfer. This function also puts the internal
state machine to "new I2C transaction start" state. So, make sure any
pending I2C transactions are finished before calling this. You can use
EtaCspI2cDonePoll() for this.
Enable DMA transfers from / to I2C device . NOTE : Call this function first if you need to read from ( write to ) a I2C device using a DMA transfer . This function also puts the internal state machine to " new I2C transaction start " state . So make sure any pending I2C transactions are finished before calling this . You can use EtaCspI2cDonePoll () for this .
void
EtaCspI2cTransferDmaConfig(void)
{
    REG_I2C2_INT_EN = BM_I2C2_INT_EN_TXFIFO_HAS_LEVEL_SPACE_EN_DSTRDY |
                      BM_I2C2_INT_EN_RX_DATA_EN_SRCRDY;
    REG_I2C2_CONFIG |= (2 << BP_I2C2_CONFIG_RX_FIFO_INT_LEVEL);
    REG_I2C2_STATUS = BM_I2C2_STATUS_START_BUSY;
}
void EtaCspI2cTransferDmaConfig ( void ) { REG_I2C2_INT_EN = BM_I2C2_INT_EN_TXFIFO_HAS_LEVEL_SPACE_EN_DSTRDY | BM_I2C2_INT_EN_RX_DATA_EN_SRCRDY ; REG_I2C2_CONFIG |= ( 2 << BP_I2C2_CONFIG_RX_FIFO_INT_LEVEL ) ; REG_I2C2_STATUS = BM_I2C2_STATUS_START_BUSY ; }
EtaCspI2cTransferDmaConfig - Enable DMA transfers from/to I2C device.
EtaCspI2cTransferDmaConfig - Enable DMA transfers from / to I2C device .
// enable TX/RX Ready (dst_rdy/src_rdy to DMA control) // Set TX Level to be 2 (Data and Cmd) // Start command