36 #define CMD_DELAY 0xFF 38 extern uint16_t ssd1306_color;
41 static uint8_t s_rotation = 0x00;
42 static uint8_t s_rgb_bit = 0b00001000;
44 static const PROGMEM uint8_t s_oled128x128_initData[] =
67 0xC0, CMD_ARG, 0x0A, CMD_ARG, 0x02,
69 0xC5, CMD_ARG, 0x50, CMD_ARG, 0x5B,
73 0x36, CMD_ARG, 0b10001100,
77 static const PROGMEM uint8_t s_oled128x160_initData[] =
85 0xB1, 0x03, 0x01, 0x2C, 0x2D,
86 0xB2, 0x03, 0x01, 0x2C, 0x2D,
91 0xB6, 0x02, 0x15, 0x02,
92 0xC0, 0x03, 0xA2, 0x02, 0x84,
94 0xC2, 0x02, 0x0A, 0x00,
95 0xC3, 0x02, 0x8A, 0x2A,
96 0xC4, 0x02, 0x8A, 0xEE,
101 0x36, 0x01, 0b00100000,
107 0x0F, 0x1A, 0x0F, 0x18,
108 0x2F, 0x28, 0x20, 0x22,
109 0x1F, 0x1B, 0x23, 0x37,
110 0x00, 0x07, 0x02, 0x10,
112 0x0F, 0x1B, 0x0F, 0x17,
113 0x33, 0x2C, 0x29, 0x2E,
114 0x30, 0x30, 0x39, 0x3F,
115 0x00, 0x07, 0x03, 0x10,
119 0x29, CMD_DELAY, 100,
123 static uint8_t s_column;
124 static uint8_t s_page;
126 static void il9163_setBlock(lcduint_t x, lcduint_t y, lcduint_t w)
139 + (s_rotation == 3 ? 32 : 0));
147 + (s_rotation == 2 ? 32: 0));
153 static void il9163_setBlock2(lcduint_t x, lcduint_t y, lcduint_t w)
164 + (s_rotation == 7 ? 32 : 0));
177 static void il9163_nextPage(
void)
183 static void il9163_nextPage2(
void)
205 s_rotation = mode ? 0x00 : 0x04;
208 static void il9163_sendPixels(uint8_t data)
210 for (uint8_t i=8; i>0; i--)
226 static void il9163_sendPixelsBuffer(
const uint8_t *buffer, uint16_t len)
230 il9163_sendPixels(*buffer);
235 static void il9163_sendPixel8(uint8_t data)
242 static void il9163_sendPixel16(uint16_t color)
253 s_rgb_bit = 0b00001000;
268 pinMode(rstPin, OUTPUT);
269 digitalWrite(rstPin, HIGH);
273 digitalWrite(rstPin, LOW);
275 digitalWrite(rstPin, HIGH);
286 if ((rotation^s_rotation) & 0x01)
292 s_rotation = (rotation & 0x03) | (s_rotation & 0x04);
301 ram_mode = 0b00000000;
304 ram_mode = 0b01000000;
307 ram_mode = 0b11100000;
310 ram_mode = 0b10000000;
313 ram_mode = 0b00000000;
316 ram_mode = 0b01100000;
319 ram_mode = 0b11000000;
322 ram_mode = 0b10100000;
335 static void st7735_setBlock(lcduint_t x, lcduint_t y, lcduint_t w)
361 static void st7735_setBlock2(lcduint_t x, lcduint_t y, lcduint_t w)
390 s_rgb_bit = 0b00000000;
void st7735_128x160_init(void)
Inits 128x160 RGB OLED display (based on st7735 controller).
void ssd1306_configureSpiDisplay2(const uint8_t *config, uint8_t configSize)
Sends configuration being passed to lcd display spi 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.