add ssd1677 driver

This commit is contained in:
Shuanglei Tao
2025-10-13 21:39:59 +08:00
parent b09b26eba4
commit c1d81ed0ae
4 changed files with 43 additions and 6 deletions

View File

@@ -325,6 +325,8 @@ extern epd_model_t epd_uc8179_750_bw;
extern epd_model_t epd_uc8179_750_bwr;
extern epd_model_t epd_ssd1619_420_bwr;
extern epd_model_t epd_ssd1619_420_bw;
extern epd_model_t epd_ssd1677_750_bwr;
extern epd_model_t epd_ssd1677_750_bw;
extern epd_model_t epd_jd79668_420;
static epd_model_t *epd_models[] = {
@@ -336,6 +338,8 @@ static epd_model_t *epd_models[] = {
&epd_uc8179_750_bwr,
&epd_ssd1619_420_bwr,
&epd_ssd1619_420_bw,
&epd_ssd1677_750_bwr,
&epd_ssd1677_750_bw,
&epd_jd79668_420,
};

View File

@@ -50,6 +50,8 @@ typedef enum
EPD_UC8179_750_BWR = 7,
EPD_UC8159_750_LOW_BW = 8,
EPD_UC8159_750_LOW_BWR = 9,
EPD_SSD1677_750_HD_BW = 10,
EPD_SSD1677_750_HD_BWR = 11,
} epd_model_id_t;
typedef enum

View File

@@ -79,13 +79,27 @@ int8_t SSD16xx_Read_Temp(void)
static void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
{
epd_model_t *EPD = epd_get();
EPD_Write(CMD_ENTRY_MODE, 0x03); // set ram entry mode: x increase, y increase
EPD_Write(CMD_RAM_XPOS, x / 8, (x + w - 1) / 8);
if (EPD->id == EPD_SSD1677_750_HD_BW || EPD->id == EPD_SSD1677_750_HD_BWR) {
EPD_Write(CMD_RAM_XPOS,
x % 256, x / 256,
(x + w - 1) % 256,
(x + w - 1) / 256);
EPD_Write(CMD_RAM_XCOUNT, x % 256, x / 256);
} else {
EPD_Write(CMD_RAM_XPOS, x / 8, (x + w - 1) / 8);
EPD_Write(CMD_RAM_YPOS,
y % 256, y / 256,
(y + h - 1) % 256,
(y + h - 1) / 256);
EPD_Write(CMD_RAM_XCOUNT, x / 8);
}
EPD_Write(CMD_RAM_YPOS,
y % 256, y / 256,
(y + h - 1) % 256,
(y + h - 1) / 256);
EPD_Write(CMD_RAM_XCOUNT, x / 8);
y % 256, y / 256,
(y + h - 1) % 256,
(y + h - 1) / 256);
EPD_Write(CMD_RAM_YCOUNT, y % 256, y / 256);
}
@@ -222,3 +236,21 @@ const epd_model_t epd_ssd1619_420_bw = {
.width = 400,
.height = 300,
};
// SSD1677 880x528 Black/White/Red
const epd_model_t epd_ssd1677_750_bwr = {
.id = EPD_SSD1677_750_HD_BWR,
.color = BWR,
.drv = &epd_drv_ssd1619,
.width = 880,
.height = 528,
};
// SSD1677 880x528 Black/White
const epd_model_t epd_ssd1677_750_bw = {
.id = EPD_SSD1677_750_HD_BW,
.color = BW,
.drv = &epd_drv_ssd1619,
.width = 880,
.height = 528,
};

View File

@@ -87,7 +87,6 @@ static void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h)
uint16_t xe = (x + w - 1) | 0x0007; // byte boundary inclusive (last byte)
uint16_t ye = y + h - 1;
x &= 0xFFF8; // byte boundary
xe |= 0x0007; // byte boundary
EPD_Write(CMD_PTL, // partial window
x / 256, x % 256,
xe / 256, xe % 256,