Skip to content

Commit

Permalink
Update source file for SSD1306B display
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-77 committed Jun 1, 2024
1 parent 388532e commit d47482c
Showing 1 changed file with 55 additions and 52 deletions.
107 changes: 55 additions & 52 deletions src/v2/lcd/ssd1306b/lcd_ssd1306b.inl
Original file line number Diff line number Diff line change
Expand Up @@ -158,25 +158,26 @@ template <class I> void DisplaySSD1306B<I>::end()

static const PROGMEM uint8_t s_SSD1306B_lcd64x32_initData[] = {
#ifdef SDL_EMULATION
SDL_LCD_SSD1306, 0x00,
SDL_LCD_SSD1306B, 0x00,
0x00, 0x00,
#endif
0xAE, 0x00, // display off
0xD5, 0x01, 0x80, // Clock div
0xA8, 0x01, 31, // Set multiplex
0xD3, 0x01, 0x00, // --no offset
0x40, 0x00, // Set display offset
0x8D, 0x01, 0x14, // Set charge pump
0xA0| 0x01, 0x00, // Reverse mapping
0xC8, 0x00, // Decrement
0xDA, 0x01, 0x02, // Set com pins
0x81, 0x01, 0x7F, // contast value
0xD9, 0x01, 0x22, // 0x1F Precharge
0xDB, 0x01, 0x40, // Precharge
0x20, 0x01, 0x00, // Set horizontal addressing mode
0xA4, 0x00, // Display resume
0xA6, 0x00, // Normal display
0xAF, 0x00, // Display on
0xAE, // display off
0x20, 0x00, // Page horizontal Addressing mode
0xC8, // Scan from 127 to 0 (Reverse scan)
0x40| 0x00, // First line to start scanning from
0x81, 0xFF, // contast value to 0xFF for maximum brightness
0xA0| 0x01, // Use reverse mapping. 0x00 - is normal mapping
0xA6, // Normal display
0xA8, 63, // Reset to default MUX. See datasheet
0xD3, 0x00, // no offset
0xD5, 0x80, // set to default ratio/osc frequency
0xD9, 0xF1, // switch precharge to 0x22 // 0xF1
0xDA, 0x12, // set divide ratio
0xDB, 0x30, // vcom deselect to 0x30
0x8D, 0x95, // Enable charge pump 9V
0xAD, 0x30, // Internal Iref setting 30uA
0xA4, // Display resume
0xAF, // Display on
};

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -202,25 +203,26 @@ template <class I> void DisplaySSD1306B_64x32<I>::end()

static const PROGMEM uint8_t s_SSD1306B_lcd64x48_initData[] = {
#ifdef SDL_EMULATION
SDL_LCD_SSD1306, 0x00,
SDL_LCD_SSD1306B, 0x00,
0x00, 0x00,
#endif
0xAE, 0x00, // display off
0xD5, 0x01, 0x80, // Clock div
0xA8, 0x01, 47, // Set multiplex
0xD3, 0x01, 0x00, // --no offset
0x40, 0x00, // Set display offset
0x8D, 0x01, 0x14, // Set charge pump
0xA0| 0x01, 0x00, // Reverse mapping
0xC8, 0x00, // Decrement
0xDA, 0x01, 0x02, // Set com pins
0x81, 0x01, 0x7F, // contast value
0xD9, 0x01, 0x22, // 0x1F Precharge
0xDB, 0x01, 0x40, // Precharge
0x20, 0x01, 0x00, // Set horizontal addressing mode
0xA4, 0x00, // Display resume
0xA6, 0x00, // Normal display
0xAF, 0x00, // Display on
0xAE, // display off
0x20, 0x00, // Page horizontal Addressing mode
0xC8, // Scan from 127 to 0 (Reverse scan)
0x40| 0x00, // First line to start scanning from
0x81, 0xFF, // contast value to 0xFF for maximum brightness
0xA0| 0x01, // Use reverse mapping. 0x00 - is normal mapping
0xA6, // Normal display
0xA8, 63, // Reset to default MUX. See datasheet
0xD3, 0x00, // no offset
0xD5, 0x80, // set to default ratio/osc frequency
0xD9, 0xF1, // switch precharge to 0x22 // 0xF1
0xDA, 0x12, // set divide ratio
0xDB, 0x30, // vcom deselect to 0x30
0x8D, 0x95, // Enable charge pump 9V
0xAD, 0x30, // Internal Iref setting 30uA
0xA4, // Display resume
0xAF, // Display on
};

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -246,25 +248,26 @@ template <class I> void DisplaySSD1306B_64x48<I>::end()

static const PROGMEM uint8_t s_SSD1306B_lcd128x32_initData[] = {
#ifdef SDL_EMULATION
SDL_LCD_SSD1306, 0x00,
SDL_LCD_SSD1306B, 0x00,
0x00, 0x00,
#endif
0xAE, 0x00, // display off
0xD5, 0x01, 0x80, // Clock div
0xA8, 0x01, 31, // Set multiplex
0xD3, 0x01, 0x00, // --no offset
0x40, 0x00, // Set display offset
0x8D, 0x01, 0x14, // Set charge pump
0xA0| 0x01, 0x00, // Reverse mapping
0xC8, 0x00, // Decrement
0xDA, 0x01, 0x02, // Set com pins
0x81, 0x01, 0x7F, // contast value
0xD9, 0x01, 0x22, // 0x1F Precharge
0xDB, 0x01, 0x40, // Precharge
0x20, 0x01, 0x00, // Set horizontal addressing mode
0xA4, 0x00, // Display resume
0xA6, 0x00, // Normal display
0xAF, 0x00, // Display on
0xAE, // display off
0x20, 0x00, // Page horizontal Addressing mode
0xC8, // Scan from 127 to 0 (Reverse scan)
0x40| 0x00, // First line to start scanning from
0x81, 0xFF, // contast value to 0xFF for maximum brightness
0xA0| 0x01, // Use reverse mapping. 0x00 - is normal mapping
0xA6, // Normal display
0xA8, 63, // Reset to default MUX. See datasheet
0xD3, 0x00, // no offset
0xD5, 0x80, // set to default ratio/osc frequency
0xD9, 0xF1, // switch precharge to 0x22 // 0xF1
0xDA, 0x12, // set divide ratio
0xDB, 0x30, // vcom deselect to 0x30
0x8D, 0x95, // Enable charge pump 9V
0xAD, 0x30, // Internal Iref setting 30uA
0xA4, // Display resume
0xAF, // Display on
};

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -305,7 +308,7 @@ static const PROGMEM uint8_t s_SSD1306B_lcd128x64_initData[] = {
0xD5, 0x80, // set to default ratio/osc frequency
0xD9, 0xF1, // switch precharge to 0x22 // 0xF1
0xDA, 0x12, // set divide ratio
0xDB, 0x20, // vcom deselect to 0x20 // 0x40
0xDB, 0x30, // vcom deselect to 0x30
0x8D, 0x95, // Enable charge pump 9V
0xAD, 0x30, // Internal Iref setting 30uA
0xA4, // Display resume
Expand Down

0 comments on commit d47482c

Please sign in to comment.