DMA Serial Library for Teensy 3.6 and Teensy 4.0

alihares99

New member
I have developed 2 libraries for DMA Serial for Teensy 3.6 and Teensy 4.0 which are fully compatible with Arduino architecture and code style and easy to use. They are currently open-source and available to public at my Github page (DmaSerialTeensy3_6 and DmaSerialTeensy4_0). I want to know if there is any opportunity for me to publish them as a part of the official libraries of the Teensy Libraries.

Here is how you would use the library:

#include "DmaSerialTeensy.h"

void setup() {
dmaSerial1.begin(115200);
}

void Loop() {

while (dmaSerial1.available()) {
dmaSerial1.read();
}
static uint32_t last = 1000;
if (millis() >= last + 1000) {
last = millis();

dmaSerial1.println("alive\r\n");
}
}
 
I went through the same process of writing DMA mode libraries for T4.1, not only for Serial/UART but also for SPI master, SPI slave. I had to because the standard libraries did not give me the functionality that was needed in the applications that I was building. I have the same question: as others could benefit from finding the solutions in the 'official Teensy Libraries', what is the process to get them published out there?
 
At its simplest clone the relevant repository to a local repo of yours, create your change branch, create a pull-request, and start a thread about it...
 
I went through the same process of writing DMA mode libraries for T4.1, not only for Serial/UART but also for SPI master, SPI slave. I had to because the standard libraries did not give me the functionality that was needed in the applications that I was building. I have the same question: as others could benefit from finding the solutions in the 'official Teensy Libraries', what is the process to get them published out there?
Could you give a pointer to your code please, and title of thread (if applicable) ?
 
Attached.

This version allows also for 1-wire UART (Tx and Rx on same pin, tri state), RS485 direction control, interrupt on Rx idle, and 9 bit characters.
T4.1 only.
Not directly compatible with legacy Arduino style Serial libraries because for Tx over DMA the process is to first fill a buffer with N chars and then a call to start transmission of whatever is in that buffer, so that the buffer empties.
 

Attachments

  • DMA_UARTs_test_RX_idle-231023a.zip
    14.4 KB · Views: 19
Thank you.

I have been playing with DMA today on a Teensy3.5 and I have learnt quite a lot. It's not too difficult, however I haven't seen it clearly documented. The datasheet is a bit unclear in my opinion.
 
Back
Top