ILI9225 lcd driver: add function to write true color bitmap directly on screen.
authoraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 2 Nov 2010 16:09:51 +0000 (16:09 +0000)
committeraleph <aleph@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 2 Nov 2010 16:09:51 +0000 (16:09 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4493 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/lcd_ili9225.c
bertos/drv/lcd_ili9225.h

index d8fbdfdc5ed8771447dc391ab8c316defe392a16..e3112df2a7bf3ded3358e9ff93e8d646eb935a05 100644 (file)
@@ -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.
  */
index e365b4e501c61074431283fe3a9c4ba3804af365..09cbf097643fc6ba82d1d4dfd884510987cd244b 100644 (file)
@@ -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 */