Console Serial IO con display OLED e seriale asincrona

Dependencies:   mbed BufferedSerial AserialIOFuncLib SSD1306 TerminalPlusV2

Fork of SerialIO by Max Scordamaglia

Console Serial IO con display OLED e seriale asincrona

Files at this revision

API Documentation at this revision

Comitter:
MaxScorda
Date:
Sun Aug 16 23:05:12 2015 +0000
Parent:
9:9ad85b6bd9cf
Child:
11:b57dee0f344e
Commit message:
refase1

Changed in this revision

SSD1306.lib Show annotated file Show diff for this revision Revisions of this file
macroDisp.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SSD1306.lib	Sun Aug 16 23:05:12 2015 +0000
@@ -0,0 +1,1 @@
+SSD1306#108c1008ff37
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/macroDisp.h	Sun Aug 16 23:05:12 2015 +0000
@@ -0,0 +1,85 @@
+//Oled
+#include "ssd1306.h"
+#include "standard_font.h"
+#include "bold_font.h"
+
+/* definitions for ST Nucleo L152RE  */
+#define CSEL  PB_6  // CS  D10
+#define RST   PC_7  //     D9 rst pin9
+#define DCMD  PA_9  // DC  D8 dc pin8
+#define CLK   PA_5  // CLK D13 d0 pin13
+#define DATA  PA_7  // MOSI D11 d1 pin11
+
+
+SSD1306 oled(CSEL, RST, DCMD, CLK, DATA);   // STM32 Nucleo
+
+
+static const unsigned char  oldlogo16_glcd_bmp[] = {
+    0x00, 0xc0, // B00000000, B11000000,
+    0x01, 0xc0, // B00000001, B11000000,
+    0x01, 0xc0, // B00000001, B11000000,
+    0x03, 0xe0, // B00000011, B11100000,
+    0xf3, 0xe0, // B11110011, B11100000,
+    0xfe, 0xf8, // B11111110, B11111000,
+    0x7e, 0xff, // B01111110, B11111111,
+    0x33, 0x9f, // B00110011, B10011111,
+    0x1f, 0xfc, // B00011111, B11111100,
+    0x0d, 0x70, // B00001101, B01110000,
+    0x1b, 0xa0, // B00011011, B10100000,
+    0x3f, 0xe0, // B00111111, B11100000,
+    0x3f, 0xf0, // B00111111, B11110000,
+    0x7c, 0xf0, // B01111100, B11110000,
+    0x70, 0x70, // B01110000, B01110000,
+    0x00, 0x30
+}; // B00000000, B00110000 };
+
+static const unsigned char  dog16_glcd_bmp[] = {
+    0x18, 0x18, // B00000000, B11000000,
+    0x26, 0x64, // B00000001, B11000000,
+    0x42, 0x42, // B00000001, B11000000,
+    0x41, 0x82, // B00000011, B11100000,
+    0x40, 0x2, // B11110011, B11100000,
+    0x80, 0x1 , // B11111110, B11111000,
+    0x8C, 0x31, // B01111110, B11111111,
+    0x8C, 0x31, // B00110011, B10011111,
+    0x40, 0x2 , // B00011111, B11111100,
+    0x41, 0x82, // B00001101, B01110000,
+    0x21, 0x84, // B00011011, B10100000,
+    0x10, 0x8 , // B00111111, B11100000,
+    0x13, 0xC8, // B00111111, B11110000,
+    0x8 , 0x10, // B01111100, B11110000,
+    0x4, 0x20, // B01110000, B01110000,
+    0x3 , 0xC0
+};
+
+static const unsigned char logo16_glcd_bmp[] = {
+    0x1 , 0x80, // B00000000, B11000000,
+    0x1 , 0xC0, // B00000001, B11000000,
+    0x1 , 0xE0, // B00000001, B11000000,
+    0x1 , 0xB0, // B00000011, B11100000,
+    0x1 , 0x98, // B11110011, B11100000,
+    0x1 , 0x8C, // B11111110, B11111000,
+    0x1 , 0x86, // B01111110, B11111111,
+    0xFF, 0x83, // B00110011, B10011111,
+    0xFF, 0x8F, // B00011111, B11111100,
+    0x60, 0x10, // B00001101, B01110000,
+    0x30, 0x20, // B00011011, B10100000,
+    0x18, 0x4F, // B00111111, B11100000,
+    0xC , 0xF2, // B00111111, B11110000,
+    0x6 , 0x4 , // B01111100, B11110000,
+    0x3,  0x8 , // B01110000, B01110000,
+    0x1 , 0xF0
+};
+//---------- oled -----------------------
+
+bool initDisp(int disptype)
+{
+    bool ret=true;
+    switch (disptype) {
+        case 0: //oled
+            break;
+        case 1: //lcd
+            break;
+    }
+    return ret;
+}
--- a/main.cpp	Sat Jun 27 21:19:58 2015 +0000
+++ b/main.cpp	Sun Aug 16 23:05:12 2015 +0000
@@ -4,6 +4,7 @@
 
 
 
+
 //init standard
 InterruptIn mybutton(USER_BUTTON);
 Serial pc(SERIAL_TX, SERIAL_RX); //Apertura della seriale 2
@@ -20,10 +21,6 @@
 
 #include "Functions.h"
 
-
-
-//-------------- fine funzioni
-
 int main()
 {
     char c; // variabile che contiene il carattere appena ricevuto
@@ -52,8 +49,7 @@
             if (i>0) {
                 ardser.printf("\ncmd Ready\n\r");
                 parser(buffer);
-            }
-            else sc.commitScreen();
+            } else sc.commitScreen();
             i=0; //azzera la posizione del puntatore del buffer pronto per la ricezione di una nuova stringa
 
         }