Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:ae4fe66e9c0e, committed 2017-07-03
- Comitter:
- kkado
- Date:
- Mon Jul 03 08:02:50 2017 +0000
- Parent:
- 0:5115e0080bd5
- Child:
- 2:fb159c293541
- Commit message:
- Last state before adding documentation
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BurstSPI.lib Mon Jul 03 08:02:50 2017 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/EricWieser/code/BurstSPI/#98658a80a698
--- a/SSD1351.cpp Sat Jun 17 09:01:26 2017 +0000
+++ b/SSD1351.cpp Mon Jul 03 08:02:50 2017 +0000
@@ -13,12 +13,17 @@
0x0AE8, 0x0AB2, 0x13C8, 0x0F3C, 0x5D24, 0x02D6, 0x02F4, 0x02FE, 0x02AA, 0x159C, 0x1DEE, 0x6A26, 0x4824, 0x6A26, 0x7800, 0xFFFE
};
-//Constructor
+//Constructors
SSD1351::SSD1351(PinName mosi_pin, PinName sclk_pin, PinName dc_pin, PinName cs_pin, PinName rst_pin)
:cs(cs_pin), dc(dc_pin), rst(rst_pin), spi(mosi_pin, NC, sclk_pin)
{
begin();
}
+SSD1351::SSD1351()
+ :cs(OLED_CS), dc(OLED_DC), rst(OLED_RST), spi(OLED_MOSI, NC, OLED_SCLK)
+{
+ begin();
+}
//Set the buffer pointer
void SSD1351::setBuf(uint8_t* _buf){
--- a/SSD1351.h Sat Jun 17 09:01:26 2017 +0000
+++ b/SSD1351.h Mon Jul 03 08:02:50 2017 +0000
@@ -4,6 +4,14 @@
#include "mbed.h"
#include "BurstSPI.h"
+//Pinouts for OLED SPI interface
+#define OLED_MOSI PA_7
+#define OLED_SCLK PA_5
+#define OLED_CS PA_6
+#define OLED_DC PC_5
+#define OLED_RST PA_4
+
+//SSD1351 Regs
#define SSD1351_CMD_SETCOLUMN 0x15
#define SSD1351_CMD_SETROW 0x75
#define SSD1351_CMD_WRITERAM 0x5C
@@ -39,6 +47,7 @@
class SSD1351{
public:
SSD1351(PinName mosi_pin, PinName sclk_pin, PinName dc_pin, PinName cs_pin, PinName rst_pin);
+ SSD1351();
void begin();
//void fillRect(uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint16_t fillcolor);