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.
Diff: u8glibARM/u8g_dev_ssd1306_128x64.c
- Revision:
- 1:0e75de2a5d21
- Parent:
- 0:d8f4c441e032
--- a/u8glibARM/u8g_dev_ssd1306_128x64.c Fri Jun 10 15:20:20 2016 +0000
+++ b/u8glibARM/u8g_dev_ssd1306_128x64.c Mon Jun 13 02:21:11 2016 +0000
@@ -35,11 +35,13 @@
*/
#include "u8g.h"
+#include "gpio_api.h"
#define WIDTH 128
#define HEIGHT 64
#define PAGE_HEIGHT 8
+//extern gpio_t g_LED;
/* init sequence adafruit 128x64 OLED (NOT TESTED) */
static const uint8_t u8g_dev_ssd1306_128x64_adafruit1_init_seq[] PROGMEM = {
U8G_ESC_CS(0), /* disable chip */
@@ -76,11 +78,12 @@
/* init sequence adafruit 128x64 OLED (NOT TESTED) */
static const uint8_t u8g_dev_ssd1306_128x64_adafruit2_init_seq[] PROGMEM = {
+ #if 0
U8G_ESC_CS(0), /* disable chip */
U8G_ESC_ADR(0), /* instruction mode */
U8G_ESC_RST(1), /* do reset low pulse with (1*16)+2 milliseconds */
U8G_ESC_CS(1), /* enable chip */
-
+#endif
0x0ae, /* display off, sleep mode */
0x0d5, 0x080, /* clock divide ratio (0x00=1) and oscillator frequency (0x8) */
0x0a8, 0x03f, /* */
@@ -103,9 +106,10 @@
0x0a4, /* output ram to display */
0x0a6, /* none inverted normal display mode */
0x0af, /* display on */
-
+#if 1
U8G_ESC_CS(0), /* disable chip */
U8G_ESC_END /* end of sequence */
+ #endif
};
/* init sequence adafruit 128x64 OLED (NOT TESTED), like adafruit3, but with page addressing mode */
@@ -215,6 +219,7 @@
uint8_t u8g_dev_ssd1306_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
{
+ //printf("msg = %d\r\n", msg);
switch(msg) {
case U8G_DEV_MSG_INIT:
u8g_InitCom(u8g, dev, U8G_SPI_CLK_CYCLE_300NS);
@@ -223,6 +228,7 @@
case U8G_DEV_MSG_STOP:
break;
case U8G_DEV_MSG_PAGE_NEXT: {
+ //printf("U8G_DEV_MSG_PAGE_NEXT\r\n");
u8g_pb_t *pb = (u8g_pb_t *)(dev->dev_mem);
u8g_WriteEscSeqP(u8g, dev, u8g_dev_ssd1306_128x64_data_start);
u8g_WriteByte(u8g, dev, 0x0b0 | pb->p.page); /* select current page (SSD1306) */
@@ -240,6 +246,7 @@
return 1;
}
return u8g_dev_pb8v1_base_fn(u8g, dev, msg, arg);
+ //return u8g_dev_pb8v2_base_fn(u8g, dev, msg, arg);
}
uint8_t u8g_dev_ssd1306_adafruit_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)