mirror of
https://github.com/olikraus/U8g2_Arduino.git
synced 2026-09-15 19:23:13 +00:00
2.3.0
This commit is contained in:
+17
-1
@@ -74,7 +74,23 @@ extern "C" uint8_t u8x8_gpio_and_delay_arduino(u8x8_t *u8x8, uint8_t msg, uint8_
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
#ifndef __AVR__
|
||||
/* this case is not compiled for any AVR, because AVR uC are so slow */
|
||||
/* that this delay does not matter */
|
||||
case U8X8_MSG_DELAY_NANO:
|
||||
delayMicroseconds(arg_int==0?0:1);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case U8X8_MSG_DELAY_10MICRO:
|
||||
/* not used at the moment */
|
||||
break;
|
||||
|
||||
case U8X8_MSG_DELAY_100NANO:
|
||||
/* not used at the moment */
|
||||
break;
|
||||
|
||||
case U8X8_MSG_DELAY_MILLI:
|
||||
delay(arg_int);
|
||||
break;
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@
|
||||
U8X8_MSG_DELAY_MILLI
|
||||
U8X8_MSG_DELAY_10MICRO
|
||||
U8X8_MSG_DELAY_100NANO
|
||||
|
||||
U8X8_MSG_DELAY_NANO
|
||||
*/
|
||||
|
||||
#ifndef _U8X8_H
|
||||
|
||||
@@ -123,13 +123,16 @@ uint8_t u8x8_d_st7920_common(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *a
|
||||
*/
|
||||
c = ((u8x8_tile_t *)arg_ptr)->cnt; /* number of tiles */
|
||||
ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr; /* data ptr to the tiles */
|
||||
/* The following byte is sent to allow the ST7920 to sync up with the data */
|
||||
/* it solves some issues with garbage data */
|
||||
u8x8_cad_SendCmd(u8x8, 0x03e ); /* enable extended mode */
|
||||
for( i = 0; i < 8; i++ )
|
||||
{
|
||||
u8x8_cad_SendCmd(u8x8, 0x03e ); /* enable extended mode */
|
||||
u8x8_cad_SendCmd(u8x8, 0x080 | (y+i) ); /* y pos */
|
||||
u8x8_cad_SendCmd(u8x8, 0x080 | x ); /* set x pos */
|
||||
c = ((u8x8_tile_t *)arg_ptr)->cnt; /* number of tiles */
|
||||
|
||||
|
||||
u8x8->gpio_and_delay_cb(u8x8, U8X8_MSG_DELAY_NANO, 200, NULL); /* extra dely required */
|
||||
u8x8_cad_SendData(u8x8, c, ptr); /* note: SendData can not handle more than 255 bytes, send one line of data */
|
||||
ptr += c;
|
||||
@@ -181,6 +184,7 @@ static const u8x8_display_info_t u8x8_st7920_128x64_display_info =
|
||||
/* sda_setup_time_ns = */ 20,
|
||||
/* sck_pulse_width_ns = */ 140, /* datasheet ST7920 */
|
||||
/* sck_clock_hz = */ 1000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
|
||||
/* ST7920+Due work with 1MHz but not with 2MHz, ST7920+Uno works with 2MHz */
|
||||
/* spi_mode = */ 1, /* active high, rising edge */
|
||||
/* i2c_bus_clock_100kHz = */ 4,
|
||||
/* data_setup_time_ns = */ 30,
|
||||
|
||||
@@ -82,16 +82,16 @@ static const uint8_t u8x8_d_uc1701_mini12864_powersave1_seq[] = {
|
||||
|
||||
static const uint8_t u8x8_d_uc1701_mini12864_flip0_seq[] = {
|
||||
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
|
||||
U8X8_C(0x0a1), /* segment remap a0/a1*/
|
||||
U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */
|
||||
U8X8_C(0x0a0), /* segment remap a0/a1*/
|
||||
U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */
|
||||
U8X8_END_TRANSFER(), /* disable chip */
|
||||
U8X8_END() /* end of sequence */
|
||||
};
|
||||
|
||||
static const uint8_t u8x8_d_uc1701_mini12864_flip1_seq[] = {
|
||||
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
|
||||
U8X8_C(0x0a0), /* segment remap a0/a1*/
|
||||
U8X8_C(0x0c8), /* c0: scan dir normal, c8: reverse */
|
||||
U8X8_C(0x0a1), /* segment remap a0/a1*/
|
||||
U8X8_C(0x0c0), /* c0: scan dir normal, c8: reverse */
|
||||
U8X8_END_TRANSFER(), /* disable chip */
|
||||
U8X8_END() /* end of sequence */
|
||||
};
|
||||
@@ -116,7 +116,7 @@ static const u8x8_display_info_t u8x8_uc1701_display_info =
|
||||
/* tile_width = */ 16, /* width of 16*8=128 pixel */
|
||||
/* tile_hight = */ 8,
|
||||
/* default_x_offset = */ 0,
|
||||
/* flipmode_x_offset = */ 30,
|
||||
/* flipmode_x_offset = */ 4,
|
||||
/* pixel_width = */ 128,
|
||||
/* pixel_height = */ 64
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user