Freedom Kl46Z i2c

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,253件の閲覧回数
OROZO
Contributor II

Hello every body,

 

I'm trying to implement an i2c communication between the FRDM-KL46Z and the MMA8451Q accelerometer but unfortunetly I don't understand the KSDK ver 1.3 API Reference Manual (I think traditional PExpert was a lot more helpful), so I want to know somebody who can explain me the following function:

 

i2c_status_t I2C_DRV_MasterSendDataBlocking ( uint32_t instance, const

i2c_device_t   device, const uint8_t   cmdBuff, uint32_t cmdSize, const uint8_t

  txBuff, uint32_t txSize, uint32_t timeout_ms )

 

I don't understand the cmdBuff purpouse, what kind of information should be filled in? I think the txBuff already contains the bytes to be transmitted to the slave.

 

The only way this function returns a succesful flag is with cmdBuff = NULL an cmd size = 0. 

 

Another issue is that the MMA8451Q manual explain the need of a Repeated Start, and as I bealive there is no way to do that with the standar i2c API, or at least I have no idea how to do that.

 

I think the KSDK API reference manual could be done a lot better by freescale.

ラベル(1)
1 解決策
622件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Oscar,

These two parameters are about the slave register you wan to write.

“cmdBuff” is the address of the slave register , the size is the size of slave register (for example , if the register is 1byte , the here you can write 1).

How to configure these two parameters you need Check the Reference manual of MMA8451Q .

Hope it helps

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

Have a great day,
Alice

元の投稿で解決策を見る

2 返答(返信)
623件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Oscar,

These two parameters are about the slave register you wan to write.

“cmdBuff” is the address of the slave register , the size is the size of slave register (for example , if the register is 1byte , the here you can write 1).

How to configure these two parameters you need Check the Reference manual of MMA8451Q .

Hope it helps

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

Have a great day,
Alice

622件の閲覧回数
OROZO
Contributor II

Thank you Alice,

I'm going to try to implement the function again this weekend.

0 件の賞賛
返信