Update benchmark projects.
[bertos.git] / bertos / drv / lcd_ili9225.c
index 5594dc969e11fe253d6a8462286ea2ea5dca0033..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.
  */
@@ -252,33 +278,6 @@ static void lcd_reset(void)
        timer_delay(50);
 }
 
-/**
- * Set display backlight intensity.
- */
-void lcd_ili9225_backlight(unsigned level)
-{
-    unsigned i;
-
-    if (level > LCD_BACKLIGHT_MAX)
-           level = LCD_BACKLIGHT_MAX;
-
-    // Switch off backlight
-    LCD_BACKLIGHT_LOW();
-    timer_delay(1);
-
-    // Set new level
-    for (i = 0; i <= level; i++)
-    {
-           LCD_BACKLIGHT_LOW();
-           LCD_BACKLIGHT_LOW();
-           LCD_BACKLIGHT_LOW();
-
-           LCD_BACKLIGHT_HIGH();
-           LCD_BACKLIGHT_HIGH();
-           LCD_BACKLIGHT_HIGH();
-    }
-}
-
 /**
  * Display initialization.
  */