SEPS114A Driver

SEPS114A SPI Driver

class SPIPreInit : public SPI { public: SPIPreInit(PinName mosi, PinName miso, PinName clk) : SPI(mosi,miso,clk) { format(8,3); frequency(12000000); }; };

SPIPreInit gSpi(PB_15,NC,PB_13); PinName mosi(sda), PinName miso, PinName clk(scl) Adafruit_SEPS114A_Spi oled(gSpi,PB_14,PB_1,PB_2); PinName DC, PinName RST, PinName CS

You can print russian cyrilic

Revision:
1:a37035f55af3
Parent:
0:f7b7f71865d1
--- a/Adafruit_SEPS114A.cpp	Thu Apr 28 10:03:43 2016 +0000
+++ b/Adafruit_SEPS114A.cpp	Tue May 10 06:19:10 2016 +0000
@@ -178,7 +178,26 @@
 // Set a single pixel
 void Adafruit_SEPS114A::drawPixel(int16_t x, int16_t y, uint16_t color)
 {
-	
+		   if ((x < 0) || (x >= width()) || (y < 0) || (y >= height()))  // Bounds check.
+        return;
+    
+    // check rotation, move pixel around if necessary
+    switch (getRotation())
+    {
+        case 1:  							// Rotated 90 degrees clockwise.
+            swap(x, y);
+            x = _rawWidth - x - 1;
+            break;
+        case 2:								// Rotated 180 degrees clockwise.
+            x = _rawWidth - x - 1;
+            y = _rawHeight - y - 1;
+            break;
+        case 3:								// Rotated 270 degrees clockwise.
+            swap(x, y);
+            y = _rawHeight - y - 1;
+            break;
+    }  
+    
 	MemorySize( x,  1,  y,  1);
 	DDRAM_access();
 	writeData(color >> 8) ;