From 3a0ab02b49fb8517c146556432d5f116b88db9a5 Mon Sep 17 00:00:00 2001 From: aleph Date: Tue, 2 Nov 2010 16:09:51 +0000 Subject: [PATCH] ILI9225 lcd driver: add function to write true color bitmap directly on screen. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4493 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/lcd_ili9225.c | 26 ++++++++++++++++++++++++++ bertos/drv/lcd_ili9225.h | 1 + 2 files changed, 27 insertions(+) diff --git a/bertos/drv/lcd_ili9225.c b/bertos/drv/lcd_ili9225.c index d8fbdfdc..e3112df2 100644 --- a/bertos/drv/lcd_ili9225.c +++ b/bertos/drv/lcd_ili9225.c @@ -225,6 +225,32 @@ void lcd_ili9225_blitBitmap(const Bitmap *bm) } } +/* + * Blit a 24 bit color raw raster directly on screen + */ +void lcd_ili9225_blitBitmap24(int x, int y, int width, int height, const char *bmp) +{ + int l, r; + + lcd_startBlit(x, y, width, height); + + for (l = 0; l < height; l++) + { + for (r = 0; r < width; r++) + { + lcd_row[r] = + (((uint16_t)bmp[1] << 11) & 0xE000) | + (((uint16_t)bmp[2] << 5) & 0x1F00) | + (((uint16_t)bmp[0] << 0) & 0x00F8) | + (((uint16_t)bmp[1] >> 5) & 0x0007); + bmp += 3; + } + + lcd_cmd(0x22); + lcd_data(lcd_row, width); + } +} + /** * Turn off display. */ diff --git a/bertos/drv/lcd_ili9225.h b/bertos/drv/lcd_ili9225.h index e365b4e5..09cbf097 100644 --- a/bertos/drv/lcd_ili9225.h +++ b/bertos/drv/lcd_ili9225.h @@ -55,5 +55,6 @@ void lcd_ili9225_off(void); void lcd_ili9225_blitRaw(const uint8_t *data, uint8_t x, uint8_t y, uint8_t width, uint8_t height); void lcd_ili9225_blitBitmap(const Bitmap *bm); +void lcd_ili9225_blitBitmap24(int x, int y, int width, int height, const char *bmp); #endif /* LCD_ILI9225_H */ -- 2.25.1