Hello,
i have to transmit the data to a I2C memory. I have init the I2C0 with:
@
I2C_MasterGetDefaultConfig(&i2c0_config);
NVIC_SetPriority(I2C0_IRQn, 6);error = I2C_RTOS_Init(&i2c0_handle, I2C0, &i2c0_config, CLOCK_GetFreq(I2C0_CLK_SRC));
then i have to write a data so:
data_transfer.slaveAddress = 0x50U;
data_transfer.direction = kI2C_Write;
data_transfer.subaddress = 0;
data_transfer.subaddressSize = 0;
data_transfer.data = data;
data_transfer.dataSize = n;
data_transfer.flags = kI2C_TransferDefaultFlag;error = I2C_RTOS_Transfer(&i2c0_handle, &data_transfer);
but nothing happen and the device stop with the function
/* Wait for transfer to finish */
xSemaphoreTake(handle->semaphore, portMAX_DELAY);
in the function I2C_RTOS_Transfer.
Other question is what are the variable ?
data_transfer.subaddress = 0;
data_transfer.subaddressSize = 0;
are the address of the device to point ?
Thanks
已解决! 转到解答。