Hello Christopher:
As mentioned by Santiago there are several examples in KSDK installation, you should take a look at those.
Just notice that the MasterSendData API expects the parameter txBuff to be passed by reference, not by value, so in your case you should declare a uint8_t variable or an array of uint8_t and pass the address as a pointer. The parameter txSize is the number of bytes to transfer from such array, or 1 in the uint8_t variable case. Below an example for writing 0x06 to an I2C slave:
uint8_t data = 0x06;
I2C_DRV_MasterSendData (i2cCom1_IDX,&i2cCom1_MasterConfig0, NULL, 0, &data, 1);
About cmdBuff parameter, this is used for some slave devices that require extra bytes apart from the significant data bytes to send or receive. For example the I2C EEPROM memories may require an internal address before a Write or Read operation (do not confuse with the I2C slave address). In the case of the API MasterReceiveData when cmdBuff is not NULL then a Repeated Start is generated between the transmission of cmdBuff and the reception of data in rxBuff, with a corresponding change in the R/W bit.
I hope this helps.
Best regards,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------