@@ -791,6 +791,27 @@ const uint8_t epd213b_init_sequence_full[] PROGMEM =
791791 0x00 // end of table
792792}; /* epd213b_init_sequence_full[] */
793793
794+ const uint8_t epd294_init_sequence_full[] PROGMEM =
795+ {
796+ // 0x02, 0x74, 0x54,
797+ // 0x02, 0x7e, 0x3b,
798+ // 0x03, 0x2b, 0x04, 0x63,
799+ // 0x05, 0x0c, 0x8f, 0x8f, 0x8f, 0x3f,
800+ 0x04 , 0x01 , 0x27 , 0x01 , 0x00 ,
801+ 0x02 , 0x11 , 0x03 ,
802+ 0x03 , 0x44 , 0x00 , 0x0f ,
803+ 0x05 , 0x45 , 0x00 , 0x00 , 0x27 , 0x01 ,
804+ 0x03 , 0x21 , 0x00 , 0x80 ,
805+ 0x02 , 0x3c , 0xc0 ,
806+ 0x02 , 0x18 , 0x80 ,
807+ 0x02 , 0x22 , 0xb1 ,
808+ 0x01 , 0x20 ,
809+ BUSY_WAIT,
810+ 0x02 , 0x4e , 0x00 ,
811+ 0x03 , 0x4f , 0x00 , 0x00 ,
812+ 0x00 // end of table
813+ }; /* epd294_init_sequence_full[] */
814+
794815const uint8_t epd293_init_sequence_full[] PROGMEM =
795816{
796817// 0x01, SSD1608_SW_RESET,
@@ -1411,6 +1432,28 @@ const uint8_t epd213_lut[] PROGMEM =
14111432};
14121433#endif
14131434
1435+ static const uint8_t epd294_lut_partial[] PROGMEM = {
1436+ 0x0 ,0x40 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,
1437+ 0x80 ,0x80 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,
1438+ 0x40 ,0x40 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,
1439+ 0x0 ,0x80 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 ,0x0 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if (iType == EPD294_128x296)
1728+ {
1729+ pOBD->native_width = pOBD->width = 128 ;
1730+ pOBD->native_height = pOBD->height = 296 ;
1731+ pOBD->busy_idle = LOW;
1732+ pOBD->can_flip = 0 ;
1733+ // pOBD->x_offset = 2; // column byte offset
1734+ pOBD->chip_type = OBD_CHIP_SSD16xx;
1735+ pOBD->iFlags |= OBD_HAS_FAST_UPDATE;
1736+ pOBD->pInitFull = epd294_init_sequence_full;
1737+ pOBD->type = EPD293_128x296; // same for the rest
1738+ return ; // nothing else to do yet
1739+ }
16841740 else if (iType == EPD42B_400x300)
16851741 {
16861742 pOBD->native_width = pOBD->width = 400 ;
@@ -3523,6 +3579,23 @@ uint8_t *pBuffer;
35233579 } // 270
35243580} /* EPDWriteImage4bpp() */
35253581#endif // !WIMPY_MCU
3582+ const uint8_t epd294_init_sequence_part[] =
3583+ {
3584+ 0x0b , 0x37 , 0 ,0 ,0 ,0 ,0 ,0x40 ,0 ,0 ,0 ,0 ,
3585+ 0x04 , 0x01 , 0x27 , 0x01 , 0x00 ,
3586+ 0x02 , 0x11 , 0x03 ,
3587+ 0x03 , 0x44 , 0x00 , 0x0f ,
3588+ 0x05 , 0x45 , 0x00 , 0x00 , 0x27 , 0x01 ,
3589+ 0x03 , 0x21 , 0x00 , 0x80 ,
3590+ 0x02 , 0x3c , 0xc0 ,
3591+ 0x02 , 0x22 , 0xc0 ,
3592+ 0x01 , 0x20 ,
3593+ BUSY_WAIT,
3594+ 0x02 , 0x4e , 0x00 ,
3595+ 0x03 , 0x4f , 0x00 , 0x00 ,
3596+ 0x00 // end of sequence
3597+ }; /* epd294_init_sequence_part */
3598+
35263599const uint8_t epd293_init_sequence_part[] =
35273600{
35283601// 0x01, SSD1608_SW_RESET,
@@ -3545,7 +3618,7 @@ const uint8_t epd293_init_sequence_part[] =
35453618 0x02 , 0x4e , 0x00 ,
35463619 0x03 , 0x4f , 0x00 , 0x00 ,
35473620 0x00 // end of table
3548- }; /* epd293_init_sequence_full [] */
3621+ }; /* epd293_init_sequence_part [] */
35493622
35503623const uint8_t epd293_lut[] =
35513624{
@@ -3563,13 +3636,21 @@ void EPD293_Begin(OBDISP *pOBD, int x, int y, int w, int h, int bPartial)
35633636 (void )w;
35643637 (void )h;
35653638 if (bPartial) {
3566- EPDSendCMDSequence (pOBD, epd293_init_sequence_part);
3567- // send LUT
3568- obdWriteCommand (pOBD, 0x32 );
3569- memcpy_P (u8Cache, epd293_lut_partial, sizeof (epd293_lut_partial));
3570- RawWriteData (pOBD, u8Cache, sizeof (epd293_lut_partial));
3639+ if (pOBD->pInitFull == epd294_init_sequence_full) { // 294
3640+ // send LUT
3641+ obdWriteCommand (pOBD, 0x32 );
3642+ memcpy_P (u8Cache, epd294_lut_partial, sizeof (epd294_lut_partial));
3643+ RawWriteData (pOBD, u8Cache, sizeof (epd294_lut_partial));
3644+ EPDSendCMDSequence (pOBD, epd294_init_sequence_part);
3645+ } else {
3646+ EPDSendCMDSequence (pOBD, epd293_init_sequence_part);
3647+ // send LUT
3648+ obdWriteCommand (pOBD, 0x32 );
3649+ memcpy_P (u8Cache, epd293_lut_partial, sizeof (epd293_lut_partial));
3650+ RawWriteData (pOBD, u8Cache, sizeof (epd293_lut_partial));
3651+ }
35713652 } else {
3572- EPDSendCMDSequence (pOBD, epd293_init_sequence_full );
3653+ EPDSendCMDSequence (pOBD, pOBD-> pInitFull );
35733654 }
35743655} /* EPD293_Begin() */
35753656
@@ -4412,7 +4493,7 @@ int i, tx, ty;
44124493 }
44134494 RawWriteData (pOBD, uc, 4 );
44144495 // set ram counter to start of this region
4415- EPD_CMD2 (pOBD, SSD1608_SET_RAMXCOUNT, tx);
4496+ EPD_CMD2 (pOBD, SSD1608_SET_RAMXCOUNT, tx+pOBD-> x_offset );
44164497 uc[0 ] = ty;
44174498 uc[1 ] = (ty>>8 );
44184499 obdWriteCommand (pOBD, SSD1608_SET_RAMYCOUNT);
0 commit comments