hadif azli
/
TEST123
BLYNK TEST
Diff: U8glib.h
- Revision:
- 1:0e75de2a5d21
- Parent:
- 0:d8f4c441e032
- Child:
- 2:6cd3b0947188
--- a/U8glib.h Fri Jun 10 15:20:20 2016 +0000 +++ b/U8glib.h Mon Jun 13 02:21:11 2016 +0000 @@ -37,11 +37,12 @@ #ifndef _CPP_U8GLIB #define _CPP_U8GLIB - +#include "mbed.h" #include <Printit.h> #include "u8g.h" - +extern void log(char *); +extern Serial pc; class U8GLIB : public Print { private: @@ -81,6 +82,9 @@ } U8GLIB(u8g_dev_t *dev, u8g_com_fnptr com_fn) { prepare(); + //log("hehe...u8g = %x", &u8g); + //pc.printf("hehe...u8g = 0x%x, dev = 0x%x, com_fn = 0x%x\r\n", &u8g, dev, com_fn); + log("hehe..."); u8g_InitComFn(&u8g, dev, com_fn); } U8GLIB(u8g_dev_t *dev, uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset) { @@ -101,6 +105,11 @@ initRW8Bit(dev, d0, d1, d2, d3, d4, d5, d6, d7, cs, a0, wr, rd, reset); } + void init_u8g(void) { + log("Enter init_u8g()"); + u8g_InitComFn(&u8g, &u8g_dev_ssd1306_microduino_128x64_i2c, u8g_com_lpc824_ssd_i2c_fn); + //u8g_dev_ssd1306_microduino_128x64_i2c, u8g_com_lpc824_ssd_i2c_fn + } uint8_t begin(void) { is_begin = 1; return u8g_Begin(&u8g); @@ -1007,14 +1016,19 @@ { public: U8GLIB_SSD1306_MICRODUINO_128X64(uint8_t sck, uint8_t mosi, uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_ssd1306_microduino_128x64_sw_spi, (u8g_com_fnptr)NULL) + : U8GLIB(&u8g_dev_ssd1306_microduino_128x64_sw_spi, (u8g_com_fnptr)u8g_com_lpc824_ssd_i2c_fn) { } U8GLIB_SSD1306_MICRODUINO_128X64(uint8_t cs, uint8_t a0, uint8_t reset = U8G_PIN_NONE) - : U8GLIB(&u8g_dev_ssd1306_microduino_128x64_hw_spi, (u8g_com_fnptr)NULL) + : U8GLIB(&u8g_dev_ssd1306_microduino_128x64_hw_spi, (u8g_com_fnptr)u8g_com_lpc824_ssd_i2c_fn) { } U8GLIB_SSD1306_MICRODUINO_128X64(uint8_t options = U8G_I2C_OPT_NONE) - : U8GLIB(&u8g_dev_ssd1306_microduino_128x64_i2c, (u8g_com_fnptr)NULL) + : U8GLIB(&u8g_dev_ssd1306_microduino_128x64_i2c, u8g_com_lpc824_ssd_i2c_fn) { } + #if 0 + U8GLIB_SSD1306_MICRODUINO_128X64(void) + : U8GLIB() + { } + #endif }; class U8GLIB_SSD1306_ADAFRUIT_128X64 : public U8GLIB