I'm writing an application that communicates with multiple identical peripherals on different I2C busses using DMA.
I set up four Flexcomm interfaces (2,3,4,5) as I2C DMA, but am running into a small problem with the I2C DMA Handle User Data Pointer.
Since everything is identical I want a single callback function that receives a user data pointer, and since they're identical I'd like to make an array of data items.
i.e.
struct my_user_data user_data[4];
What I'm running into is that the Peripherals page won't let me use
&user_data[0]
as a valid user data pointer.
I seem to be forced to doing:
struct my_user_data *p_user_data_0 = &user_data[0];
struct my_user_data *p_user_data_1 = &user_data[1];
struct my_user_data *p_user_data_2 = &user_data[2];
struct my_user_data *p_user_data_3 = &user_data[3];
And using them in the peripherals page.
Is there an easier way to do this?