mirror of
https://github.com/olikraus/U8g2_Arduino.git
synced 2026-07-27 20:06:05 +00:00
2.32.1
This commit is contained in:
@@ -8,5 +8,5 @@ Description: https://github.com/olikraus/u8g2/wiki
|
||||
|
||||
Issue Tracker: https://github.com/olikraus/u8g2/issues
|
||||
|
||||
Download (2.31.3): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
|
||||
Download (2.32.1): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
|
||||
|
||||
|
||||
+2
-1
@@ -273,4 +273,5 @@ https://github.com/olikraus/u8g2 ChangeLog
|
||||
* Added icons from https://app.streamlinehq.com/icons/pixel (issue 1589)
|
||||
2021-09-20 v2.31.2 olikraus@gmail.com
|
||||
* Bugfix release for include error (issues 1592 and 1594)
|
||||
|
||||
2021-xx-xx v2.32.x olikraus@gmail.com
|
||||
* SH1107 128x80 (issue 1598)
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name=U8g2
|
||||
version=2.31.3
|
||||
version=2.32.1
|
||||
author=oliver <olikraus@gmail.com>
|
||||
maintainer=oliver <olikraus@gmail.com>
|
||||
sentence=Monochrome LCD, OLED and eInk Library. Display controller: SSD1305, SSD1306, SSD1309, SSD1316, 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, ST75256, ST75320, NT7534, ST7920, IST3020, IST7920, LD7032, KS0108, KS0713, HD44102, T7932, SED1520, SBN1661, IL3820, MAX7219. Interfaces: I2C, SPI, Parallel.
|
||||
|
||||
@@ -1131,11 +1131,6 @@ uint8_t mui_u8g2_u8_opt_child_mse_common(mui_t *ui, uint8_t msg)
|
||||
break;
|
||||
case MUIF_MSG_CURSOR_ENTER:
|
||||
return mui_u8g2_handle_scroll_next_prev_events(ui, msg);
|
||||
/*
|
||||
if ( (arg > 0) && (ui->form_scroll_top + arg >= ui->form_scroll_total) )
|
||||
return 255;
|
||||
break;
|
||||
*/
|
||||
case MUIF_MSG_CURSOR_SELECT:
|
||||
if ( value != NULL )
|
||||
*value = ui->form_scroll_top + arg;
|
||||
@@ -1149,45 +1144,8 @@ uint8_t mui_u8g2_u8_opt_child_mse_common(mui_t *ui, uint8_t msg)
|
||||
break;
|
||||
case MUIF_MSG_EVENT_NEXT:
|
||||
return mui_u8g2_handle_scroll_next_prev_events(ui, msg);
|
||||
/*
|
||||
if ( arg+1 == ui->form_scroll_visible )
|
||||
{
|
||||
if ( ui->form_scroll_visible + ui->form_scroll_top < ui->form_scroll_total )
|
||||
{
|
||||
ui->form_scroll_top++;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->form_scroll_top = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case MUIF_MSG_EVENT_PREV:
|
||||
return mui_u8g2_handle_scroll_next_prev_events(ui, msg);
|
||||
/*
|
||||
if ( arg == 0 )
|
||||
{
|
||||
if ( ui->form_scroll_top > 0 )
|
||||
{
|
||||
ui->form_scroll_top--;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( ui->form_scroll_total > ui->form_scroll_visible )
|
||||
{
|
||||
ui->form_scroll_top = ui->form_scroll_total - ui->form_scroll_visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->form_scroll_top = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1547,38 +1505,8 @@ static uint8_t mui_u8g2_u16_list_child_mse_common(mui_t *ui, uint8_t msg)
|
||||
break;
|
||||
case MUIF_MSG_EVENT_NEXT:
|
||||
return mui_u8g2_handle_scroll_next_prev_events(ui, msg);
|
||||
/*
|
||||
if ( arg+1 == ui->form_scroll_visible )
|
||||
{
|
||||
if ( ui->form_scroll_visible + ui->form_scroll_top < ui->form_scroll_total )
|
||||
{
|
||||
ui->form_scroll_top++;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->form_scroll_top = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case MUIF_MSG_EVENT_PREV:
|
||||
return mui_u8g2_handle_scroll_next_prev_events(ui, msg);
|
||||
/*
|
||||
if ( arg == 0 )
|
||||
{
|
||||
if ( ui->form_scroll_top > 0 )
|
||||
{
|
||||
ui->form_scroll_top--;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->form_scroll_top = ui->form_scroll_total - ui->form_scroll_visible;
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
+5
-10
@@ -107,12 +107,6 @@ void mui_u8g2_draw_button_utf(mui_t *ui, u8g2_uint_t flags, u8g2_uint_t width, u
|
||||
void mui_u8g2_draw_button_utf_pi(mui_t *ui, u8g2_uint_t width, u8g2_uint_t padding_h, const char *text);
|
||||
|
||||
|
||||
/* incomplete field functions */
|
||||
|
||||
uint8_t mui_frame_button_bold_select_u8g2(mui_t *ui, uint8_t msg);
|
||||
uint8_t mui_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
|
||||
uint8_t mui_half_width_frame_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
|
||||
uint8_t mui_line_button_invers_select_u8g2(mui_t *ui, uint8_t msg);
|
||||
|
||||
/* ready to use field functions */
|
||||
|
||||
@@ -125,10 +119,13 @@ uint8_t mui_u8g2_btn_goto_w1_fi(mui_t *ui, uint8_t msg);
|
||||
|
||||
uint8_t mui_u8g2_btn_exit_wm_fi(mui_t *ui, uint8_t msg);
|
||||
|
||||
uint8_t mui_u8g2_u8_chkbox_wm_pi(mui_t *ui, uint8_t msg); /* MUIF_VARIABLE, MUI_XY */
|
||||
uint8_t mui_u8g2_u8_radio_wm_pi(mui_t *ui, uint8_t msg); /* MUIF_VARIABLE,MUI_XYAT */
|
||||
|
||||
|
||||
uint8_t mui_u8g2_u8_opt_line_wa_mse_pi(mui_t *ui, uint8_t msg);
|
||||
uint8_t mui_u8g2_u8_opt_line_wa_mud_pi(mui_t *ui, uint8_t msg);
|
||||
|
||||
uint8_t mui_u8g2_u8_opt_line_wa_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_VARIABLE,MUI_XYAT */
|
||||
uint8_t mui_u8g2_u8_opt_line_wa_mud_pi(mui_t *ui, uint8_t msg); /* MUIF_VARIABLE,MUI_XYAT */
|
||||
|
||||
uint8_t mui_u8g2_u8_opt_parent_wm_mse_pi(mui_t *ui, uint8_t msg);
|
||||
uint8_t mui_u8g2_u8_opt_radio_child_wm_mse_pi(mui_t *ui, uint8_t msg);
|
||||
@@ -138,8 +135,6 @@ uint8_t mui_u8g2_u8_opt_child_wm_mse_pi(mui_t *ui, uint8_t msg); /* like mui_u8g
|
||||
uint8_t mui_u8g2_goto_parent(mui_t *ui, uint8_t msg); /* MUIF_RO */
|
||||
uint8_t mui_u8g2_goto_child_w1_mse_pi(mui_t *ui, uint8_t msg); /* MUIF_BUTTON, MUI_XYA */
|
||||
|
||||
uint8_t mui_u8g2_u8_chkbox_wm_pi(mui_t *ui, uint8_t msg);
|
||||
uint8_t mui_u8g2_u8_radio_wm_pi(mui_t *ui, uint8_t msg);
|
||||
|
||||
|
||||
uint8_t mui_u8g2_u8_char_wm_mud_pi(mui_t *ui, uint8_t msg);
|
||||
|
||||
+3
-3
@@ -490,9 +490,9 @@ uint8_t *u8g2_m_8_16_f(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_12_12_1(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_12_12_2(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_12_12_f(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_16_10_1(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_16_10_2(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_16_10_f(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_10_16_1(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_10_16_2(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_10_16_f(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_16_16_1(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_16_16_2(uint8_t *page_cnt);
|
||||
uint8_t *u8g2_m_16_16_f(uint8_t *page_cnt);
|
||||
|
||||
@@ -234,36 +234,36 @@ uint8_t *u8g2_m_12_12_f(uint8_t *page_cnt)
|
||||
return buf;
|
||||
#endif
|
||||
}
|
||||
uint8_t *u8g2_m_16_10_1(uint8_t *page_cnt)
|
||||
uint8_t *u8g2_m_10_16_1(uint8_t *page_cnt)
|
||||
{
|
||||
#ifdef U8G2_USE_DYNAMIC_ALLOC
|
||||
*page_cnt = 1;
|
||||
return 0;
|
||||
#else
|
||||
static uint8_t buf[128];
|
||||
static uint8_t buf[80];
|
||||
*page_cnt = 1;
|
||||
return buf;
|
||||
#endif
|
||||
}
|
||||
uint8_t *u8g2_m_16_10_2(uint8_t *page_cnt)
|
||||
uint8_t *u8g2_m_10_16_2(uint8_t *page_cnt)
|
||||
{
|
||||
#ifdef U8G2_USE_DYNAMIC_ALLOC
|
||||
*page_cnt = 2;
|
||||
return 0;
|
||||
#else
|
||||
static uint8_t buf[256];
|
||||
static uint8_t buf[160];
|
||||
*page_cnt = 2;
|
||||
return buf;
|
||||
#endif
|
||||
}
|
||||
uint8_t *u8g2_m_16_10_f(uint8_t *page_cnt)
|
||||
uint8_t *u8g2_m_10_16_f(uint8_t *page_cnt)
|
||||
{
|
||||
#ifdef U8G2_USE_DYNAMIC_ALLOC
|
||||
*page_cnt = 10;
|
||||
*page_cnt = 16;
|
||||
return 0;
|
||||
#else
|
||||
static uint8_t buf[1280];
|
||||
*page_cnt = 10;
|
||||
*page_cnt = 16;
|
||||
return buf;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -830,7 +830,7 @@ void u8g2_Setup_sh1107_128x80_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_ms
|
||||
uint8_t tile_buf_height;
|
||||
uint8_t *buf;
|
||||
u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x80, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
|
||||
buf = u8g2_m_16_10_1(&tile_buf_height);
|
||||
buf = u8g2_m_10_16_1(&tile_buf_height);
|
||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||
}
|
||||
/* sh1107 2 */
|
||||
@@ -839,7 +839,7 @@ void u8g2_Setup_sh1107_128x80_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_ms
|
||||
uint8_t tile_buf_height;
|
||||
uint8_t *buf;
|
||||
u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x80, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
|
||||
buf = u8g2_m_16_10_2(&tile_buf_height);
|
||||
buf = u8g2_m_10_16_2(&tile_buf_height);
|
||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||
}
|
||||
/* sh1107 f */
|
||||
@@ -848,7 +848,7 @@ void u8g2_Setup_sh1107_128x80_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x8_ms
|
||||
uint8_t tile_buf_height;
|
||||
uint8_t *buf;
|
||||
u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x80, u8x8_cad_001, byte_cb, gpio_and_delay_cb);
|
||||
buf = u8g2_m_16_10_f(&tile_buf_height);
|
||||
buf = u8g2_m_10_16_f(&tile_buf_height);
|
||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||
}
|
||||
/* sh1107 */
|
||||
@@ -858,7 +858,7 @@ void u8g2_Setup_sh1107_i2c_128x80_1(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x
|
||||
uint8_t tile_buf_height;
|
||||
uint8_t *buf;
|
||||
u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x80, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb);
|
||||
buf = u8g2_m_16_10_1(&tile_buf_height);
|
||||
buf = u8g2_m_10_16_1(&tile_buf_height);
|
||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||
}
|
||||
/* sh1107 2 */
|
||||
@@ -867,7 +867,7 @@ void u8g2_Setup_sh1107_i2c_128x80_2(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x
|
||||
uint8_t tile_buf_height;
|
||||
uint8_t *buf;
|
||||
u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x80, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb);
|
||||
buf = u8g2_m_16_10_2(&tile_buf_height);
|
||||
buf = u8g2_m_10_16_2(&tile_buf_height);
|
||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||
}
|
||||
/* sh1107 f */
|
||||
@@ -876,7 +876,7 @@ void u8g2_Setup_sh1107_i2c_128x80_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x
|
||||
uint8_t tile_buf_height;
|
||||
uint8_t *buf;
|
||||
u8g2_SetupDisplay(u8g2, u8x8_d_sh1107_128x80, u8x8_cad_ssd13xx_fast_i2c, byte_cb, gpio_and_delay_cb);
|
||||
buf = u8g2_m_16_10_f(&tile_buf_height);
|
||||
buf = u8g2_m_10_16_f(&tile_buf_height);
|
||||
u8g2_SetupBuffer(u8g2, buf, tile_buf_height, u8g2_ll_hvline_vertical_top_lsb, rotation);
|
||||
}
|
||||
/* sh1107 */
|
||||
|
||||
@@ -399,40 +399,9 @@ uint8_t u8x8_d_sh1107_128x128(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *
|
||||
}
|
||||
|
||||
/*==================================================*/
|
||||
/* 128x80 OLED, copyied from 128x128 oled, this display has a very strange x offset */
|
||||
/* 128x80 OLED, copyied from SEEED 128x128 oled, this display has a very strange x offset */
|
||||
/* https://github.com/olikraus/u8g2/issues/1598 */
|
||||
|
||||
/* sequence taken over from 64x128 sequence, because it seems to work mostly */
|
||||
static const uint8_t u8x8_d_sh1107_128x80_init_seq[] = {
|
||||
|
||||
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
|
||||
|
||||
|
||||
U8X8_C(0x0ae), /* display off */
|
||||
U8X8_CA(0x0dc, 24), /* start line */
|
||||
U8X8_CA(0x081, 0x02f), /* [2] set contrast control */
|
||||
U8X8_C(0x020), /* use page addressing mode */
|
||||
|
||||
// U8X8_C(0x0a1), /* segment remap a0/a1*/
|
||||
// U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */
|
||||
// Flipmode
|
||||
U8X8_C(0x0a0), /* segment remap a0/a1*/
|
||||
U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */
|
||||
|
||||
U8X8_CA(0x0a8, 0x7f), /* 0x03f multiplex ratio */
|
||||
//U8X8_CA(0x0d3, 0x060), /* display offset (removed, not in datasheet ) */
|
||||
U8X8_CA(0x0d5, 0x050), /* clock divide ratio (0x00=1) and oscillator frequency (0x8), changed to 0x051, issue 501 */
|
||||
U8X8_CA(0x0d9, 0x022), /* [2] pre-charge period 0x022/f1*/
|
||||
U8X8_CA(0x0db, 0x035), /* vcomh deselect level */
|
||||
|
||||
U8X8_C(0x0b0), /* set page address */
|
||||
U8X8_CA(0x0da, 0x012), /* set com pins */
|
||||
U8X8_C(0x0a4), /* output ram to display */
|
||||
U8X8_C(0x0a6), /* none inverted normal display mode */
|
||||
|
||||
U8X8_END_TRANSFER(), /* disable chip */
|
||||
U8X8_END() /* end of sequence */
|
||||
};
|
||||
/* this is actually a 80x128 display, but let's keep the 128x80 name */
|
||||
|
||||
|
||||
static const u8x8_display_info_t u8x8_sh1107_128x80_display_info =
|
||||
@@ -451,12 +420,12 @@ static const u8x8_display_info_t u8x8_sh1107_128x80_display_info =
|
||||
/* i2c_bus_clock_100kHz = */ 4,
|
||||
/* data_setup_time_ns = */ 40,
|
||||
/* write_pulse_width_ns = */ 150, /* sh1107: cycle time is 300ns, so use 300/2 = 150 */
|
||||
/* tile_width = */ 16,
|
||||
/* tile_hight = */ 10,
|
||||
/* default_x_offset = */ 96,
|
||||
/* flipmode_x_offset = */ 96,
|
||||
/* pixel_width = */ 128,
|
||||
/* pixel_height = */ 80
|
||||
/* tile_width = */ 10,
|
||||
/* tile_hight = */ 16,
|
||||
/* default_x_offset = */ 24,
|
||||
/* flipmode_x_offset = */ 24,
|
||||
/* pixel_width = */ 80,
|
||||
/* pixel_height = */ 128
|
||||
};
|
||||
|
||||
uint8_t u8x8_d_sh1107_128x80(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
|
||||
@@ -469,7 +438,7 @@ uint8_t u8x8_d_sh1107_128x80(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a
|
||||
{
|
||||
case U8X8_MSG_DISPLAY_INIT:
|
||||
u8x8_d_helper_display_init(u8x8);
|
||||
u8x8_cad_SendSequence(u8x8, u8x8_d_sh1107_128x80_init_seq);
|
||||
u8x8_cad_SendSequence(u8x8, u8x8_d_sh1107_128x128_init_seq);
|
||||
break;
|
||||
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
|
||||
u8x8_d_helper_display_setup_memory(u8x8, &u8x8_sh1107_128x80_display_info);
|
||||
|
||||
Reference in New Issue
Block a user