Added SSD1331_COLORORDER_RGB/BGR flag
authorKevin Townsend <kevin@ktownsend.com>
Mon, 23 Jan 2012 22:38:16 +0000 (23:38 +0100)
committerKevin Townsend <kevin@ktownsend.com>
Mon, 23 Jan 2012 22:38:16 +0000 (23:38 +0100)
drivers/lcd/tft/hw/ssd1331.c
drivers/lcd/tft/hw/ssd1331.h

index a5ac130..73b9654 100644 (file)
@@ -236,7 +236,13 @@ void lcdInit(void)
   
   CMD(SSD1331_CMD_DISPLAYOFF);  // 0xAE
   CMD(SSD1331_CMD_SETREMAP); // 0xA0
-  CMD(0x76);  // 0x74
+  // A[2] = 1 = color order (0 = RGB, 1 = BGR)
+  // A[7:6] = 01 = 65K color
+  #if defined SSD1331_COLORORDER_BGR
+  CMD(0x76);
+  #else
+  CMD(0x72);
+  #endif
   CMD(SSD1331_CMD_STARTLINE); // 0xA1
   CMD(0x0);
   CMD(SSD1331_CMD_DISPLAYOFFSET); // 0xA2
index bd98594..8b53927 100644 (file)
 #include "drivers/lcd/tft/lcd.h"
 #include "core/gpio/gpio.h"
 
+// Select one of these defines to set the pixel color order
+// #define SSD1331_COLORORDER_RGB
+#define SSD1331_COLORORDER_BGR
+
+#if defined SSD1331_COLORORDER_RGB && defined SSD1331_COLORORDER_BGR
+  #error "RGB and BGR can not both be defined for SSD1331_COLORODER."
+#endif
+
 // Control pins
 #define SSD1331_SID_PORT          2     // DAT
 #define SSD1331_SID_PIN           1
This page took 0.025904 seconds and 4 git commands to generate.