mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 02:58:11 +01:00
Support inkplate 5 and 5 V2
Provide support for inkplate 5 and 5 V2
This commit is contained in:
parent
cf4bfcdce8
commit
2b404fdfb3
1 changed files with 31 additions and 2 deletions
|
@ -15,6 +15,8 @@ enum InkplateModel : uint8_t {
|
|||
INKPLATE_10 = 1,
|
||||
INKPLATE_6_PLUS = 2,
|
||||
INKPLATE_6_V2 = 3,
|
||||
INKPLATE_5 = 4,
|
||||
INKPLATE_5_V2 = 5,
|
||||
};
|
||||
|
||||
class Inkplate6 : public display::DisplayBuffer, public i2c::I2CDevice {
|
||||
|
@ -29,7 +31,7 @@ class Inkplate6 : public display::DisplayBuffer, public i2c::I2CDevice {
|
|||
const uint8_t pixelMaskLUT[8] = {0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80};
|
||||
const uint8_t pixelMaskGLUT[2] = {0x0F, 0xF0};
|
||||
|
||||
const uint8_t waveform3BitAll[4][8][9] = {// INKPLATE_6
|
||||
const uint8_t waveform3BitAll[6][8][9] = {// INKPLATE_6
|
||||
{{0, 1, 1, 0, 0, 1, 1, 0, 0},
|
||||
{0, 1, 2, 1, 1, 2, 1, 0, 0},
|
||||
{1, 1, 1, 2, 2, 1, 0, 0, 0},
|
||||
|
@ -64,7 +66,26 @@ class Inkplate6 : public display::DisplayBuffer, public i2c::I2CDevice {
|
|||
{1, 1, 1, 1, 2, 2, 1, 0, 0},
|
||||
{0, 1, 1, 1, 2, 2, 1, 0, 0},
|
||||
{0, 0, 0, 0, 1, 1, 2, 0, 0},
|
||||
{0, 0, 0, 0, 0, 1, 2, 0, 0}}};
|
||||
{0, 0, 0, 0, 0, 1, 2, 0, 0}},
|
||||
// INKPLATE_5
|
||||
{{0, 0, 1, 1, 0, 1, 1, 1, 0},
|
||||
{0, 1, 1, 1, 1, 2, 0, 1, 0},
|
||||
{1, 2, 2, 0, 2, 1, 1, 1, 0},
|
||||
{1, 1, 1, 2, 0, 1, 1, 2, 0},
|
||||
{0, 1, 1, 1, 2, 0, 1, 2, 0},
|
||||
{0, 0, 0, 1, 1, 2, 1, 2, 0},
|
||||
{1, 1, 1, 2, 0, 2, 1, 2, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0}},
|
||||
// INKPLATE_5_V2
|
||||
{{0, 0, 1, 1, 2, 1, 1, 1, 0},
|
||||
{1, 1, 2, 2, 1, 2, 1, 1, 0},
|
||||
{0, 1, 2, 2, 1, 1, 2, 1, 0},
|
||||
{0, 0, 1, 1, 1, 1, 1, 2, 0},
|
||||
{1, 2, 1, 2, 1, 1, 1, 2, 0},
|
||||
{0, 1, 1, 1, 2, 0, 1, 2, 0},
|
||||
{1, 1, 1, 2, 2, 2, 1, 2, 0},
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0}}
|
||||
};
|
||||
|
||||
void set_greyscale(bool greyscale) {
|
||||
this->greyscale_ = greyscale;
|
||||
|
@ -146,6 +167,10 @@ class Inkplate6 : public display::DisplayBuffer, public i2c::I2CDevice {
|
|||
return 800;
|
||||
} else if (this->model_ == INKPLATE_10) {
|
||||
return 1200;
|
||||
} else if (this->model_ == INKPLATE_5) {
|
||||
return 960;
|
||||
} else if (this->model_ == INKPLATE_5_V2) {
|
||||
return 1280;
|
||||
} else if (this->model_ == INKPLATE_6_PLUS) {
|
||||
return 1024;
|
||||
}
|
||||
|
@ -155,6 +180,10 @@ class Inkplate6 : public display::DisplayBuffer, public i2c::I2CDevice {
|
|||
int get_height_internal() override {
|
||||
if (this->model_ == INKPLATE_6 || this->model_ == INKPLATE_6_V2) {
|
||||
return 600;
|
||||
} else if (this->model_ == INKPLATE_5) {
|
||||
return 540;
|
||||
} else if (this->model_ == INKPLATE_5_V2) {
|
||||
return 720;
|
||||
} else if (this->model_ == INKPLATE_10) {
|
||||
return 825;
|
||||
} else if (this->model_ == INKPLATE_6_PLUS) {
|
||||
|
|
Loading…
Reference in a new issue