mirror of
https://github.com/olikraus/U8g2_Arduino.git
synced 2026-07-28 04:16:19 +00:00
2.20.10
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.20.9): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
|
||||
Download (2.20.10): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
name=U8g2
|
||||
version=2.20.9
|
||||
version=2.20.10
|
||||
author=oliver <olikraus@gmail.com>
|
||||
maintainer=oliver <olikraus@gmail.com>
|
||||
sentence=Monochrome LCD, OLED and eInk Library. Display controller: SSD1305, SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, T6963, RA8835, LC7981, PCD8544, PCF8812, UC1601, UC1604, UC1608, UC1610, UC1611, UC1701, ST7565, ST7567, ST7588, ST75256, NT7534, IST3020, ST7920, LD7032, KS0108, SED1520, SBN1661, IL3820, MAX7219. Interfaces: I2C, SPI, Parallel.
|
||||
|
||||
+116
-5
@@ -72,7 +72,7 @@ uint8_t u8x8_write_byte_to_16gr_device(u8x8_t *u8x8, uint8_t b)
|
||||
buf [1] = map[b & 3];
|
||||
b>>=2;
|
||||
buf [0] = map[b & 3];
|
||||
return u8x8_cad_SendData(u8x8, 4, buf); /* note: SendData can not handle more than 255 bytes, send one line of data */
|
||||
return u8x8_cad_SendData(u8x8, 4, buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ uint8_t u8x8_write_byte_to_16gr_device(u8x8_t *u8x8, uint8_t b)
|
||||
Tile for SSD1325 (32 Bytes)
|
||||
*/
|
||||
|
||||
static uint8_t u8x8_ssd1322_8to32_dest_buf[32];
|
||||
static uint8_t u8x8_ssd1322_to32_dest_buf[32];
|
||||
|
||||
static uint8_t *u8x8_ssd1322_8to32(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ static uint8_t *u8x8_ssd1322_8to32(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
|
||||
|
||||
for( j = 0; j < 4; j++ )
|
||||
{
|
||||
dest = u8x8_ssd1322_8to32_dest_buf;
|
||||
dest = u8x8_ssd1322_to32_dest_buf;
|
||||
dest += j;
|
||||
a =*ptr;
|
||||
ptr++;
|
||||
@@ -112,7 +112,33 @@ static uint8_t *u8x8_ssd1322_8to32(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
return u8x8_ssd1322_8to32_dest_buf;
|
||||
return u8x8_ssd1322_to32_dest_buf;
|
||||
}
|
||||
|
||||
static uint8_t *u8x8_ssd1322_4to32(U8X8_UNUSED u8x8_t *u8x8, uint8_t *ptr)
|
||||
{
|
||||
uint8_t v;
|
||||
uint8_t a;
|
||||
uint8_t i, j;
|
||||
uint8_t *dest;
|
||||
|
||||
for( j = 0; j < 4; j++ )
|
||||
{
|
||||
dest = u8x8_ssd1322_to32_dest_buf;
|
||||
dest += j;
|
||||
a =*ptr;
|
||||
ptr++;
|
||||
for( i = 0; i < 8; i++ )
|
||||
{
|
||||
v = 0;
|
||||
if ( a&1 ) v = 0xff;
|
||||
*dest = v;
|
||||
dest+=4;
|
||||
a >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return u8x8_ssd1322_to32_dest_buf;
|
||||
}
|
||||
|
||||
|
||||
@@ -304,8 +330,93 @@ uint8_t u8x8_d_ssd1322_nhd_256x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, vo
|
||||
NHD-2.7-12864WDW3-M
|
||||
http://www.newhavendisplay.com/nhd2712864wdw3m-p-9546.html
|
||||
http://www.newhavendisplay.com/specs/NHD-2.7-12864WDW3-M.pdf
|
||||
|
||||
It looks like that only every second pixel is connected to the OLED
|
||||
*/
|
||||
|
||||
uint8_t u8x8_d_ssd1322_common2(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
|
||||
{
|
||||
uint8_t x;
|
||||
uint8_t y, c;
|
||||
uint8_t *ptr;
|
||||
switch(msg)
|
||||
{
|
||||
/* U8X8_MSG_DISPLAY_SETUP_MEMORY is handled by the calling function */
|
||||
/*
|
||||
case U8X8_MSG_DISPLAY_SETUP_MEMORY:
|
||||
break;
|
||||
case U8X8_MSG_DISPLAY_INIT:
|
||||
u8x8_d_helper_display_init(u8x8);
|
||||
u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1322_256x64_init_seq);
|
||||
break;
|
||||
*/
|
||||
case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
|
||||
if ( arg_int == 0 )
|
||||
u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1322_powersave0_seq);
|
||||
else
|
||||
u8x8_cad_SendSequence(u8x8, u8x8_d_ssd1322_powersave1_seq);
|
||||
break;
|
||||
#ifdef U8X8_WITH_SET_CONTRAST
|
||||
case U8X8_MSG_DISPLAY_SET_CONTRAST:
|
||||
u8x8_cad_StartTransfer(u8x8);
|
||||
u8x8_cad_SendCmd(u8x8, 0x0C1 );
|
||||
u8x8_cad_SendArg(u8x8, arg_int ); /* ssd1322 has range from 0 to 255 */
|
||||
u8x8_cad_EndTransfer(u8x8);
|
||||
break;
|
||||
#endif
|
||||
case U8X8_MSG_DISPLAY_DRAW_TILE:
|
||||
u8x8_cad_StartTransfer(u8x8);
|
||||
x = ((u8x8_tile_t *)arg_ptr)->x_pos;
|
||||
x *= 2; // only every 4th col can be addressed
|
||||
x += u8x8->x_offset;
|
||||
x *= 2; // only every second pixel is used in the 128x64 NHD OLED
|
||||
|
||||
y = (((u8x8_tile_t *)arg_ptr)->y_pos);
|
||||
y *= 8;
|
||||
|
||||
u8x8_cad_SendCmd(u8x8, 0x075 ); /* set row address, moved out of the loop (issue 302) */
|
||||
u8x8_cad_SendArg(u8x8, y);
|
||||
u8x8_cad_SendArg(u8x8, y+7);
|
||||
|
||||
do
|
||||
{
|
||||
c = ((u8x8_tile_t *)arg_ptr)->cnt;
|
||||
ptr = ((u8x8_tile_t *)arg_ptr)->tile_ptr;
|
||||
|
||||
do
|
||||
{
|
||||
u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
|
||||
u8x8_cad_SendArg(u8x8, x ); /* start */
|
||||
u8x8_cad_SendArg(u8x8, x+1 ); /* end */
|
||||
u8x8_cad_SendCmd(u8x8, 0x05c ); /* write to ram */
|
||||
u8x8_cad_SendData(u8x8, 32, u8x8_ssd1322_4to32(u8x8, ptr));
|
||||
ptr += 4;
|
||||
x += 2;
|
||||
|
||||
u8x8_cad_SendCmd(u8x8, 0x015 ); /* set column address */
|
||||
u8x8_cad_SendArg(u8x8, x ); /* start */
|
||||
u8x8_cad_SendArg(u8x8, x+1 ); /* end */
|
||||
u8x8_cad_SendCmd(u8x8, 0x05c ); /* write to ram */
|
||||
u8x8_cad_SendData(u8x8, 32, u8x8_ssd1322_4to32(u8x8, ptr));
|
||||
ptr += 4;
|
||||
x += 2;
|
||||
|
||||
c--;
|
||||
} while( c > 0 );
|
||||
|
||||
//x += 2;
|
||||
arg_int--;
|
||||
} while( arg_int > 0 );
|
||||
|
||||
u8x8_cad_EndTransfer(u8x8);
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
static const uint8_t u8x8_d_ssd1322_128x64_flip0_seq[] = {
|
||||
U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */
|
||||
U8X8_CAA(0x0a0, 0x016, 0x011), /* remap */
|
||||
@@ -409,7 +520,7 @@ uint8_t u8x8_d_ssd1322_nhd_128x64(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, vo
|
||||
break;
|
||||
|
||||
default:
|
||||
return u8x8_d_ssd1322_common(u8x8, msg, arg_int, arg_ptr);
|
||||
return u8x8_d_ssd1322_common2(u8x8, msg, arg_int, arg_ptr);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user