This commit is contained in:
kraus
2022-12-04 21:44:40 +01:00
parent 1f654ff078
commit 94ebfe2318
9 changed files with 82 additions and 7 deletions
+1 -1
View File
@@ -8,5 +8,5 @@ Description: https://github.com/olikraus/u8g2/wiki
Issue Tracker: https://github.com/olikraus/u8g2/issues
Download (2.34.5): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
Download (2.34.6): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
+4 -3
View File
@@ -89,7 +89,7 @@
//U8G2_SH1107_SEEED_96X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_SH1107_HJR_OEL1M0201_96X96_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_SH1107_TK078F288_80X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
U8G2_SH1108_128X160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_SH1108_128X160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_SH1108_160X160_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
//U8G2_SH1122_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h
//U8G2_SH1122_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); // Enable U8G2_16BIT in u8g2.h
@@ -348,11 +348,12 @@ void draw(const char *s)
do {
u8g2.drawStr(2,15,"Hello World!");
u8g2.drawStr(2,30,s);
u8g2.drawFrame(0,0,u8g2.getDisplayWidth(),u8g2.getDisplayHeight() );
u8g2.drawStr(2, 45, u8x8_u16toa(u8g2.getDisplayWidth(), 5));
u8g2.drawStr(2, 60, u8x8_u16toa(u8g2.getDisplayHeight(), 5));
u8g2.drawFrame(0,0,u8g2.getDisplayWidth(),u8g2.getDisplayHeight() );
} while ( u8g2.nextPage() );
delay(2000);
}
+3 -1
View File
@@ -300,6 +300,8 @@ https://github.com/olikraus/u8g2 ChangeLog
* Changed SPI mode for SH1106 from 3 to 0 (issue 1901)
2022-xx-xx v2.34.xx olikraus@gmail.com
* SSD1327 ZJY M150 128x128 (issue 1960)
* SSD1316 96x32 (1938)
* SSD1316 96x32 (issue 1938)
* SH1108 128x160 (issue 1998)
* SSD1306 96x39 (issue 1959)
+1 -1
View File
@@ -1,5 +1,5 @@
name=U8g2
version=2.34.5
version=2.34.6
author=oliver <olikraus@gmail.com>
maintainer=oliver <olikraus@gmail.com>
sentence=Monochrome LCD, OLED and eInk Library. Display controller: SSD1305, SSD1306, SSD1309, SSD1312, SSD1316, SSD1318, SSD1320, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, SH1107, SH1108, SH1122, T6963, RA8835, LC7981, PCD8544, PCF8812, HX1230, UC1601, UC1604, UC1608, UC1610, UC1611, UC1617, UC1638, UC1701, ST7511, ST7528, ST7565, ST7567, ST7571, ST7586, ST7588, ST75160, ST75256, ST75320, NT7534, ST7920, IST3020, IST3088, IST7920, LD7032, KS0108, KS0713, HD44102, T7932, SED1520, SBN1661, IL3820, MAX7219, GP1287, GP1247, GU800. Interfaces: I2C, SPI, Parallel.
+5
View File
@@ -50,6 +50,11 @@
# include <i2c_t3.h>
# else
# include <Wire.h>
# ifdef U8X8_HAVE_2ND_HW_I2C
# if defined(MINICORE) && defined(__AVR_ATmega328PB__)
# include <Wire1.h>
# endif
# endif
# endif
#endif /* U8X8_HAVE_HW_I2C */
+2
View File
@@ -219,7 +219,9 @@ struct muif_struct
/* must be smaller than or equal to 255 */
#ifndef MUI_MAX_TEXT_LEN
#define MUI_MAX_TEXT_LEN 41
#endif
#define MUI_MENU_CACHE_CNT 2
+1
View File
@@ -831,6 +831,7 @@ uint8_t u8x8_d_uc1701_ea_dogs102(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, voi
uint8_t u8x8_d_uc1701_mini12864(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_ssd1305_128x32_noname(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_ssd1305_128x32_adafruit(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
/*uint8_t u8x8_d_ssd1305_128x32_waveshare(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);*/
uint8_t u8x8_d_ssd1305_128x64_adafruit(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_ssd1305_128x64_raystar(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
uint8_t u8x8_d_ssd1306_128x64_noname(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr);
+64
View File
@@ -224,6 +224,70 @@ uint8_t u8x8_d_ssd1305_128x32_noname(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int,
return 1;
}
/*================================================*/
/* issue 2002: Waveshare */
#ifdef SAME_AS_ADAFRUIT
/* timing from SSD1306 */
static const u8x8_display_info_t u8x8_ssd1305_128x32_waveshare_display_info =
{
/* chip_enable_level = */ 0,
/* chip_disable_level = */ 1,
/* post_chip_enable_wait_ns = */ 20,
/* pre_chip_disable_wait_ns = */ 10,
/* reset_pulse_width_ms = */ 100, /* SSD1306: 3 us */
/* post_reset_wait_ms = */ 100, /* far east OLEDs need much longer setup time */
/* sda_setup_time_ns = */ 50, /* SSD1306: 15ns, but cycle time is 100ns, so use 100/2 */
/* sck_pulse_width_ns = */ 50, /* SSD1306: 20ns, but cycle time is 100ns, so use 100/2, AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */
/* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
/* spi_mode = */ 0, /* active high, rising edge */
/* i2c_bus_clock_100kHz = */ 4,
/* data_setup_time_ns = */ 40,
/* write_pulse_width_ns = */ 150, /* SSD1306: cycle time is 300ns, so use 300/2 = 150 */
/* tile_width = */ 16,
/* tile_hight = */ 4,
/* default_x_offset = */ 4,
/* flipmode_x_offset = */ 0,
/* pixel_width = */ 128,
/* pixel_height = */ 32
};
uint8_t u8x8_d_ssd1305_128x32_waveshare(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
if ( u8x8_d_ssd1305_generic(u8x8, msg, arg_int, arg_ptr) != 0 )
return 1;
switch(msg)
{
case U8X8_MSG_DISPLAY_SET_FLIP_MODE:
if ( arg_int == 0 )
{
u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1305_128x32_flip0_seq);
u8x8->x_offset = u8x8->display_info->default_x_offset;
}
else
{
u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1305_128x32_flip1_seq);
u8x8->x_offset = u8x8->display_info->flipmode_x_offset;
}
break;
case U8X8_MSG_DISPLAY_INIT:
u8x8_d_helper_display_init(u8x8);
u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1305_128x32_noname_init_seq);
break;
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
u8x8_d_helper_display_setup_memory(u8x8, &u8x8_ssd1305_128x32_waveshare_display_info);
break;
default:
return 0;
}
return 1;
}
#endif
/*================================================*/
/* adafruit 128x32 SSD1305 OLED, https://www.adafruit.com/product/2675 */
/* issue 724 */
+1 -1
View File
@@ -256,7 +256,7 @@ static const uint8_t u8x8_d_ssd1306_96x39_flip0_seq[] = {
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
U8X8_C(0x0a1), /* segment remap a0/a1*/
U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */
U8X8_C(0x041), /* set display start line to 1 */
U8X8_C(0x07f), /* set display start line to -1 (not exactly sure why...) */
U8X8_END_TRANSFER(), /* disable chip */
U8X8_END() /* end of sequence */
};