Clarification of I2C_DRV_MasterReceiveDataBlocking() parameters

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Clarification of I2C_DRV_MasterReceiveDataBlocking() parameters

跳至解决方案
798 次查看
davepfaltzgraff
Senior Contributor I

I'm trying to use the I2C_DRV_MasterXXXDataBlocking parameters and need some clarification. The following is my interpretation and I would like comments for clarification. (My environment is Windows7, KDS, KSDK, PE, and MQX on FRDM-K22F.)

 

The documentation states (simplified with my annotation):

====

I2C_DRV_MasterReceiveDataBlocking (

  instance,    // Which I2C Bus

  device,      // Address on I2C bus (7-bit width)

   cmdBuff,     // If not NULL, commands to be sent

  cmdSize,     // If not zero, number of bytes sent as command IF cmdBuff is not NULL

               // If command was sent, a restart applied

               // and I2C Address sent with a READ cycle

  rxBuff,      // Memory location for data read

  rxSize,      // Number of bytes to read , unless terminated by device

  timeout_ms );// Time out in milliseconds (API states microseconds!)

====

My question is: If cmdBuff is NULL, does the driver issue a read to the device without sending out the command first? In other words, the restart cycle is never performed.

 

I have the same question on the I2C_DRV_MasterReadDataBlocking() function as well.

 

In these cases I would expect to see the I2C bus go immediately into the appropriate transfer. Am I correct in this interpretation?

 

Thanks

标签 (1)
0 项奖励
1 解答
472 次查看
chris_brown
NXP Employee
NXP Employee

Hi David,

In the case you mention (passing NULL for cmdBuff and cmdSize), you should NOT see a repeated start.  The device would expect to start receiving data from the slave immediately. 

Regards,

Chris

在原帖中查看解决方案

1 回复
473 次查看
chris_brown
NXP Employee
NXP Employee

Hi David,

In the case you mention (passing NULL for cmdBuff and cmdSize), you should NOT see a repeated start.  The device would expect to start receiving data from the slave immediately. 

Regards,

Chris