mirror of
https://github.com/tsl0922/EPD-nRF5.git
synced 2025-12-07 15:52:49 +08:00
add ssd1677 driver
This commit is contained in:
@@ -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_uc8179_750_bwr;
|
||||||
extern epd_model_t epd_ssd1619_420_bwr;
|
extern epd_model_t epd_ssd1619_420_bwr;
|
||||||
extern epd_model_t epd_ssd1619_420_bw;
|
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;
|
extern epd_model_t epd_jd79668_420;
|
||||||
|
|
||||||
static epd_model_t *epd_models[] = {
|
static epd_model_t *epd_models[] = {
|
||||||
@@ -336,6 +338,8 @@ static epd_model_t *epd_models[] = {
|
|||||||
&epd_uc8179_750_bwr,
|
&epd_uc8179_750_bwr,
|
||||||
&epd_ssd1619_420_bwr,
|
&epd_ssd1619_420_bwr,
|
||||||
&epd_ssd1619_420_bw,
|
&epd_ssd1619_420_bw,
|
||||||
|
&epd_ssd1677_750_bwr,
|
||||||
|
&epd_ssd1677_750_bw,
|
||||||
&epd_jd79668_420,
|
&epd_jd79668_420,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ typedef enum
|
|||||||
EPD_UC8179_750_BWR = 7,
|
EPD_UC8179_750_BWR = 7,
|
||||||
EPD_UC8159_750_LOW_BW = 8,
|
EPD_UC8159_750_LOW_BW = 8,
|
||||||
EPD_UC8159_750_LOW_BWR = 9,
|
EPD_UC8159_750_LOW_BWR = 9,
|
||||||
|
EPD_SSD1677_750_HD_BW = 10,
|
||||||
|
EPD_SSD1677_750_HD_BWR = 11,
|
||||||
} epd_model_id_t;
|
} epd_model_id_t;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|||||||
@@ -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)
|
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_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,
|
EPD_Write(CMD_RAM_YPOS,
|
||||||
y % 256, y / 256,
|
y % 256, y / 256,
|
||||||
(y + h - 1) % 256,
|
(y + h - 1) % 256,
|
||||||
(y + h - 1) / 256);
|
(y + h - 1) / 256);
|
||||||
EPD_Write(CMD_RAM_XCOUNT, x / 8);
|
|
||||||
EPD_Write(CMD_RAM_YCOUNT, y % 256, y / 256);
|
EPD_Write(CMD_RAM_YCOUNT, y % 256, y / 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,3 +236,21 @@ const epd_model_t epd_ssd1619_420_bw = {
|
|||||||
.width = 400,
|
.width = 400,
|
||||||
.height = 300,
|
.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,
|
||||||
|
};
|
||||||
|
|||||||
@@ -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 xe = (x + w - 1) | 0x0007; // byte boundary inclusive (last byte)
|
||||||
uint16_t ye = y + h - 1;
|
uint16_t ye = y + h - 1;
|
||||||
x &= 0xFFF8; // byte boundary
|
x &= 0xFFF8; // byte boundary
|
||||||
xe |= 0x0007; // byte boundary
|
|
||||||
EPD_Write(CMD_PTL, // partial window
|
EPD_Write(CMD_PTL, // partial window
|
||||||
x / 256, x % 256,
|
x / 256, x % 256,
|
||||||
xe / 256, xe % 256,
|
xe / 256, xe % 256,
|
||||||
|
|||||||
Reference in New Issue
Block a user