From aa95122c17707d6eaadcbdae71aad33446fcf66c Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Thu, 13 Jan 2022 08:38:07 +0100 Subject: bsp/atsam: Optionally use DMA for UART Rx If the system is busy with other interrupts and the UART is set to a fast baud rate, it's possible to loose UART interrupts and therefore characters. This allows to optionally enable a DMA for the UARTs so that a number of lost interrupts can be tolerated. The number of DMAs on this chip is limited and not not all applications need that feature. Therefore the DMA is disabled by default. Close #4578 --- bsps/arm/atsam/include/bsp.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bsps/arm/atsam/include/bsp.h') diff --git a/bsps/arm/atsam/include/bsp.h b/bsps/arm/atsam/include/bsp.h index 2556f6046d..d1b021255c 100644 --- a/bsps/arm/atsam/include/bsp.h +++ b/bsps/arm/atsam/include/bsp.h @@ -33,6 +33,7 @@ #include #include +#include #include @@ -109,6 +110,18 @@ void atsam_rtc_get_time(rtems_time_of_day *tod); void bsp_restart( const void *const addr ); +/* + * This ioctl enables the receive DMA for an UART. The DMA can be usefull if you + * loose characters in high interrupt load situations. + * + * Disabling the DMA again is only possible by closing all file descriptors of + * that UART. + * + * Note that every UART needs one DMA channel and the system has only a limited + * amount of DMAs. So only use it if you need it. + */ +#define ATSAM_UART_ENABLE_RX_DMA _IO('d', 0) + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3