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.

[参考译文] TM4C1294NCZAD:如何使用主 I2C FIFO 读取超过8字节的数据

Guru**** 2463330 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/661295/tm4c1294nczad-how-to-use-master-i2c-fifo-to-read-data-more-than-8-bytes

器件型号:TM4C1294NCZAD

读取的数据不能超过8个字节

2.如果我使用 I2CFIFODataGet (),它有时会被占用。

是否有人可以帮助我解决该计划?

空 I2C0_FIFO_READ (uint16_t u16Len)

  I2CMasterBurstLengthSet (I2C5_base、u16Len);
  I2CMasterSlaveAddrSet (I2C5_base、I2C_SLAVE_ADDR、1);
  I2CMasterControl (I2C5_base、I2C_MASTER_CMD_FIFO_BURST_Receive_finish);

空 I2C5中断(空)

  uint8_t i、au8Data[8];

   对于(I = 0;I < 8;+I)
   {

     //au8Data[i]=I2CFIFODataGet (I2C5_base);

     I2CFIFODataGetNonBlocking (I2C5_base、au8Data);
   }

   #if 0
   G_u32FIFOReadLen+=8;
   if (g_u32FIFOReadLen < g_u32FIFOReadTotal)
   {
      I2CMasterBurstLengthSet (I2C5_base、8);
      I2CMasterControl (I2C5_base、I2C_MASTER_CMD_FIFO_SINGLE_Receive);
   }
   #endif

   I2CMasterIntClear (I2C5_base);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

    欢迎来到本论坛。

    I2C 模块具有一个8字节 FIFO。 通过使用中断来保持 FIFO 满(TX)或空(RX)、可以执行超过8字节的猝发请求、读取或写入。  例如、您可以通过调用将 RX FIFO 设置为在接收到4个或更多字节时提供中断:

    I2CRxFIFOConfigSet (I2C5_base、I2C_FIFO_CFG_RX_TRIG_4); 

    在中断例程中,可以使用 I2CFIFODataGetNonBlocking()读取数据,但必须检查返回值以验证是否有有效的数据要读取。 (返回1表示读取一个字节、返回0表示 FIFO 现在为空。) 如果中断例程被延迟、FIFO 中可能包含四个以上的元素。