38 extern uint16_t ssd1306_color;
41 static const PROGMEM uint8_t s_oled128x128_initData[] =
47 SSD1351_UNLOCK, CMD_ARG, 0x12,
48 SSD1351_UNLOCK, CMD_ARG, 0xB1,
50 SSD1351_CLOCKDIV, CMD_ARG, 0xF1,
51 SSD1351_SETMULTIPLEX, CMD_ARG, 127,
52 SSD1351_SEGREMAP, CMD_ARG, 0B00110101,
53 SSD1351_SETSTARTLINE, CMD_ARG, 0x00,
54 SSD1351_SETDISPLAYOFFSET, CMD_ARG, 0x00,
55 SSD1351_SETGPIO, CMD_ARG, 0x00,
56 SSD1351_SETFUNCTION, CMD_ARG, 0x01,
57 SSD1351_SETPRECHARGE, CMD_ARG, 0x32,
58 SSD1351_VCOMH, CMD_ARG, 0x05,
59 SSD1351_PRECHARGELEVEL, CMD_ARG, 0x17,
60 SSD1351_NORMALDISPLAY,
61 SSD1351_CONTRAST, CMD_ARG, 0xC8,
64 SSD1351_MASTERCURRENT, CMD_ARG, 0x0F,
65 SSD1351_EXTVSL, CMD_ARG, 0xA0, CMD_ARG, 0xB5, CMD_ARG, 0x55,
66 SSD1351_PRECHARGESECOND, CMD_ARG, 0x01,
68 SSD1351_NORMALDISPLAY,
71 static uint8_t s_column;
72 static uint8_t s_page;
74 static void ssd1351_setBlock(lcduint_t x, lcduint_t y, lcduint_t w)
95 static void ssd1351_setBlock2(lcduint_t x, lcduint_t y, lcduint_t w)
114 static void ssd1351_nextPage(
void)
117 ssd1351_setBlock(s_column,s_page+1,0);
120 static void ssd1351_nextPage2(
void)
144 static void ssd1351_sendPixels(uint8_t data)
146 for (uint8_t i=8; i>0; i--)
162 static void ssd1351_sendPixelsBuffer(
const uint8_t *buffer, uint16_t len)
166 ssd1351_sendPixels(*buffer);
171 static void ssd1351_sendPixel8(uint8_t data)
178 static void ssd1351_sendPixel16(uint16_t color)
198 for( uint8_t i=0; i<
sizeof(s_oled128x128_initData); i++)
200 uint8_t data = pgm_read_byte(&s_oled128x128_initData[i]);
203 data = pgm_read_byte(&s_oled128x128_initData[++i]);
void ssd1351_setMode(lcd_mode_t mode)
Sets GDRAM autoincrement mode.
void(* send)(uint8_t data)
uint32_t s_ssd1306_spi_clock
void(* send_pixels16)(uint16_t data)
Sends RGB pixel encoded in 5-6-5 format to OLED driver. Sends RGB pixel encoded in 5-6-5 format to OL...
void(* set_block)(lcduint_t x, lcduint_t y, lcduint_t w)
Sets block in RAM of lcd display controller to write data to.
void ssd1351_128x128_init(void)
Inits 128x128 RGB OLED display (based on SSD1351 controller).
void(* send_pixels8)(uint8_t data)
Sends RGB pixel encoded in 3-3-2 format to OLED driver. Sends RGB pixel encoded in 3-3-2 format to OL...
void ssd1306_spiDataMode(uint8_t mode)
void(* send_pixels_buffer1)(const uint8_t *buffer, uint16_t len)
void ssd1306_resetController(int8_t rstPin, uint8_t delayMs)
Does hardware reset for oled controller.
void(* send_pixels1)(uint8_t data)
void ssd1306_spiInit(int8_t cesPin, int8_t dcPin)
ssd1306_lcd_t ssd1306_lcd
void ssd1351_128x128_spi_init(int8_t rstPin, int8_t cesPin, int8_t dcPin)
Inits 128x128 RGB OLED display over spi (based on SSD1351 controller).
ssd1306_interface_t ssd1306_intf
void(* set_mode)(lcd_mode_t mode)
Sets library display mode for direct draw functions.