steved wrote:If interrupt-driven serial is good enough for you, there are two drivers I've posted here in the past:
a) A UART driver which can use interrupts instead of DMA
b) A version of the serial driver which supports callbacks similar to the UART driver.
thanks. I suspect writing new UART drivers is a favourite sport among ChibiOS developers!
We've done our own uart driver as well. Main features are:
- allows for both DMA and non-DMA operation
allows for sharing TX DMA channel with another device
allows for mixed DMA and non-DMA operation (eg. DMA for RX, non-DMA for TX)
if there is DMA contention then it lowers the max TX size per operation to fit a max latency
has callback hooks allowing us to calculate the time of first byte arrival in a packet
supports optional flow control, configured at runtime
uses two ring buffers and a separate thread for IO
has event callback for applications that need to be woken on incoming packets
It is in C++, so not easily brought into other ChibiOS projects, but source is here if you are interested:
https://github.com/ArduPilot/ardupilot/ ... Driver.cpp
Your DMA resolver looks to be a potentially useful general tool - it can be "fun" getting the DMA assignments right.
it is here:
https://github.com/ArduPilot/ardupilot/ ... esolver.py
it would need some munging for use outside ArduPilot I think