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
Solved! Go to Solution.
Hi Daniele,
Could you tell us which MCU are you using?
Thanks in advance!
Best Regards,
Carlos Mendoza
Technical Support Engineer
yes sorry, K22FX512
Solved, it was a my error with the I2C0 instead I2C2