37 extern uint16_t ssd1306_color;
40 static uint8_t s_rotation = 0x00;
41 static uint8_t s_rgb_bit = 0b00001000;
43 static const PROGMEM uint8_t s_oled128x128_initData[] =
66 0xC0, CMD_ARG, 0x0A, CMD_ARG, 0x02,
68 0xC5, CMD_ARG, 0x50, CMD_ARG, 0x5B,
72 0x36, CMD_ARG, 0b10001100,
76 static const PROGMEM uint8_t s_oled128x160_initData[] =
88 0xE0, CMD_ARG, 0x3F, CMD_ARG, 0x25, CMD_ARG, 0x1C,
89 CMD_ARG, 0x1E, CMD_ARG, 0x20, CMD_ARG, 0x12,
90 CMD_ARG, 0x2A, CMD_ARG, 0x90, CMD_ARG, 0x24,
91 CMD_ARG, 0x11, CMD_ARG, 0x00, CMD_ARG, 0x00,
92 CMD_ARG, 0x00, CMD_ARG, 0x00, CMD_ARG, 0x00,
93 0xE1, CMD_ARG, 0x20, CMD_ARG, 0x20, CMD_ARG, 0x20,
94 CMD_ARG, 0x20, CMD_ARG, 0x05, CMD_ARG, 0x00,
95 CMD_ARG, 0x15, CMD_ARG, 0xA7, CMD_ARG, 0x3D,
96 CMD_ARG, 0x18, CMD_ARG, 0x25, CMD_ARG, 0x2A,
97 CMD_ARG, 0x2B, CMD_ARG, 0x2B, CMD_ARG, 0x3A,
98 0xB1, CMD_ARG, 0x08, CMD_ARG, 0x08,
100 0xC0, CMD_ARG, 0x0A, CMD_ARG, 0x02,
102 0xC5, CMD_ARG, 0x50, CMD_ARG, 0x5B,
106 0x36, CMD_ARG, 0b00100000,
110 static uint8_t s_column;
111 static uint8_t s_page;
113 static void il9163_setBlock(lcduint_t x, lcduint_t y, lcduint_t w)
126 + (s_rotation == 3 ? 32 : 0));
134 + (s_rotation == 2 ? 32: 0));
140 static void il9163_setBlock2(lcduint_t x, lcduint_t y, lcduint_t w)
151 + (s_rotation == 7 ? 32 : 0));
164 static void il9163_nextPage(
void)
170 static void il9163_nextPage2(
void)
192 s_rotation = mode ? 0x00 : 0x04;
195 static void il9163_sendPixels(uint8_t data)
197 for (uint8_t i=8; i>0; i--)
213 static void il9163_sendPixelsBuffer(
const uint8_t *buffer, uint16_t len)
217 il9163_sendPixels(*buffer);
222 static void il9163_sendPixel8(uint8_t data)
229 static void il9163_sendPixel16(uint16_t color)
240 s_rgb_bit = 0b00001000;
255 pinMode(rstPin, OUTPUT);
256 digitalWrite(rstPin, HIGH);
260 digitalWrite(rstPin, LOW);
262 digitalWrite(rstPin, HIGH);
273 if ((rotation^s_rotation) & 0x01)
279 s_rotation = (rotation & 0x03) | (s_rotation & 0x04);
288 ram_mode = 0b00000000;
291 ram_mode = 0b01000000;
294 ram_mode = 0b11100000;
297 ram_mode = 0b10000000;
300 ram_mode = 0b00000000;
303 ram_mode = 0b01100000;
306 ram_mode = 0b11000000;
309 ram_mode = 0b10100000;
322 static void st7735_setBlock(lcduint_t x, lcduint_t y, lcduint_t w)
348 static void st7735_setBlock2(lcduint_t x, lcduint_t y, lcduint_t w)
377 s_rgb_bit = 0b00000000;
void st7735_128x160_init(void)
Inits 128x160 RGB OLED display (based on st7735 controller).
void ssd1306_configureSpiDisplay(const uint8_t *config, uint8_t configSize)
Sends configuration being passed to lcd display spi controller.
void st7735_128x160_spi_init(int8_t rstPin, int8_t cesPin, int8_t dcPin)
Inits 128x160 RGB TFT display over spi (based on st7735 controller).
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(* 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 il9163_setRotation(uint8_t rotation)
Sets screen orientation (rotation)
void il9163_128x128_init(void)
Inits 128x128 RGB OLED display (based on il9163 controller).
void ssd1306_spiInit(int8_t cesPin, int8_t dcPin)
ssd1306_lcd_t ssd1306_lcd
ssd1306_interface_t ssd1306_intf
void il9163_128x128_spi_init(int8_t rstPin, int8_t cesPin, int8_t dcPin)
Inits 128x128 RGB TFT display over spi (based on il9163 controller).
void il9163_setMode(lcd_mode_t mode)
Sets GDRAM autoincrement mode.
void(* set_mode)(lcd_mode_t mode)
Sets library display mode for direct draw functions.