Hello,
I'm using ChibiOS on STM32F103, communicating with a TFT display over SPI. I order to fill the screen (or part of the screen) with the same colour efficiently, I would like to be able to send the same 16-bit word over SPI many times in one DMA transaction. If I understand it correctly, the best way to do so would to set up a DMA transfer with the cleared STM32_DMA_CR_MINC flag. Unfortunately, there is no way to do it in ChibiOS - the spi_lld_exchange function always sets the MINC flag. Do you think it would be a good idea to expose this flag to the user somehow? Maybe change spi_lld_exchange to accept an optional boolean parameter, or something like this?
Sending the same word over SPI many times
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Sending the same word over SPI many times
Hi,
What you need is a small change in spiIgnore(), it already sends the same data to SPI without MINC, it just sends always 0xFFFF. You just need to change the variable holding the 0xFFFF.
Giovanni
What you need is a small change in spiIgnore(), it already sends the same data to SPI without MINC, it just sends always 0xFFFF. You just need to change the variable holding the 0xFFFF.
Giovanni
Re: Sending the same word over SPI many times
Thanks Giovanni, that would work for me. Should I submit a pull request, or will you make the change yourself?
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Sending the same word over SPI many times
This is something already planned but I cannot guarantee an availability date, this requires an API change or extension.
I suggest you make the change locally then, optionally, submit a patch in "small change request" forum.
Giovanni
I suggest you make the change locally then, optionally, submit a patch in "small change request" forum.
Giovanni
Re: Sending the same word over SPI many times
In a language that accepts optional arguments to functions, you'd extend the spiignore() function with an argument that defaults to "0xffff".
In the case at hand where this is not possible I would suggest you add a function that HAS the argument and redefine spiignore to call the new function with 0xffff as the argument.
In the case at hand where this is not possible I would suggest you add a function that HAS the argument and redefine spiignore to call the new function with 0xffff as the argument.
Who is online
Users browsing this forum: No registered users and 35 guests