aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/SSD2119
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gdisp/SSD2119')
-rw-r--r--drivers/gdisp/SSD2119/board_SSD2119_template.h9
-rw-r--r--drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c16
-rw-r--r--drivers/gdisp/SSD2119/gdisp_lld_config.h2
3 files changed, 21 insertions, 6 deletions
diff --git a/drivers/gdisp/SSD2119/board_SSD2119_template.h b/drivers/gdisp/SSD2119/board_SSD2119_template.h
index 61c54774..346519c4 100644
--- a/drivers/gdisp/SSD2119/board_SSD2119_template.h
+++ b/drivers/gdisp/SSD2119/board_SSD2119_template.h
@@ -57,8 +57,13 @@ static inline uint16_t read_data(GDisplay *g) {
return 0;
}
-#if defined(GDISP_USE_DMA) || defined(__DOXYGEN__)
- //#error "GDISP - SSD2119: This interface does not support DMA"
+//Optional define if your board interface supports it
+//#define GDISP_USE_DMA TRUE
+
+// Optional define - valid only when GDISP_USE_DMA is TRUE
+//#define GDISP_NO_DMA_FROM_STACK FALSE
+
+#if defined(GDISP_USE_DMA) && GDISP_USE_DMA
static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) {
(void) g;
diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
index 36deeb90..5a789548 100644
--- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
+++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c
@@ -31,6 +31,12 @@
#ifndef GDISP_INITIAL_BACKLIGHT
#define GDISP_INITIAL_BACKLIGHT 100
#endif
+#ifndef GDISP_USE_DMA
+ #define GDISP_USE_DMA FALSE
+#endif
+#ifndef GDISP_NO_DMA_FROM_STACK
+ #define GDISP_NO_DMA_FROM_STACK FALSE
+#endif
#include "drivers/gdisp/SSD2119/ssd2119.h"
@@ -265,9 +271,13 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g) {
}
#endif
-#if GDISP_HARDWARE_FILLS && defined(GDISP_USE_DMA)
+#if GDISP_HARDWARE_FILLS && GDISP_USE_DMA
LLDSPEC void gdisp_lld_fill_area(GDisplay* g) {
- LLDCOLOR_TYPE c;
+ #if GDISP_NO_DMA_FROM_STACK
+ static LLDCOLOR_TYPE c;
+ #else
+ LLDCOLOR_TYPE c;
+ #endif
c = gdispColor2Native(g->p.color);
acquire_bus(g);
@@ -278,7 +288,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay* g) {
}
#endif
-#if GDISP_HARDWARE_BITFILLS && defined(GDISP_USE_DMA)
+#if GDISP_HARDWARE_BITFILLS && GDISP_USE_DMA
#if GDISP_PIXELFORMAT != GDISP_LLD_PIXELFORMAT
#error "GDISP: SSD2119: BitBlit is only available in RGB565 pixel format"
#endif
diff --git a/drivers/gdisp/SSD2119/gdisp_lld_config.h b/drivers/gdisp/SSD2119/gdisp_lld_config.h
index 17983807..671c7f79 100644
--- a/drivers/gdisp/SSD2119/gdisp_lld_config.h
+++ b/drivers/gdisp/SSD2119/gdisp_lld_config.h
@@ -19,7 +19,7 @@
#define GDISP_HARDWARE_STREAM_POS TRUE
#define GDISP_HARDWARE_CONTROL TRUE
-#if defined(GDISP_USE_DMA)
+#if defined(GDISP_USE_DMA) && GDISP_USE_DMA
#define GDISP_HARDWARE_FILLS TRUE
#if !defined(GDISP_PIXELFORMAT) || GDISP_PIXELFORMAT == 0x2565
// Hardware BitBlts are only supported in native pixel format on this controller