cancel
Showing results for 
Search instead for 
Did you mean: 

DMA Mode change source Increment address

ILI9341 SPI display running on an L5 processor on a custom board.
In a never ending quest to make the display go faster, I've split off the generic write image from the generic fill block.
Since the high level drivers work with any type of display, all data is contained within a virtual 32 bit image (ARGB).

Calling a copy routine copies the desired area in the virtual image to the display (writing within a window) using a translation routine for each line of pixels (as needed by blocksize) then writing it out.

For a block fill, the colors are identical, so the first approach is to create the line buffer once, then repeat DMA.  This works reasonably well.  (The L5 chip I use does not have ChromART, and doesn't have the right mode without writing to an intermediate buffer).

It would save some processing time (but not DMA time) if I did a direct one pixel transfer to the ILI9341.  However, the DMA channel is set to increment memory source address.  While I may have a DMA channel available elsewhere, the hardware does not all two DMA channels to go to the same destination (SPI),  not that I found.  Even if one is not active. 

What I'd like to do is change the mode of the source from increment to not increment between transfers.  HAL drivers do not provide a nice way of doing this, but it seems that it's one bit in a status register.  I could read/reset and rewrite that bit.

Is this the most graceful way of doing it?  Chip is protected by a semaphore, so it can't be accessed simultaneously by two different threads.

 

Thanks

 

2 REPLIES 2
TDK
Guru

MINC can only be changed if the DMA is disabled. You could do this via register access, but you could also use HAL functions to de-initialize and reinitialize it with the new settings. Either way is fine. HAL won't know or care if you change the setting yourself with a quick disable/change/enable.

If you feel a post has answered your question, please click "Accept as Solution".

I rather figured that was the case.  I think that the HAL driver initializes the DMA each time, but I haven't bothered to go look at the code there.  If so, then I'll just parallel another bit of code with a parameter change.  Since the HAL code doesn't have a // user declaration (and ignores it if you put one in), I'll have to hide it elsewhere, for instance, in my own code.

Thanks