This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Why is uDMA transfer destination a void* ?

extern void uDMAChannelTransferSet(uint32_t ui32ChannelStructIndex, uint32_t ui32Mode, void *pvSrcAddr,   void *pvDstAddr, uint32_t ui32TransferSize);

Why does the transfer function take a void pointer for "pvDstAddr" and "pvSrcAddr"?  From my understanding, these are usually arrays or registers.  Am I using this correctly?  Below is my call to this API.

uDMAChannelTransferSet(UDMA_CHANNEL_SSI0TX | UDMA_PRI_SELECT, UDMA_MODE_BASIC, &ADCsampleBuffer2[0], (void *)(SSI0_BASE + SSI_O_DR), sizeof(ADCsampleBuffer2));


I get a warning about this type mismatch because my array is a char*...thats why i'm curious.

Thanks Rob.

  • Personally, I wish that TI would use more of "void *" in their library headers. And add "const" when it's a source buffer. The "void *" should allow you to pass any type of buffer (eg unsigned or signed char, short or long) without having to cast. In this case, I am betting it's the "volatile" on the SSI0 register definition or if ADCsampleBuffer is const data that is causing the warning.