Can someone explain me how to use the "PeriphInc" in the DMA_InitTypeDef.
I understood that it can read several address (is that right ?), but where I write the start and end adress ?
It is pretty simple, but they both need to be within the addressable space of the processor.
An SPI based peripheral is going to get accessed by repetitive reads of &SPI1->DR, an address that ISN'T incrementing.
If the registers in the accelerometer are 16-bit and there are 3 of them, you'd program the DMA to transfer 6-bytes, and you'd be dependent on the external device to "auto increment" its internal register address.
Hi Alexandre T,
Taking the example of STM32CubeF7, I checked the UM1905 (Description of STM32F7 HAL and Low-layer drivers) where I found following description (p275):
uint32_t DMA_InitTypeDef::PeriphInc Specifies whether the Peripheral address register should be incremented or not. This parameter can be a value of DMA_Peripheral_incremented_mode
Please refer to the description of this structure in order to know more about all the fields.
Yes I already read it but in fact, I don't understand what it means. Does it means that I can do multiple reads on several address ? If so, how can I write the start and end adress ?
You define the direction of the transfer, and the length in transfer units.
You specify the source and destination addresses using HAL_DMA_Start(), which is the peripheral depends on the direction. It will be the source address in the "from peripheral" case.
Sorry but I still don't get it.
For example :
If I want to do multiple reads (I have an accelerometer and I want to read x,y,z values),
Do I need to configure several DMA or is it possible to do it with only one ?
Thank you, that's the answer I was waiting for !
Retrieving data ...