Kuba0040
Well-known member
Hello,
I have a simple question today. I want to maunally input some memory addresses into pointers, so then I can write and read data from these addresses easily. Here is an example:
I want the pointer TCD_SADDR to point to address 0x1000. TCD_DADDR to address 0x1010. However, the compiler throws warnings at me about an invalid data conversion.
warning: invalid conversion from 'int' to 'int32_t* {aka long int*}' [-fpermissive]
For extra context, I need this to write/read the DMA’s TCD structure, where each channel has it’s parameters at the same address as all of the other channels, just with a channel specific offset applied to it. So, to for example set the Source adress of any channel using the pointers I would just have to do this:
So, I thought I’d just ask how to do this properly right away. Should I use something else than pointers? Please let me know.
Thank you for the help.
I have a simple question today. I want to maunally input some memory addresses into pointers, so then I can write and read data from these addresses easily. Here is an example:
Code:
int32_t *TCD_SADDR=0x1000;
int32_t *TCD_DADDR=0x1010;
I want the pointer TCD_SADDR to point to address 0x1000. TCD_DADDR to address 0x1010. However, the compiler throws warnings at me about an invalid data conversion.
warning: invalid conversion from 'int' to 'int32_t* {aka long int*}' [-fpermissive]
For extra context, I need this to write/read the DMA’s TCD structure, where each channel has it’s parameters at the same address as all of the other channels, just with a channel specific offset applied to it. So, to for example set the Source adress of any channel using the pointers I would just have to do this:
Code:
*(TCD_SADDR+channel_number*0x20)=value I want to write here
So, I thought I’d just ask how to do this properly right away. Should I use something else than pointers? Please let me know.
Thank you for the help.