I2C Slave repeated start handling

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

I2C Slave repeated start handling

522 次查看
GoatRope
Contributor II

Using RT1024 board code based on evkmimxrt1024_lpi2c_interrupt_b2b_transfer_slave: 

I have a master which causes a repeated start event and notice sample code callback does not handle that. My code ( slave ) needs to calculate response then transmit back. 

I added the kLPI2C_SlaveRepeatedStartEvent in the init() and in callback. In that new callback case I  set g_SlaveCompletionFlag = true to facilitate "main" considering that "segment" of the transaction complete. Also added a flag to indicate Rx so the response is calculated. At that point the callback's kLPI2C_SlaveTransmitEvent should get a non NULL xfer->data ( thus the response would be initiated by the callback setting non NULL ). 

If anyone has pointers on implementing this scenario  it would help greatly. I'm not sure if I need to disable Tx interrupt and/or concoct other logic. Thanks - dB

 

 

 

 

 

标签 (1)
标记 (2)
0 项奖励
回复
1 回复

501 次查看
PabloAvalos
NXP TechSupport
NXP TechSupport

Dear @GoatRope 

 

I highly appreciate your patience and your questions on our community. We are experiencing a high volume on i.MX RT requests.

 

Regarding the issue you are having, I am willing to help of course, I just would like to have a little more time to have a resolution for your concerns as soon as possible.

Just to see if I understood correct your main issue, is that the function kLPI2C_SlaveTransmitEvent is waiting to receive a non-NULL status in order to start with the transfer from master to slave, but this function is receiving always a NULL status so it never starts the transfer, am I correct ?

 

Lastly, may I know what did you try to say here: "Tx interrupt and/or concoct other logic", because I did not get it.

 

I appreciate your clarifications on this and your time. Please let me know if you have any additional questions or something more I can help you with. Your questions are always welcome.

 

Sincerely,
Pablo Avalos.

0 项奖励
回复