使用I2C FIFO DMA 方式:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
以下为 I2C 设置
I2CRxFIFOConfigSet(i2c_udma_setting[i].I2C_BASE, I2C_FIFO_CFG_RX_MASTER_DMA | I2C_FIFO_CFG_RX_TRIG_3); 设置 tiger 为3 bytes
I2CMasterBurstLengthSet(i2c_udma_setting[i].I2C_BASE, 3); 设置 ui8MasterBytesLength = 3 , 3 个bytes burst 一次
uDMAChannelControlSet(ui32ChannelNum | UDMA_PRI_SELECT,
UDMA_SIZE_8 | UDMA_SRC_INC_NONE | UDMA_DST_INC_8 |
UDMA_ARB_4); 4 byte arbitration (应该没关系,我只有3 个 bytes burst , 已经 不需要 arbite 了)
uDMAChannelTransferSet(ui32ChannelNum | UDMA_PRI_SELECT,
UDMA_MODE, (void *)(i2c_udma_setting[index].I2C_BASE + I2C_O_FIFODATA),
(void *)g_ui8I2CMasterRxDataA[index],
3); 3 bytes
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
以下为 FIFO burst receive 开始
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
以下为 I2C 中断
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
在 INT 的
I2CMasterControl(i2c_udma_setting[index].I2C_BASE, I2C_MASTER_CMD_FIFO_BURST_RECEIVE_FINISH);
处设置硬件中断
问题出在此处:
当执行 I2C_MASTER_CMD_FIFO_BURST_RECEIVE_START 后