AnsweredAssumed Answered

Freedom Kl46Z i2c

Question asked by Oscar Rozo on Nov 5, 2015
Latest reply on Nov 6, 2015 by Oscar Rozo

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.