cancel
Showing results for 
Search instead for 
Did you mean: 

I3C TARGET : How to detect when the controller requests data ?

MedFedi
Associate II

Hello,
I'm currently working with I3C in Target mode using STM32H7S3L8. I need to detect when the Controller sends a request to read data from the Target.
In I2C, we can check the Address Match (ADDR) flag to know when the master sends a frame to the slave.
Is there a similar flag or event in I3C to detect when the Controller is requesting data from the Target (i.e., a read request)?
I'm using the I3C HAL/LL drivers, and I want to handle this case to prepare and send the correct response.
Thanks in advance!

2 REPLIES 2
JRAUL.1
ST Employee

Hello,

And good point. On I2C, it was possible to use an information of direction through a specific callback named

HAL_I2C_AddrCallback.
 
At I2C driver level, it works as the Stretch mode is used and so it was possible to "delay" the Master/slave communication until Slave was ready to receive or transmit data.
 
On I3C level, link to MIPI specification the stretch mode is forbidden. So it is not possible to delay a started private communication. So not possible to have a delay to inform application that a private transmit or receive communication is requested.
 
The best way to perform an unknown communication direction, is:
To manage a protocol on application side like:
Controller send a first specific transmit with a Code which can be detected like a transmit or receive at next communication.
And then at Target side, thx to this received code, the target will be able to prepare the private communication to a transmit or a receive.
This start of communication by using function 
HAL_I3C_Tgt_Transmit_IT or HAL_I3C_Tgt_Receive_IT can be called inside the HAL_I3C_TgtRxCpltCallback.

Hope it helps, MIPI I3C add some private communication restriction in comparison of I2C as no stretch is possible.
Regards
MedFedi
Associate II

Hello,
Thanks Jerome for replying,
In I3C, we can use the RXFNEF flag to check for data reception in the target (to read incoming data).
I would like to know which flag I can use in the target to detect when the controller is requesting data, meaning the target must transmit data to the controller.
Thank you in advance.