18  GxEPD2_EPD(cs, dc, rst, busy, HIGH, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate)
 
 
   33  _writeScreenBuffer(0x24, value); 
 
 
   40  _writeScreenBuffer(0x26, value); 
 
   41  _writeScreenBuffer(0x24, value); 
 
 
   44void GxEPD2_150_BN::_writeScreenBuffer(uint8_t command, uint8_t value)
 
   47  for (uint32_t i = 0; i < uint32_t(
WIDTH) * uint32_t(
HEIGHT) / 8; i++)
 
   53void GxEPD2_150_BN::writeImage(
const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
   55  _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
   60  _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm);
 
   61  _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
   66  _writeImage(0x26, bitmap, x, y, w, h, invert, mirror_y, pgm); 
 
   67  _writeImage(0x24, bitmap, x, y, w, h, invert, mirror_y, pgm); 
 
 
   70void GxEPD2_150_BN::_writeImage(uint8_t command, 
const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
   74  int16_t wb = (w + 7) / 8; 
 
   77  int16_t x1 = x < 0 ? 0 : x; 
 
   78  int16_t y1 = y < 0 ? 0 : y; 
 
   79  int16_t w1 = x + w < int16_t(
WIDTH) ? w : int16_t(
WIDTH) - x; 
 
   80  int16_t h1 = y + h < int16_t(
HEIGHT) ? h : int16_t(
HEIGHT) - y; 
 
   85  if ((w1 <= 0) || (h1 <= 0)) 
return;
 
   87  _setPartialRamArea(x1, y1, w1, h1);
 
   89  for (int16_t i = 0; i < h1; i++)
 
   91    for (int16_t j = 0; j < w1 / 8; j++)
 
   95      int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb;
 
   98#if defined(__AVR) || defined(ESP8266) || defined(ESP32) 
   99        data = pgm_read_byte(&bitmap[idx]);
 
  108      if (invert) data = ~data;
 
  116                                    int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  118  _writeImagePart(0x24, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
  122    int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  124  _writeImagePart(0x26, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); 
 
  125  _writeImagePart(0x24, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); 
 
 
  128void GxEPD2_150_BN::_writeImagePart(uint8_t command, 
const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap,
 
  129                                     int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  133  if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) 
return;
 
  134  if ((x_part < 0) || (x_part >= w_bitmap)) 
return;
 
  135  if ((y_part < 0) || (y_part >= h_bitmap)) 
return;
 
  136  int16_t wb_bitmap = (w_bitmap + 7) / 8; 
 
  137  x_part -= x_part % 8; 
 
  138  w = w_bitmap - x_part < w ? w_bitmap - x_part : w; 
 
  139  h = h_bitmap - y_part < h ? h_bitmap - y_part : h; 
 
  141  w = 8 * ((w + 7) / 8); 
 
  142  int16_t x1 = x < 0 ? 0 : x; 
 
  143  int16_t y1 = y < 0 ? 0 : y; 
 
  144  int16_t w1 = x + w < int16_t(
WIDTH) ? w : int16_t(
WIDTH) - x; 
 
  145  int16_t h1 = y + h < int16_t(
HEIGHT) ? h : int16_t(
HEIGHT) - y; 
 
  150  if ((w1 <= 0) || (h1 <= 0)) 
return;
 
  152  _setPartialRamArea(x1, y1, w1, h1);
 
  154  for (int16_t i = 0; i < h1; i++)
 
  156    for (int16_t j = 0; j < w1 / 8; j++)
 
  160      int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap;
 
  163#if defined(__AVR) || defined(ESP8266) || defined(ESP32) 
  164        data = pgm_read_byte(&bitmap[idx]);
 
  173      if (invert) data = ~data;
 
  180void GxEPD2_150_BN::writeImage(
const uint8_t* black, 
const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  184    writeImage(black, x, y, w, h, invert, mirror_y, pgm);
 
 
  189                                    int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  193    writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
  197void GxEPD2_150_BN::writeNative(
const uint8_t* data1, 
const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  201    writeImage(data1, x, y, w, h, invert, mirror_y, pgm);
 
 
  205void GxEPD2_150_BN::drawImage(
const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  207  writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
  213                                   int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  215  writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
 
  217  writeImagePartAgain(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
  220void GxEPD2_150_BN::drawImage(
const uint8_t* black, 
const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  224    drawImage(black, x, y, w, h, invert, mirror_y, pgm);
 
 
  229                                   int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  233    drawImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm);
 
 
  237void GxEPD2_150_BN::drawNative(
const uint8_t* data1, 
const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, 
bool invert, 
bool mirror_y, 
bool pgm)
 
  241    drawImage(data1, x, y, w, h, invert, mirror_y, pgm);
 
 
  260  int16_t w1 = x < 0 ? w + x : w; 
 
  261  int16_t h1 = y < 0 ? h + y : h; 
 
  262  int16_t x1 = x < 0 ? 0 : x; 
 
  263  int16_t y1 = y < 0 ? 0 : y; 
 
  264  w1 = x1 + w1 < int16_t(
WIDTH) ? w1 : int16_t(
WIDTH) - x1; 
 
  265  h1 = y1 + h1 < int16_t(
HEIGHT) ? h1 : int16_t(
HEIGHT) - y1; 
 
  266  if ((w1 <= 0) || (h1 <= 0)) 
return; 
 
  269  if (w1 % 8 > 0) w1 += 8 - w1 % 8;
 
  272  _setPartialRamArea(x1, y1, w1, h1);
 
 
  292void GxEPD2_150_BN::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 
  311void GxEPD2_150_BN::_PowerOn()
 
  323void GxEPD2_150_BN::_PowerOff()
 
  336void GxEPD2_150_BN::_InitDisplay()
 
  353const unsigned char GxEPD2_150_BN::lut_partial[] 
PROGMEM =
 
  355    0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  356    0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  357    0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  358    0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  359    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  360    0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
 
  361    0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  362    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  363    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  364    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  365    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  366    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  367    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  368    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  369    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  370    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  371    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 
  372    0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
 
 
  375void GxEPD2_150_BN::_Init_Full()
 
  382void GxEPD2_150_BN::_Init_Part()
 
  391void GxEPD2_150_BN::_Update_Full()
 
  399void GxEPD2_150_BN::_Update_Part()
 
const unsigned char GxEPD2_150_BN::lut_partial[] PROGMEM
void drawNative(const uint8_t *data1, const uint8_t *data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
static const uint16_t HEIGHT
static const uint16_t full_refresh_time
void writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
GxEPD2_150_BN(int16_t cs, int16_t dc, int16_t rst, int16_t busy)
void writeScreenBufferAgain(uint8_t value=0xFF)
void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeScreenBuffer(uint8_t value=0xFF)
void clearScreen(uint8_t value=0xFF)
void writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
static const uint16_t power_off_time
static const uint16_t partial_refresh_time
static const uint16_t WIDTH
void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void writeNative(const uint8_t *data1, const uint8_t *data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void refresh(bool partial_update_mode=false)
static const uint16_t power_on_time
void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, int16_t x, int16_t y, int16_t w, int16_t h, bool invert=false, bool mirror_y=false, bool pgm=false)
void _writeCommand(uint8_t c)
void _writeData(uint8_t d)
void _waitWhileBusy(const char *comment=0, uint16_t busy_time=5000)
void _writeDataPGM(const uint8_t *data, uint16_t n, int16_t fill_with_zeroes=0)