#define HEIGHT 65 #define PAGE_HEIGHT 8 static const uint8_t u8g_dev_pcf8812_init_seq[] PROGMEM = { 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 */ 0x021, /* activate chip (PD=0), horizontal increment (V=0), enter extended command set (H=1) */ 0x006, /* temp. control: b10 = 2 */ 0x013, /* bias system 1:48 */ 0x080 | 0x040, /* medium Vop */ 0x020, /* activate chip (PD=0), horizontal increment (V=0), enter normal command set (H=0) */ 0x00c, /* display on, normal operation */ U8G_ESC_DLY(100), /* delay 100 ms */ 0x020, /* activate chip (PD=0), horizontal increment (V=0), enter normal command set (H=0) */ 0x00d, /* display on, invert */ U8G_ESC_DLY(100), /* delay 100 ms */ U8G_ESC_DLY(100), /* delay 100 ms */ 0x020, /* activate chip (PD=0), horizontal increment (V=0), enter normal command set (H=0) */ 0x00c, /* display on, normal */ U8G_ESC_DLY(100), /* delay 100 ms */ U8G_ESC_CS(0), /* disable chip */ U8G_ESC_END /* end of sequence */ }; uint8_t u8g_dev_pcf8812_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { switch(msg) {
*/ #include "u8g.h" #define WIDTH 128 #define HEIGHT 64 #define PAGE_HEIGHT 8 /* init sequence from https://github.com/adafruit/ST7565-LCD/blob/master/ST7565/ST7565.cpp */ static const uint8_t u8g_dev_st7920_128x64_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_ADR(0), /* instruction mode */ U8G_ESC_RST(15), /* do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/ U8G_ESC_DLY(100), /* 8 Dez 2012: additional delay 100 ms because of reset*/ U8G_ESC_CS(1), /* enable chip */ U8G_ESC_DLY(50), /* delay 50 ms */ 0x038, /* 8 Bit interface (DL=1), basic instruction set (RE=0) */ 0x00c, /* display on, cursor & blink off; 0x08: all off */ 0x006, /* Entry mode: Cursor move to right ,DDRAM address counter (AC) plus 1, no shift */ 0x002, /* disable scroll, enable CGRAM adress */ 0x001, /* clear RAM, needs 1.6 ms */ U8G_ESC_DLY(100), /* delay 100 ms */ U8G_ESC_CS(0), /* disable chip */ U8G_ESC_END /* end of sequence */ }; uint8_t u8g_dev_st7920_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg)
/* code ideas: https://github.com/vsergeev/embedded-drivers/tree/master/avr-lc7981 data sheets: http://www.lcd-module.de/eng/pdf/zubehoer/lc7981.pdf http://www.lcd-module.de/pdf/grafik/w160-6.pdf */ static const uint8_t u8g_dev_lc7981_160x80_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_ADR(1), /* instruction mode */ U8G_ESC_RST(15), /* do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/ U8G_ESC_CS(1), /* enable chip */ U8G_ESC_DLY(50), /* delay 50 ms */ U8G_ESC_ADR(1), /* instruction mode */ 0x000, /* mode register */ U8G_ESC_ADR(0), /* data mode */ 0x032, /* display on (bit 5), master mode on (bit 4), graphics mode on (bit 1)*/ U8G_ESC_ADR(1), /* instruction mode */ 0x001, /* character/bits per pixel pitch */ U8G_ESC_ADR(0), /* data mode */ 0x007, /* 8 bits per pixel */ U8G_ESC_ADR(1), /* instruction mode */ 0x002, /* number of chars/byte width of the screen */ U8G_ESC_ADR(0), /* data mode */
0xfd,0x12, /*Command Lock */ 0xae, /*Set Display Off */ 0xd5,0xa0, /*set Display Clock Divide Ratio/Oscillator Frequency */ 0xa8,0x3f, /*Set Multiplex Ratio */ 0x3d,0x00, /*Set Display Offset*/ 0x40, /*Set Display Start Line*/ 0xa1, /*Set Segment Re-Map*/ 0xc8, /*Set COM Output Scan Direction*/ 0xda,0x12, /*Set COM Pins Hardware Configuration*/ 0x81,0xdf, /*Set Current Control */ 0xd9,0x82, /*Set Pre-Charge Period */ 0xdb,0x34, /*Set VCOMH Deselect Level */ 0xa4, /*Set Entire Display On/Off */ 0xa6, /*Set Normal/Inverse Display*/ U8G_ESC_VCC(1), /*Power up VCC & Stabilized */ U8G_ESC_DLY(50), 0xaf, /*Set Display On */ U8G_ESC_DLY(50), U8G_ESC_CS(0), /* disable chip */ U8G_ESC_END /* end of sequence */ }; /* select one init sequence here */ #define u8g_dev_ssd1309_128x64_init_seq u8g_dev_ssd1309_128x64_init_seq static const uint8_t u8g_dev_ssd1309_128x64_data_start[] PROGMEM = { U8G_ESC_ADR(0), /* instruction mode */ U8G_ESC_CS(1), /* enable chip */ 0x010, /* set upper 4 bit of the col adr to 0 */ 0x000, /* set lower 4 bit of the col adr to 4 */
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "u8g.h" /* define width as 64, so that it is a multiple of 8 */ #define WIDTH 64 #define HEIGHT 32 #define PAGE_HEIGHT 8 static const uint8_t u8g_dev_ld7032_60x32_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_ADR(0), /* instruction mode */ U8G_ESC_DLY(1), /* delay 1 ms */ U8G_ESC_RST(1), /* do reset low pulse with (1*16)+2 milliseconds */ U8G_ESC_CS(1), /* enable chip */ U8G_ESC_ADR(0), /* instruction mode */ 0x002, /* Dot Matrix Display ON/OFF */ U8G_ESC_ADR(1), /* data mode */ 0x001, /* ON */ U8G_ESC_ADR(0), /* instruction mode */ 0x014, /* Dot Matrix Display Stand-by ON/OFF */ U8G_ESC_ADR(1), /* data mode */ 0x000, /* ON */ U8G_ESC_ADR(0), /* instruction mode */
*/ #include "u8g.h" #define WIDTH 128 #define HEIGHT 64 #define PAGE_HEIGHT 8 static const uint8_t u8g_dev_ks0108_128x64_init_seq[] PROGMEM = { 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 1 */ 0x03f, /* display on */ 0x0c0, /* start at line 0 */ U8G_ESC_DLY(20), /* delay 20 ms */ U8G_ESC_CS(2), /* enable chip 2 */ 0x03f, /* display on */ 0x0c0, /* start at line 0 */ U8G_ESC_DLY(20), /* delay 20 ms */ U8G_ESC_CS(0), /* disable all chips */ U8G_ESC_END /* end of sequence */ }; uint8_t u8g_dev_ks0108_128x64_fn(u8g_t *u8g, u8g_dev_t *dev, uint8_t msg, void *arg) { switch(msg) { case U8G_DEV_MSG_INIT:
#include "u8g.h" #define CMD 0 #define DAT 1 #define WIDTH 240 #define HEIGHT 160 #define PAGE_HEIGHT 8 static const uint8_t u8g_dev_st75256_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_RST(1), /* hardware reset. Min 1 ms */ U8G_ESC_DLY(1), /* Delay max 1 ms */ U8G_ESC_CS(1), /* enable chip */ U8G_ESC_ADR(CMD), 0x30, // EXT=0 0x94, // Sleep Out 0x31, // EXT=1 // 0xD7, // Autoread disable // U8G_ESC_ADR(DAT), // 0x9F, // U8G_ESC_ADR(CMD), 0x32, // Analog set U8G_ESC_ADR(DAT), 0x00, /* OSC Frequency adjustment */ 0x01, /* Booster Efficiency =Level 1 */
History: Initial version 20 May 2013 [email protected] indexed device 22 May 2013 [email protected] */ #include "u8g.h" #define WIDTH 128 #define HEIGHT 128 #define PAGE_HEIGHT 8 static const uint8_t u8g_dev_ssd1351_128x128_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_DLY(50), 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 */ U8G_ESC_DLY(50), 0xfd, /* Command Lock */ U8G_ESC_ADR(1), 0x12, U8G_ESC_ADR(0), /* instruction mode */ 0xfd, U8G_ESC_ADR(1), 0xb1, /* Command Lock */ U8G_ESC_ADR(0), /* instruction mode */
/* reference board for this device: http://iteadstudio.com/store/index.php?main_page=product_info&cPath=57_58&products_id=55 documentation: http://iteadstudio.com/Downloadfile/ITDB02_material.rar datasheet http://www.newhavendisplay.com/app_notes/ILI9325D.pdf other libs http://henningkarlsen.com/electronics/library.php init sequence http://code.google.com/p/itdb02/, ITDB02.cpp, iteadstudio.com */ static const uint8_t u8g_dev_ili9325d_320x240_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_DLY(50), /* delay 50 ms */ U8G_ESC_RST(15), /* do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/ U8G_ESC_DLY(50), /* delay 50 ms */ U8G_ESC_RST(15), /* do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/ U8G_ESC_DLY(50), /* delay 50 ms */ U8G_ESC_CS(1), /* enable chip */ U8G_ESC_DLY(50), /* delay 50 ms */ //U8G_ESC_ADR(0), 0x000, 0x0E5, /* only used for none D version: set SRAM internal timing */ //U8G_ESC_ADR(1), 0x078, 0x0f0, U8G_ESC_ADR(0), 0x000, 0x001, /* Driver Output Control, bits 8 & 10 */ U8G_ESC_ADR(1), 0x001, 0x000, U8G_ESC_ADR(0), 0x000, 0x002, /* LCD Driving Wave Control, bit 9: Set line inversion */ U8G_ESC_ADR(1), 0x002, 0x000, /* ITDB02 none D verion: 0x007, 0x000 */ U8G_ESC_ADR(0), 0x000, 0x003, /* Entry Mode, GRAM write direction and BGR=1 */
#ifdef FIRST_VERSION /* see also: read.pudn.com/downloads115/sourcecode/app/484503/LCM_Display.c__.htm http://en.pudn.com/downloads115/sourcecode/app/detail484503_en.html */ static const uint8_t u8g_dev_st7687_c144mvgd_init_seq[] PROGMEM = { U8G_ESC_CS(0), /* disable chip */ U8G_ESC_ADR(0), /* instruction mode */ U8G_ESC_CS(1), /* enable chip */ U8G_ESC_RST(15), /* do reset low pulse with (15*16)+2 milliseconds (=maximum delay)*/ 0x001, /* A0=0, SW reset */ U8G_ESC_DLY(200), /* delay 200 ms */ 0x0d7, /* EEPROM data auto re-load control */ U8G_ESC_ADR(1), /* data mode */ 0x09f, /* ARD = 1 */ U8G_ESC_ADR(0), /* instruction mode */ U8G_ESC_DLY(100), /* delay 100 ms */ 0x0e0, /* EEPROM control in */ U8G_ESC_ADR(1), /* data mode */ 0x000, /* */ U8G_ESC_ADR(0), /* instruction mode */ U8G_ESC_DLY(100), /* delay 100 ms */ #ifdef NOT_REQUIRED 0x0fa, /* EEPROM function selection 8.1.66 */