diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-11-05 19:34:12 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-11-05 19:34:12 +1000 |
commit | a8e860678df38fdb44f94cacae52e8d54f4374ff (patch) | |
tree | aa718324e163f6c4b9b06805674655dce17e2c96 /drivers/gdisp/SSD1289 | |
parent | 250adaf028848c0aa0dfa2029b722274cb7a6d6a (diff) | |
download | uGFX-a8e860678df38fdb44f94cacae52e8d54f4374ff.tar.gz uGFX-a8e860678df38fdb44f94cacae52e8d54f4374ff.tar.bz2 uGFX-a8e860678df38fdb44f94cacae52e8d54f4374ff.zip |
New GDISP now supports multiple controllers with different pixel formats.
You can now have a main color display and a secondary monochrome display.
You can now optionally set GDISP_PIXELFORMAT to any color or grayscale format for your application and the driver will internally convert to the display hardware format.
Diffstat (limited to 'drivers/gdisp/SSD1289')
-rw-r--r-- | drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 16 | ||||
-rw-r--r-- | drivers/gdisp/SSD1289/gdisp_lld_config.h | 7 |
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index 6692e7d7..a33b6564 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -200,7 +200,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - write_data(g, g->p.color); + write_data(g, COLOR2NATIVE(g->p.color)); } LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { release_bus(g); @@ -221,7 +221,10 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { - return read_data(g); + uint16_t data; + + data = read_data(g); + return NATIVE2COLOR(data); } LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { setwritemode(g); @@ -231,15 +234,22 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS && defined(GDISP_USE_DMA) LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { + uint16_t c; + + c = COLOR2NATIVE(g->p.color); acquire_bus(g); set_viewport(g); set_cursor(g); - dma_with_noinc(g, &color, g->p.cx*g->p.cy) + dma_with_noinc(g, &c, g->p.cx*g->p.cy) release_bus(g); } #endif #if GDISP_HARDWARE_BITFILLS && defined(GDISP_USE_DMA) + #if GDISP_PIXELFORMAT != GDISP_LLD_PIXELFORMAT + #error "GDISP: SSD1289: BitBlit is only available in RGB565 pixel format" + #endif + LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { pixel_t *buffer; coord_t ycnt; diff --git a/drivers/gdisp/SSD1289/gdisp_lld_config.h b/drivers/gdisp/SSD1289/gdisp_lld_config.h index 4cf5fa5c..a9166553 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_config.h @@ -28,8 +28,11 @@ #define GDISP_HARDWARE_CONTROL TRUE #if defined(GDISP_USE_DMA)
- #define GDISP_HARDWARE_FILLS TRUE
- #define GDISP_HARDWARE_BITFILLS TRUE + #define GDISP_HARDWARE_FILLS TRUE + #if !defined(GDISP_PIXELFORMAT) || GDISP_PIXELFORMAT == 0x2565 + // Hardware BitBlts are only supported in native pixel format on this controller
+ #define GDISP_HARDWARE_BITFILLS TRUE + #endif #endif
#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
|