A derived version of the BSD licensed Adafrut GFX library for the SSD1306 controller for an OLED 128x32 or 128x64 display using SPI or I2C.

Files at this revision

API Documentation at this revision

Comitter:
faydrus
Date:
Sat Dec 08 15:54:37 2018 +0000
Parent:
16:7fb1d4d3525d
Commit message:
OLED display comes up using a bit-banged SPI driver.

Changed in this revision

Adafruit_SSD1306.h Show annotated file Show diff for this revision Revisions of this file
--- a/Adafruit_SSD1306.h	Tue Nov 11 22:08:20 2014 +0000
+++ b/Adafruit_SSD1306.h	Sat Dec 08 15:54:37 2018 +0000
@@ -25,6 +25,7 @@
 
 #include "mbed.h"
 #include "Adafruit_GFX.h"
+#include "SWSPI.h"
 
 #include <vector>
 #include <algorithm>
@@ -100,7 +101,7 @@
 	 * @param rawHeight - the vertical number of pixels for the display, defaults to 32
 	 * @param rawWidth - the horizonal number of pixels for the display, defaults to 128
 	 */
-	Adafruit_SSD1306_Spi(SPI &spi, PinName DC, PinName RST, PinName CS, uint8_t rawHieght = 32, uint8_t rawWidth = 128)
+	Adafruit_SSD1306_Spi(SWSPI &spi, PinName DC, PinName RST, PinName CS, uint8_t rawHieght = 32, uint8_t rawWidth = 128)
 	    : Adafruit_SSD1306(RST, rawHieght, rawWidth)
 	    , cs(CS,true)
 	    , dc(DC,false)
@@ -149,7 +150,7 @@
 	};
 
 	DigitalOut2 cs, dc;
-	SPI &mspi;
+	SWSPI &mspi;
 };
 
 /** This is the I2C SSD1306 display driver transport class