From: aleph Date: Tue, 2 Nov 2010 16:09:51 +0000 (+0000) Subject: ILI9225 lcd driver: add function to write true color bitmap directly on screen. X-Git-Tag: 2.6.0~5^2~27 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=3a0ab02b49fb8517c146556432d5f116b88db9a5;p=bertos.git 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 --- 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 */