35 extern uint16_t ssd1306_color;
37 static const PROGMEM uint8_t s_oled96x64_initData[] =
44 SSD1331_SEGREMAP, 0x00 | 0x20 | 0x10 | 0x02 | 0x01,
45 SSD1331_SETSTARTLINE, 0x00,
46 SSD1331_SETDISPLAYOFFSET, 0x00,
47 SSD1331_NORMALDISPLAY,
48 SSD1331_SETMULTIPLEX, 63,
49 SSD1331_SETMASTER, 0x8E,
50 SSD1331_POWERMODE, 0x0B,
51 SSD1331_SETPRECHARGE, 0x31,
52 SSD1331_CLOCKDIV, 0xF0,
53 SSD1331_PRECHARGEA, 0x64,
54 SSD1331_PRECHARGEB, 0x78,
55 SSD1331_PRECHARGELEVEL, 0x3A,
57 SSD1331_MASTERCURRENT, 0x09,
58 SSD1331_CONTRASTA, 0x91,
59 SSD1331_CONTRASTB, 0x50,
60 SSD1331_CONTRASTC, 0x7D,
64 static uint8_t s_rotation = 0x04;
69 (s_rotation & 1) ? SSD1331_ROWADDR: SSD1331_COLUMNADDR,
70 (s_rotation & 1) ? SSD1331_COLUMNADDR: SSD1331_ROWADDR );
77 (s_rotation & 1) ? SSD1331_ROWADDR: SSD1331_COLUMNADDR,
78 (s_rotation & 1) ? SSD1331_COLUMNADDR: SSD1331_ROWADDR );
103 if ((rotation^s_rotation) & 0x01)
109 s_rotation = (rotation & 0x03) | (s_rotation & 0x04);
117 ram_mode = 0b00110010;
120 ram_mode = 0b00110001;
123 ram_mode = 0b00100000;
126 ram_mode = 0b00100011;
130 ram_mode = 0b00110011;
133 ram_mode = 0b00110000;
136 ram_mode = 0b00100001;
139 ram_mode = 0b00100010;
142 ram_mode = 0b00100000;
161 for( uint8_t i=0; i<
sizeof(s_oled96x64_initData); i++)
192 void ssd1331_copyBlock(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t newLeft, uint8_t newTop)
#define CONTROLLER_NATIVE_SPI_BLOCK_8BIT_CMDS(column_cmd, row_cmd)
void(* send)(uint8_t data)
#define SSD1306_COMPAT_SEND_PIXELS_RGB8_CMDS()
void ssd1331_setMode(lcd_mode_t mode)
Sets GDRAM autoincrement mode.
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 ssd1331_drawLine(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint16_t color)
void ssd1306_spiInit(int8_t cesPin, int8_t dcPin)
ssd1306_lcd_t ssd1306_lcd
void ssd1331_copyBlock(uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t newLeft, uint8_t newTop)
ssd1306_interface_t ssd1306_intf
#define SSD1306_COMPAT_SPI_BLOCK_8BIT_CMDS(column_cmd, row_cmd)
void ssd1306_sendCommand(uint8_t command)
void ssd1331_setRotation(uint8_t rotation)
Sets screen orientation (rotation)
void ssd1331_96x64_spi_init(int8_t rstPin, int8_t cesPin, int8_t dcPin)
Inits 96x64 RGB OLED display over spi (based on SSD1331 controller).
void(* set_mode)(lcd_mode_t mode)
Sets library display mode for direct draw functions.
void ssd1331_96x64_init(void)
Inits 96x64 RGB OLED display (based on SSD1331 controller).