X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fdrv%2Flcd_ili9225.c;h=e3112df2a7bf3ded3358e9ff93e8d646eb935a05;hb=024bf80e5f29e4de00d0813d23a4d3b67245ead7;hp=d8fbdfdc5ed8771447dc391ab8c316defe392a16;hpb=dbdfdb39b80573098140a42d2a1704f43f4c40c0;p=bertos.git 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. */