How to see R/W bit in I2C driver S32K SDK

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to see R/W bit in I2C driver S32K SDK

1,087件の閲覧回数
saireddy_saredd
Contributor III

Hallo,

I am bit confusing with I2C master send function and receive functions. 

/*!
* @brief Perform a non-blocking receive transaction on the I2C bus
*
* This function starts the reception of a block of data from the currently
* configured slave address and returns immediately.
* The rest of the reception is handled by the interrupt service routine.
* Use LPI2C_DRV_MasterGetReceiveStatus() to check the progress of the reception.
*
* @param instance LPI2C peripheral instance number
* @param rxBuff pointer to the buffer where to store received data
* @param rxSize length in bytes of the data to be transferred
* @param sendStop specifies whether or not to generate stop condition after the reception
* @return Error or success status returned by API
*/
status_t LPI2C_DRV_MasterReceiveData(uint32_t instance,
uint8_t * rxBuff,
uint32_t rxSize,
bool sendStop);

How can I read data without Writing address on the slave with LPI2C_DRV_MasterReceiveData function??

How can I differentiate Read or Write operation with this function.

Please give example codes for this requirements

I want to write configuration register to ADXL345 
I want to read X,Y and Z axis data from ADXL345

 

Best Regards,

Sai

 

@danielmartynek

 

 

0 件の賞賛
返信
1 返信

1,058件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Sai,

LPI2C_DRV_MasterSetSlaveAddr is used to sets the slave address.

LPI2C_DRV_MasterSetSlaveAddr.jpgLPI2C_DRV_MasterReceiveData.jpg

For more detail please read the documentation <SDK_PATH>/doc/Start_Here.html

 

Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信