Revision 1:03129e57a003, committed 2016-09-22
- Comitter:
- sstaub
- Date:
- Thu Sep 22 11:28:11 2016 +0000
- Parent:
- 0:6a3d8b1e3d24
- Commit message:
- new library for EADOG displays from electronic assembly, only tested for EADOG132M
Changed in this revision
diff -r 6a3d8b1e3d24 -r 03129e57a003 EADOG.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/EADOG.cpp Thu Sep 22 11:28:11 2016 +0000
@@ -0,0 +1,473 @@
+/* mbed library for the mbed Lab Board 128*32 pixel LCD
+ * use ST7565R controller
+ * Copyright (c) 2016 Stefan Staub
+ * Released under the MIT License: http://mbed.org/license/mit
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "EADOG.h"
+#include "mbed.h"
+#include "stdio.h"
+#include "Small_7.h"
+
+EADOG::EADOG(PinName mosi, PinName sck, PinName reset, PinName a0, PinName cs, uint8_t type) : _spi(mosi, NC, sck), _reset(reset), _a0(a0), _cs(cs), _type(type), graphic_buffer() {
+ if (_type == DOGM132) {
+ width = 132;
+ height = 32;
+ graphic_buffer_size = 528;
+ graphic_buffer = new uint8_t [graphic_buffer_size];
+ }
+
+ if (_type == DOGM128 || _type == DOGL128) {
+ width = 128;
+ height = 64;
+ graphic_buffer_size = 1024;
+ graphic_buffer = new uint8_t [graphic_buffer_size];
+ }
+ init();
+ }
+
+static void inline swap(int &a, int &b) {
+ int c = a;
+ a = b;
+ b = c;
+ }
+
+void EADOG::display(uint8_t display) {
+ if (display == ON) { // display on
+ write_command(0xA4);
+ write_command(0xAF);
+ }
+ if (display == OFF) { // display off
+ write_command(0xAE);
+ }
+
+ if (display == SLEEP) {// display sleep
+ write_command(0xA5);
+ write_command(0xAE);
+ }
+ if(display == INVERT) { // invert display
+ write_command(0xA7);
+ }
+ if(display == DEFAULT) { // set to normal display
+ write_command(0xA6);
+ }
+ if (display == TOPVIEW) { // reverse orientation
+ write_command(0xA0); // ADC normal
+ write_command(0xC8); // reversed com31-com0
+ update(); // update necessary
+ }
+ if (display == BOTTOM) { // normal orientation
+ write_command(0xA1); // ADC reverse
+ write_command(0xC0); // normal com0-com31
+ update(); // update necessary
+ }
+ if (display == CONTRAST) {
+ if (_type == DOGM132) {
+ write_command(0x81); // set contrast to default for dogm 128
+ write_command(0x1F);
+ }
+ if (_type == DOGM128) {
+ write_command(0x81); // set contrast to default for dogm132
+ write_command(0x16);
+ }
+ if (_type == DOGL128) {
+ write_command(0x81); // set contrast to default for dogl132
+ write_command(0x10);
+ }
+ }
+ }
+
+void EADOG::display(uint8_t display, uint8_t value) {
+ if (display == CONTRAST) {
+ if (value < 64) {
+ write_command(0x81); // set contrast
+ write_command(value & 0x3F);
+ }
+ }
+ }
+
+// write command to lcd controller
+void EADOG::write_command(uint8_t command) {
+ _a0 = 0;
+ _cs = 0;
+ _spi.write(command);
+ _cs = 1;
+ }
+
+// write data to lcd controller
+void EADOG::write_data(uint8_t data) {
+ _a0 = 1;
+ _cs = 0;
+ _spi.write(data);
+ _cs = 1;
+ }
+
+// reset and init the lcd controller
+void EADOG::init() {
+ _spi.format(8, 3); // 8 bit spi mode 3
+ _spi.frequency(20000000); // 19,2 Mhz SPI clock
+
+ //DigitalOut _reset(A1);
+ _a0 = 0;
+ _cs = 1;
+ _reset = 0; // display reset
+ wait_us(50);
+ _reset = 1; // end reset
+ wait_ms(5);
+
+ // Start Initial Sequence
+ write_command(0x40); // display start line 0
+ write_command(0xA1); // ADC reverse
+ write_command(0xC0); // normal com0-com31
+ write_command(0xA6); // display normal
+ write_command(0xA2); // set bias 1/9 (duty 1/33)
+ write_command(0x2F); // booster, regulator and follower on
+ write_command(0xF8); // set internal booster to 3x/4x
+ write_command(0x00);
+ if (_type == DOGM132) {
+ write_command(0x23); // set contrast
+ write_command(0x81);
+ write_command(0x1F);
+ }
+ if (_type == DOGM128) {
+ write_command(0x27); // set contrast
+ write_command(0x81);
+ write_command(0x16);
+ }
+ if (_type == DOGL128) {
+ write_command(0x27); // set contrast
+ write_command(0x81);
+ write_command(0x10);
+ }
+ write_command(0xAC); // no indicator
+ write_command(0x00);
+ write_command(0xAF); // display on
+
+ // clear and update LCD
+ cls();
+ auto_update = 1; // switch on auto update
+ locate(0, 0);
+ font((unsigned char*)Small_7); // standard font
+ }
+
+// update lcd
+void EADOG::update() {
+ //page 0
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB0); // set page address 0
+ _a0 = 1;
+
+ for (int i = 0; i < width; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ // page 1
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB1); // set page address 1
+ _a0 = 1;
+
+ for (int i = width; i < width * 2; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ //page 2
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB2); // set page address 2
+ _a0 = 1;
+
+ for (int i = width * 2; i < width * 3; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ //page 3
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB3); // set page address 3
+ _a0 = 1;
+
+ for (int i = width * 3; i < width * 4; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ if (_type == DOGM128 || _type == DOGL128) {
+ //page 4
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB4); // set page address 3
+ _a0 = 1;
+
+ for (int i = width * 4; i < width * 5; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ //page 5
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB5); // set page address 3
+ _a0 = 1;
+
+ for (int i = width * 5; i < width * 6; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ //page 6
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB6); // set page address 3
+ _a0 = 1;
+
+ for (int i = width * 6; i < width *7; i++) {
+ write_data(graphic_buffer[i]);
+ }
+
+ //page 7
+ write_command(0x00); // set column low nibble 0
+ write_command(0x10); // set column hi nibble 0
+ write_command(0xB7); // set page address 3
+ _a0 = 1;
+
+ for (int i = width * 7; i < width *8; i++) {
+ write_data(graphic_buffer[i]);
+ }
+ }
+
+ _cs = 0;
+
+ }
+void EADOG::update(uint8_t mode) {
+ if (mode == MANUAL) auto_update = 0;
+ if (mode == AUTO) auto_update = 1;
+ }
+
+// clear screen
+void EADOG::cls() {
+ memset(graphic_buffer, 0x00, graphic_buffer_size); // clear display graphic_buffer
+ update();
+ }
+
+// set one pixel in graphic_buffer
+void EADOG::pixel(int x, int y, uint8_t color) {
+ if (x > width - 1 || y > height - 1 || x < 0 || y < 0) return;
+ if (color == 0) graphic_buffer[x + ((y / 8) * width)] &= ~(1 << (y % 8)); // erase pixel
+ else graphic_buffer[x + ((y / 8) * width)] |= (1 << (y % 8)); // set pixel
+ }
+
+void EADOG::point(int x, int y, uint8_t colour) {
+ pixel(x, y, colour);
+ if (auto_update) update();
+ }
+
+// This function uses Bresenham's algorithm to draw a straight line.
+void EADOG::line(int x0, int y0, int x1, int y1, uint8_t colour) {
+ int dx = abs(x1 - x0), sx = x0 < x1 ? 1 : -1;
+ int dy = -abs(y1 - y0), sy = y0 < y1 ? 1 : -1;
+ int err = dx + dy, e2; /* error value e_xy */
+
+ while(1) {
+ pixel(x0, y0, 1);
+ if (x0 == x1 && y0 == y1) break;
+ e2 = 2 * err;
+ if (e2 > dy) { err += dy; x0 += sx; } /* e_xy+e_x > 0 */
+ if (e2 < dx) { err += dx; y0 += sy; } /* e_xy+e_y < 0 */
+ }
+ if (auto_update) update();
+ }
+
+void EADOG::rectangle(int x0, int y0, int x1, int y1, uint8_t colour) {
+ uint8_t upd = auto_update;
+ auto_update = 0;
+ line(x0, y0, x1, y0, colour);
+ line(x0, y1, x1, y1, colour);
+ line(x0, y0, x0, y1, colour);
+ line(x1, y0, x1, y1, colour);
+ auto_update = upd;
+ if (auto_update) update();
+ }
+
+void EADOG::fillrect(int x0, int y0, int x1, int y1, uint8_t colour) {
+ if (x0 > x1) swap(x0, x1);
+ if (y0 > y1) swap(y0, y1);
+ for (int i = x0; i <= x1; i++) {
+ for (int j = y0; j <= y1; j++) {
+ pixel(i, j, colour);
+ }
+ }
+ if (auto_update) update();
+ }
+
+void EADOG::roundrect(int x0, int y0, int x1, int y1, int rnd, uint8_t colour) {
+ if (x0 > x1) swap(x0, x1);
+ if (y0 > y1) swap(y0, y1);
+ uint8_t upd = auto_update;
+ auto_update = 0;
+ int r = rnd;
+ int x = -r, y = 0, err = 2 - 2 * r;
+ line(x0 + rnd, y0, x1 - rnd, y0, colour);
+ line(x0 + rnd, y1, x1 - rnd, y1, colour);
+ line(x0, y0 + rnd, x0, y1 - rnd, colour);
+ line(x1, y0 + rnd, x1, y1 - rnd, colour);
+ do {
+ pixel(x1 - rnd + y, y0 + x + rnd, 1); // 1 I. quadrant
+ pixel(x1 - rnd - x, y1 + y - rnd, 1); // 2 IV. quadrant
+ pixel(x0 + rnd - y, y1 - rnd - x, 1); // 3 III. quadrant
+ pixel(x0 + rnd + x, y0 + rnd - y, 1); // 4 II. quadrant
+ r = err;
+ if (r <= y) err += ++y * 2 + 1;
+ if (r > x || err > y) err += ++x * 2 + 1;
+ } while (x < 0);
+ auto_update = upd;
+ if (auto_update) update();
+ }
+
+void EADOG::fillrrect(int x0, int y0, int x1, int y1, int rnd, uint8_t colour) {
+ if (x0 > x1) swap(x0, x1);
+ if (y0 > y1) swap(y0, y1);
+ uint8_t upd = auto_update;
+ auto_update = 0;
+ int r = rnd;
+ int x = -r, y = 0, err = 2 - 2 * r;
+ for (int i = x0; i <= x1; i++) {
+ for (int j = y0+rnd; j <= y1-rnd; j++) {
+ pixel(i, j, colour);
+ }
+ }
+ do {
+ line(x0 + rnd - y, y0 + rnd + x, x1 - rnd + y, y0 + rnd + x, 1);
+ line(x0 + rnd + x, y1 - rnd + y, x1 - rnd - x, y1 - rnd + y, 1);
+ r = err;
+ if (r <= y) err += ++y * 2 + 1;
+ if (r > x || err > y) err += ++x * 2 + 1;
+ } while (x < 0);
+ auto_update = upd;
+ if (auto_update) update();
+ }
+
+void EADOG::circle(int x0, int y0, int r, uint8_t colour) {
+ int x = -r, y = 0, err = 2 - 2 * r;
+ do {
+ pixel(x0 + y, y0 + x, 1); // 1 I. quadrant
+ pixel(x0 - x, y0 + y, 1); // 2 IV. quadrant
+ pixel(x0 - y, y0 - x, 1); // 3 III. quadrant
+ pixel(x0 + x, y0 - y, 1); // 4 II. quadrant
+ r = err;
+ if (r <= y) err += ++y * 2 + 1;
+ if (r > x || err > y) err += ++x * 2 + 1;
+ } while (x < 0);
+ if (auto_update) update();
+ }
+
+void EADOG::fillcircle(int x0, int y0, int r, uint8_t colour) {
+ uint8_t upd;
+ upd = auto_update;
+ auto_update = 0;
+ int x = -r, y = 0, err = 2 - 2 * r;
+ do {
+ line(x0 - y, y0 + x, x0 + y, y0 + x, 1);
+ line(x0 + x, y0 + y, x0 - x, y0 + y, 1);
+ r = err;
+ if (r <= y) err += ++y * 2 + 1;
+ if (r > x || err > y) err += ++x * 2 + 1;
+ } while (x < 0);
+ auto_update = upd;
+ if (auto_update) update();
+ }
+
+void EADOG::locate(uint8_t x, uint8_t y) {
+ char_x = x;
+ char_y = y;
+ }
+
+int EADOG::_putc(int value) {
+ if (value == '\n') { // new line
+ char_x = 0;
+ char_y = char_y + font_buffer[2];
+ if (char_y >= height - font_buffer[2]) {
+ char_y = 0;
+ }
+ }
+ else {
+ character(char_x, char_y, value);
+ if (auto_update) update();
+ }
+ return value;
+ }
+
+int EADOG::_getc() {
+ return -1;
+ }
+
+void EADOG::character(uint8_t x, uint8_t y, uint8_t c) {
+ unsigned int hor, vert, offset, bpl, b;
+ uint8_t *sign;
+ uint8_t z, w;
+
+ if ((c < 31) || (c > 127)) return; // test char range
+
+ // read font parameter from start of array
+ offset = font_buffer[0]; // bytes / char
+ hor = font_buffer[1]; // get hor size of font
+ vert = font_buffer[2]; // get vert size of font
+ bpl = font_buffer[3]; // bytes per line
+
+ if (char_x + hor > width) {
+ char_x = 0;
+ char_y = char_y + vert;
+ if (char_y >= height - font_buffer[2]) {
+ char_y = 0;
+ }
+ }
+
+ sign = &font_buffer[((c - 32) * offset) + 4]; // start of char bitmap
+ w = sign[0]; // width of actual char
+ // construct the char into the font_graphic_buffer
+ for (unsigned int j = 0; j < vert; j++) { // vert line
+ for (unsigned int i = 0; i < hor; i++) { // horz line
+ z = sign[bpl * i + ((j & 0xF8) >> 3) + 1];
+ b = 1 << (j & 0x07);
+ if (( z & b ) == 0x00) {
+ pixel(x+i, y+j, 0);
+ }
+ else {
+ pixel(x+i, y+j, 1);
+ }
+ }
+ }
+ char_x += w;
+ }
+
+
+void EADOG::font(uint8_t *f) {
+ font_buffer = f;
+ }
+
+void EADOG::bitmap(Bitmap bm, int x, int y) {
+ int b;
+ char d;
+
+ for (int v = 0; v < bm.ySize; v++) { // lines
+ for (int h = 0; h < bm.xSize; h++) { // pixel
+ if (h + x >= width) break;
+ if (v + y >= height) break;
+ d = bm.data[bm.byte_in_Line * v + ((h & 0xF8) >> 3)];
+ b = 0x80 >> (h & 0x07);
+ if ((d & b) == 0) {
+ pixel(x+h, y+v, 0);
+ }
+ else {
+ pixel(x+h, y+v, 1);
+ }
+ }
+ }
+ if (auto_update) update();
+ }
diff -r 6a3d8b1e3d24 -r 03129e57a003 EADOG.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/EADOG.h Thu Sep 22 11:28:11 2016 +0000
@@ -0,0 +1,384 @@
+/* mbed library for the EA DOGM128 (128x64), DOGM132 (132x32), DOGL128 (128x64) pixel LCD
+ * use ST7565R controller
+ * Copyright (c) 2016 Stefan Staub
+ * Released under the MIT License: http://mbed.org/license/mit
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#ifndef EADOG_H
+#define EADOG_H
+
+#include "mbed.h"
+
+/** display type
+ *
+ * @param DOGM128 128x64 2.3''
+ * @param DOGM132 132x32 2.1''
+ * @param DOGL128 128x64 2.8''
+ *
+ */
+enum {DOGM128, DOGM132, DOGL128};
+
+/** update modes
+ *
+ * @param AUTO default
+ * @param MANUELL
+ *
+ */
+enum {MANUAL, AUTO};
+
+/** display settings
+ *
+ * @param ON display on, default
+ * @param OFF display off
+ * @param SLEEP sets the display to sleep mode
+ * @param DEFAULT default
+ * @param INVERT inverts display
+ * @param BOTTOM default 0°
+ * @param TOPVIEW rotate the screento 180°
+ *
+ */
+enum {ON, OFF, SLEEP, DEFAULT, INVERT, BOTTOM, TOPVIEW, CONTRAST, RST};
+
+/** bitmap
+ *
+ */
+struct Bitmap {
+ int xSize;
+ int ySize;
+ int byte_in_Line;
+ char *data;
+ };
+
+/** Library for the EADOG LCD displays from electronic assembly
+ *
+ * Example for EA DOGM132x-5 with STM32F401RE Nucleo
+ * @code
+ * // display test for EA DOGM132x-5 with STM32F401RE Nucleo
+ * // sstaub(c)2016
+ *
+ * #include "mbed.h"
+ * #include "EADOG.h"
+ * #include "Small_7.h"
+ * #include "Fonts/ArialR12x14.h"
+ *
+ * // DOGM132x-5 Wide Range
+ * // Pins for STM32F401RE Nucleo
+ *
+ * // DOG Pin Purpose ST Pin
+ * // 40 CS PB_6(D10)
+ * // 39 Reset PC_7(D9)
+ * // 38 A0 PA_9(D8)
+ * // 37 SCK PA_5(D13, SCK)
+ * // 36 MOSI PA_7(D11, MOSI)
+ * // 35 VDD 3.3V
+ * // 34 VDD2 3.3V
+ * // 33 VSS GND
+ * // 32 VOUT 1uF -> GND
+ * // 31 CAP3P 1uF -> CAP1N
+ * // 30 CAP1N 1uF -> CAP1P
+ * // 29 CAP1P
+ * // 28 CAP2P 1uF -> CAP2N
+ * // 27 CAP2N
+ * // 26 VSS GND
+ * // 25 V4 1uF -> GND
+ * // 24 V3 1uF -> GND
+ * // 23 V2 1uF -> GND
+ * // 22 V1 1uF -> GND
+ * // 21 V0 1uF -> GND
+ *
+ *
+ * EADOG lcd(PA_7, PA_5, PC_7, PA_9, PB_6, DOGM132); // MOSI, SCK, Reset, A0, CS
+ *
+ * int main() {
+ * // create logo
+ * lcd.update(MANUAL);
+ * lcd.rectangle(0, 0, 131, 31, 1);
+ * lcd.fillrect(2, 2, 4, 4, 1);
+ * lcd.fillrect(2, 27, 4, 29, 1);
+ * lcd.fillrect(61, 2, 63, 4, 1);
+ * lcd.fillrect(61, 27, 63, 29, 1);
+ * lcd.line(65, 0, 65, 31, 1);
+ * lcd.circle(33, 15, 10, 1);
+ * lcd.circle(33, 15, 6, 1);
+ * lcd.fillcircle(33, 15, 3, 1);
+ * lcd.update();
+ * lcd.update(AUTO);
+ * // create description text
+ * lcd.locate(70, 1);
+ * lcd.font((unsigned char*)ArialR12x14);
+ * lcd.printf("mbed");
+ * lcd.locate(70, 13);
+ * lcd.font((unsigned char*)Small_7);
+ * lcd.printf("EA");
+ * lcd.locate(70, 22);
+ * lcd.printf("DOGM132x-5");
+ *
+ * wait(1);
+ * lcd.display(CONTRAST, 16); // contrast low
+ * wait(1);
+ * lcd.display(CONTRAST, 40); // contrast high
+ * wait(1);
+ * lcd.display(CONTRAST); // contrast default
+ * wait(1);
+ * lcd.display(OFF); // display off
+ * wait(1);
+ * lcd.display(ON); // display on
+ * wait(1);
+ * lcd.display(SLEEP); // display sleep
+ * wait(1);
+ * lcd.display(ON); // display wake up
+ *
+ * while(1) { // main loop
+ * lcd.display(INVERT); // display inverted
+ * lcd.display(BOTTOM); // display normal orientation
+ * wait(2);
+ * lcd.display(DEFAULT); // display
+ * lcd.display(TOPVIEW); // display rotated
+ * wait(2);
+ * }
+ * }
+ * @endcode
+ */
+class EADOG : public Stream {
+
+public:
+
+ /** create a EADOG object connected to SPI
+ *
+ * @param mosi pinname
+ * @param sck pinname
+ * @param reset pinname
+ * @param a0 pinname
+ * @param cs pinname
+ *
+ */
+ EADOG(PinName mosi, PinName sck, PinName reset, PinName a0, PinName cs, uint8_t type);
+
+ /** draw a pixel in buffer at x, y black or white
+ *
+ * @param x horizontal position
+ * @param y vertical position
+ * @param colour 1 set pixel, 0 erase pixel
+ * there is no update, it writes the pixel only in the buffer
+ */
+ void pixel(int x, int y, uint8_t colour);
+
+ /** draw a single point
+ *
+ * @param x horizontal position
+ * @param y vertical position
+ * @param colour 1 set pixel, 0 erase pixel
+ *
+ */
+ void point(int x, int y, uint8_t colour);
+
+ /** draw a 1 pixel line
+ *
+ * @param x0,y0 start point
+ * @param x1,y1 end point
+ * @param color 1 set pixel, 0 erase pixel
+ *
+ */
+ void line(int x0, int y0, int x1, int y1, uint8_t colour);
+
+ /** draw a rect
+ *
+ * @param x0,y0 top left corner
+ * @param x1,y1 down right corner
+ * @param color 1 set pixel, 0 erase pixel
+ *
+ */
+ void rectangle(int x0, int y0, int x1, int y1, uint8_t colour);
+
+ /** draw a filled rect
+ *
+ * @param x0,y0 top left corner
+ * @param x1,y1 down right corner
+ * @param color 1 set pixel, 0 erase pixel
+ *
+ */
+ void fillrect(int x0, int y0, int x1, int y1, uint8_t colour);
+
+ /** draw a rounded rect
+ *
+ * @param x0,y0 top left corner
+ * @param x1,y1 down right corner
+ * @param rnd radius of the rounding
+ * @param color 1 set pixel, 0 erase pixel
+ *
+ */
+ void roundrect(int x0, int y0, int x1, int y1, int rnd, uint8_t colour);
+
+ /** draw a filled rounded rect
+ *
+ * @param x0,y0 top left corner
+ * @param x1,y1 down right corner
+ * @param rnd radius of the rounding
+ * @param color 1 set pixel, 0 erase pixel
+ *
+ */
+ void fillrrect(int x0, int y0, int x1, int y1, int rnd, uint8_t colour);
+
+
+ /** draw a circle
+ *
+ * @param x0,y0 center
+ * @param r radius
+ * @param colour 1 set pixel, 0 erase pixel
+ *
+ */
+ void circle(int x, int y, int r, uint8_t colour);
+
+ /** draw a filled circle
+ *
+ * @param x0,y0 center
+ * @param r radius
+ * @param color 1 set pixel, 0 erase pixel
+ *
+ * use circle with different radius,
+ * can miss some pixel
+ *
+ */
+ void fillcircle(int x, int y, int r, uint8_t colour);
+
+ /** update copy display buffer to lcd
+ *
+ * @param AUTO set update mode to auto, default
+ * @param MANUELL the update function must manually set
+ * update() copy display buffer to lcd
+ */
+ void update();
+ void update(uint8_t mode);
+
+ /** display functions
+ *
+ * @param display ON switch display on, or wake up from sleep
+ * @param display OFF set display off
+ * @param display SLEEP set display off and to sleep mode
+ * @param display BOTTOM (default) set display orientation 0°
+ * @param display TOPVIEW draw display oriention to 180°
+ * @param display INVERT invert the pixels
+ * @param display DEFAULT normal pixel display
+ * @param display CONTRAST set display contrast to default
+ *
+ */
+ void display(uint8_t display);
+
+ /** display functions
+ *
+ * @param display CONTRAST set display contrast with value,
+ * @param value sets display contrast 0 - 63, default 31
+ *
+ */
+ void display(uint8_t display, uint8_t value);
+
+ /** clear the screen
+ *
+ */
+ void cls();
+
+ /** draw a character on given position out of the active font to the LCD
+ *
+ * @param x x-position of char (top left)
+ * @param y y-position
+ * @param c char to print
+ *
+ */
+ void character(uint8_t x, uint8_t y, uint8_t c);
+
+ /** set top left position of char/printf
+ *
+ * @param x x-position
+ * @param y y-position
+ *
+ */
+ void locate(uint8_t x, uint8_t y);
+
+ /** select the font to use
+ *
+ * @param f pointer to font array
+ *
+ * font array can created with GLCD Font Creator from http://www.mikroe.com
+ * you have to add 4 parameter at the beginning of the font array to use:
+ * - the number of byte / char
+ * - the vertial size in pixel
+ * - the horizontal size in pixel
+ * - the number of byte per vertical line
+ * you also have to change the array to char[]
+ * @code
+ * lcd.font((unsigned char*)Small_7);
+ * @endcode
+ */
+ void font(uint8_t *f);
+
+ /** print bitmap to buffer
+ *
+ * @param bm Bitmap in flash
+ * @param x x start
+ * @param y y start
+ *
+ */
+ void bitmap(Bitmap bm, int x, int y);
+
+ // declarations
+ SPI _spi;
+ DigitalOut _reset;
+ DigitalOut _a0;
+ DigitalOut _cs;
+
+protected:
+
+ /** stream class, put a char on the screen
+ *
+ * @param value char to print
+ * @returns printed char
+ *
+ */
+ virtual int _putc(int value);
+
+ /** stream class, dummy
+ *
+ */
+ virtual int _getc();
+
+ /** init the DOGM132 LCD controller
+ *
+ */
+ void init(); //Init the ST7565R LCD controller
+
+ /** write data to the LCD controller
+ *
+ * @param dat data written to LCD controller
+ *
+ */
+ void write_data(uint8_t data); // Write data to the LCD controller
+
+ /** Write a command the LCD controller
+ *
+ * @param cmd command to be written
+ *
+ */
+ void write_command(uint8_t command); // Write a command the LCD controller
+
+ // Variables
+ uint8_t *font_buffer;
+ uint8_t char_x;
+ uint8_t char_y;
+ uint8_t auto_update;
+ uint8_t width;
+ uint8_t height;
+ uint8_t _type;
+ uint8_t *graphic_buffer;
+ uint32_t graphic_buffer_size;
+
+ };
+
+#endif
diff -r 6a3d8b1e3d24 -r 03129e57a003 EADOGM132.lib
--- a/EADOGM132.lib Wed Mar 30 14:39:40 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://developer.mbed.org/users/sstaub/code/EADOGM132Test/#9aa5cbc0eaed
diff -r 6a3d8b1e3d24 -r 03129e57a003 Fonts.lib
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Fonts.lib Thu Sep 22 11:28:11 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/sstaub/code/Fonts/#148d0844b650
diff -r 6a3d8b1e3d24 -r 03129e57a003 Small_7.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Small_7.h Thu Sep 22 11:28:11 2016 +0000
@@ -0,0 +1,104 @@
+#ifndef small_7
+#define small_7
+
+const unsigned char Small_7[] = {
+ 19,9,9,2, // Length,horz,vert,byte/vert
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char
+ 0x02, 0x00, 0x00, 0x9E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char !
+ 0x04, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char "
+ 0x06, 0x00, 0x00, 0x50, 0x00, 0xF8, 0x00, 0x50, 0x00, 0xF8, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char #
+ 0x06, 0x00, 0x00, 0x8C, 0x00, 0x92, 0x00, 0xFE, 0x01, 0xA2, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char $
+ 0x07, 0x1E, 0x00, 0x92, 0x00, 0x5E, 0x00, 0x20, 0x00, 0xF8, 0x00, 0x94, 0x00, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char %
+ 0x07, 0x00, 0x00, 0x64, 0x00, 0x9A, 0x00, 0xAA, 0x00, 0xCC, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char &
+ 0x02, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char '
+ 0x03, 0x00, 0x00, 0x7C, 0x00, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char (
+ 0x03, 0x00, 0x00, 0x83, 0x01, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char )
+ 0x04, 0x00, 0x00, 0x30, 0x00, 0x78, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char *
+ 0x05, 0x10, 0x00, 0x10, 0x00, 0x7C, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char +
+ 0x02, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ,
+ 0x04, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char -
+ 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char .
+ 0x04, 0x00, 0x01, 0xE0, 0x00, 0x1C, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char /
+ 0x05, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 0
+ 0x05, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 1
+ 0x05, 0x00, 0x00, 0x84, 0x00, 0xC2, 0x00, 0xA2, 0x00, 0x9C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 2
+ 0x05, 0x00, 0x00, 0x82, 0x00, 0x92, 0x00, 0x92, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 3
+ 0x05, 0x00, 0x00, 0x38, 0x00, 0x2C, 0x00, 0x22, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 4
+ 0x05, 0x00, 0x00, 0x9E, 0x00, 0x92, 0x00, 0x92, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 5
+ 0x05, 0x00, 0x00, 0x7C, 0x00, 0x92, 0x00, 0x92, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 6
+ 0x05, 0x00, 0x00, 0x02, 0x00, 0xC2, 0x00, 0x32, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 7
+ 0x05, 0x00, 0x00, 0x6C, 0x00, 0x92, 0x00, 0x92, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 8
+ 0x05, 0x00, 0x00, 0x9C, 0x00, 0x92, 0x00, 0x92, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char 9
+ 0x02, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char :
+ 0x02, 0x00, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ;
+ 0x05, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char <
+ 0x05, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char =
+ 0x05, 0x00, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char >
+ 0x05, 0x00, 0x00, 0x02, 0x00, 0xB2, 0x00, 0x12, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ?
+ 0x09, 0x00, 0x00, 0xF8, 0x00, 0x84, 0x01, 0x72, 0x01, 0x4A, 0x01, 0x4A, 0x01, 0x7A, 0x01, 0x42, 0x00, 0x3C, 0x00, // Code for char @
+ 0x06, 0x00, 0x00, 0xF8, 0x00, 0x24, 0x00, 0x22, 0x00, 0x24, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char A
+ 0x06, 0x00, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char B
+ 0x06, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char C
+ 0x06, 0x00, 0x00, 0xFE, 0x00, 0x82, 0x00, 0x82, 0x00, 0xC6, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char D
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char E
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char F
+ 0x06, 0x00, 0x00, 0x7C, 0x00, 0xC6, 0x00, 0x82, 0x00, 0x92, 0x00, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char G
+ 0x06, 0x00, 0x00, 0xFE, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char H
+ 0x02, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char I
+ 0x04, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char J
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x10, 0x00, 0x2C, 0x00, 0xC2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char K
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char L
+ 0x08, 0x00, 0x00, 0xFE, 0x00, 0x06, 0x00, 0x18, 0x00, 0xE0, 0x00, 0x18, 0x00, 0x06, 0x00, 0xFE, 0x00, 0x00, 0x00, // Code for char M
+ 0x06, 0x00, 0x00, 0xFE, 0x00, 0x06, 0x00, 0x18, 0x00, 0x60, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char N
+ 0x06, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char O
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char P
+ 0x07, 0x00, 0x00, 0x7C, 0x00, 0x82, 0x00, 0x82, 0x00, 0xC2, 0x00, 0xFC, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // Code for char Q
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x12, 0x00, 0x12, 0x00, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char R
+ 0x05, 0x00, 0x00, 0xCC, 0x00, 0x92, 0x00, 0x92, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char S
+ 0x06, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0xFE, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char T
+ 0x06, 0x00, 0x00, 0x7E, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char U
+ 0x07, 0x00, 0x00, 0x06, 0x00, 0x3C, 0x00, 0xE0, 0x00, 0xE0, 0x00, 0x1C, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char V
+ 0x06, 0x00, 0x00, 0x1E, 0x00, 0xE0, 0x00, 0x3E, 0x00, 0xE0, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char W
+ 0x06, 0x00, 0x00, 0x82, 0x00, 0x64, 0x00, 0x38, 0x00, 0x6C, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char X
+ 0x06, 0x00, 0x00, 0x02, 0x00, 0x0C, 0x00, 0xF0, 0x00, 0x0C, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Y
+ 0x06, 0x00, 0x00, 0x82, 0x00, 0xE2, 0x00, 0x92, 0x00, 0x8E, 0x00, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char Z
+ 0x03, 0x00, 0x00, 0xFF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char [
+ 0x04, 0x01, 0x00, 0x0E, 0x00, 0x70, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char BackSlash
+ 0x02, 0x01, 0x01, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ]
+ 0x04, 0x00, 0x00, 0x18, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ^
+ 0x06, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char _
+ 0x03, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char `
+ 0x05, 0x00, 0x00, 0xE8, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char a
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char b
+ 0x05, 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char c
+ 0x05, 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0x88, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char d
+ 0x05, 0x00, 0x00, 0x70, 0x00, 0xA8, 0x00, 0xA8, 0x00, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char e
+ 0x04, 0x08, 0x00, 0xFE, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char f
+ 0x05, 0x00, 0x00, 0x30, 0x00, 0x48, 0x01, 0x48, 0x01, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char g
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char h
+ 0x02, 0x00, 0x00, 0xFA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char i
+ 0x02, 0x00, 0x01, 0xFA, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char j
+ 0x05, 0x00, 0x00, 0xFE, 0x00, 0x20, 0x00, 0x50, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char k
+ 0x02, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char l
+ 0x06, 0x00, 0x00, 0xF8, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char m
+ 0x05, 0x00, 0x00, 0xF8, 0x00, 0x08, 0x00, 0x08, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char n
+ 0x05, 0x00, 0x00, 0x70, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char o
+ 0x05, 0x00, 0x00, 0xF8, 0x01, 0x48, 0x00, 0x48, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char p
+ 0x05, 0x00, 0x00, 0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0xF8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char q
+ 0x04, 0x00, 0x00, 0xF8, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char r
+ 0x04, 0x00, 0x00, 0x98, 0x00, 0xA8, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char s
+ 0x04, 0x00, 0x00, 0x08, 0x00, 0xFC, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char t
+ 0x05, 0x00, 0x00, 0x78, 0x00, 0x80, 0x00, 0x80, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char u
+ 0x04, 0x00, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char v
+ 0x06, 0x00, 0x00, 0x78, 0x00, 0xC0, 0x00, 0x38, 0x00, 0xC0, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char w
+ 0x05, 0x00, 0x00, 0x88, 0x00, 0x70, 0x00, 0x70, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char x
+ 0x05, 0x00, 0x00, 0x38, 0x00, 0x40, 0x01, 0x40, 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char y
+ 0x05, 0x00, 0x00, 0xC8, 0x00, 0xE8, 0x00, 0xB8, 0x00, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char z
+ 0x04, 0x10, 0x00, 0x38, 0x00, 0xEF, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char {
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char |
+ 0x04, 0x01, 0x01, 0xC7, 0x01, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char }
+ 0x05, 0x0C, 0x00, 0x04, 0x00, 0x0C, 0x00, 0x08, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Code for char ~
+ 0x03, 0xFE, 0x01, 0x02, 0x01, 0xFE, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Code for char
+ };
+
+#endif
diff -r 6a3d8b1e3d24 -r 03129e57a003 main.cpp
--- a/main.cpp Wed Mar 30 14:39:40 2016 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-// display test for EA DOGM132x-5 with STM32F401RE Nucleo
-// sstaub(c)2016
-
-#include "mbed.h"
-#include "EADOGM132.h"
-#include "Small_7.h"
-#include "Fonts/ArialR12x14.h"
-
-/* DOGM132x-5 Wide Range
-Pins for STM32F401RE Nucleo
-
-DOG Pin Purpose ST Pin
-40 CS PB_6(D10)
-39 Reset PC_7(D9)
-38 A0 PA_9(D8)
-37 SCL PA_5(D13)
-36 MOSI PA_7(D11)
-35 VDD 3.3V
-34 VDD2 3.3V
-33 VSS GND
-32 VOUT 1uF -> GND
-31 CAP3P 1uF -> CAP1N
-30 CAP1N 1uF -> CAP1P
-29 CAP1P
-28 CAP2P 1uF -> CAP2N
-27 CAP2N
-26 VSS GND
-25 V4 1uF -> GND
-24 V3 1uF -> GND
-23 V2 1uF -> GND
-22 V1 1uF -> GND
-21 V0 1uF -> GND
-
-*/
-
-EADOGM132 lcd(PA_7, PA_5, PC_7, PA_9, PB_6); // MOSI, SCL, Reset, A0, CS
-
-int main() {
-
- lcd.rect(0, 0, 131, 31, 1);
- lcd.fillrect(2, 2, 4, 4, 1);
- lcd.fillrect(2, 27, 4, 29, 1);
- lcd.fillrect(61, 2, 63, 4, 1);
- lcd.fillrect(61, 27, 63, 29, 1);
- lcd.line(65, 0, 65, 31, 1);
- lcd.circle(33, 15, 10, 1);
- lcd.circle(33, 15, 6, 1);
- lcd.fillcircle(33, 15, 3, 1);
- lcd.locate(70, 1);
- lcd.set_font((unsigned char*)ArialR12x14);
- lcd.printf("mbed");
- lcd.locate(70, 13);
- lcd.set_font((unsigned char*)Small_7);
- lcd.printf("EA");
- lcd.locate(70, 22);
- lcd.printf("DOGM132x-5");
-
- wait(3);
-
- while(1) {
-
- lcd.invert(0);
- wait(3);
-
- lcd.invert(1);
- wait(3);
- }
- }