add SSD1619 bw model

This commit is contained in:
Shuanglei Tao
2025-03-13 15:28:30 +08:00
parent d719f38afe
commit da43f28cf0
5 changed files with 19 additions and 5 deletions

View File

@@ -299,12 +299,14 @@ void EPD_LED_TOGGLE(void)
extern epd_model_t epd_uc8176_420_bw;
extern epd_model_t epd_uc8176_420_bwr;
extern epd_model_t epd_ssd1619_420_bwr;
extern epd_model_t epd_ssd1619_420_bw;
extern epd_model_t epd_uc8276_420_bwr;
static epd_model_t *epd_models[] = {
&epd_uc8176_420_bw,
&epd_uc8176_420_bwr,
&epd_ssd1619_420_bwr,
&epd_ssd1619_420_bw,
&epd_uc8276_420_bwr,
};

View File

@@ -50,6 +50,7 @@ typedef enum
EPD_UC8176_420_BW = 1,
EPD_UC8176_420_BWR = 3,
EPD_SSD1619_420_BWR = 2,
EPD_SSD1619_420_BW = 4,
EPD_UC8276_420_BWR = 5,
} epd_model_id_t;

View File

@@ -146,7 +146,7 @@ void SSD1619_Clear(void)
EPD_WriteCommand(CMD_WRITE_RAM2);
for (uint16_t j = 0; j < Height; j++) {
for (uint16_t i = 0; i < Width; i++) {
EPD_WriteByte(0x00);
EPD_WriteByte(EPD_BWR_MODE ? 0x00 : 0xFF);
}
}
@@ -169,7 +169,10 @@ void SSD1619_Write_Image(uint8_t *black, uint8_t *color, uint16_t x, uint16_t y,
EPD_WriteCommand(CMD_WRITE_RAM2);
for (uint16_t i = 0; i < h; i++) {
for (uint16_t j = 0; j < w / 8; j++) {
EPD_WriteByte(color ? ~color[j + i * wb] : 0x00);
if (EPD_BWR_MODE)
EPD_WriteByte(color ? ~color[j + i * wb] : 0x00);
else
EPD_WriteByte(black[j + i * wb]);
}
}
}
@@ -197,3 +200,10 @@ const epd_model_t epd_ssd1619_420_bwr = {
.res = EPD_RES_400x300,
.bwr = true,
};
const epd_model_t epd_ssd1619_420_bw = {
.id = EPD_SSD1619_420_BW,
.drv = &epd_drv_ssd1619,
.res = EPD_RES_400x300,
.bwr = false,
};

View File

@@ -48,6 +48,7 @@
<option value="01">UC8176黑白屏</option>
<option value="03">UC8176三色屏</option>
<option value="05">UC8276三色屏</option>
<option value="04">SSD1619黑白屏</option>
<option value="02">SSD1619三色屏</option>
</select>
<label for="epdpins">引脚</label>
@@ -83,7 +84,7 @@
<input type="file" id="image_file" onchange="update_image()" accept=".png,.jpg,.bmp,.webp,.jpeg">
<label for="dithering">取模算法</label>
<select id="dithering" title="取模算法" onchange="update_image()">
<optgroup data-driver="01" label="黑白">
<optgroup data-driver="01|04" label="黑白">
<option value="none">二值化</option>
<option value="bayer">bayer</option>
<option value="floydsteinberg">floydsteinberg</option>
@@ -116,7 +117,7 @@
<li><b>引脚配置:</b>格式为十六进制顺序MOSI/SCLK/CS/DC/RST/BUSY/BS/EN前面 7 个引脚配置为必须EN 为可选(没有用到的引脚可配置为 <code>FF</code></li>
<li><b>确认间隔: </b>这个间隔指的是数据包数量间隔,即发送此数量的不确认响应的数据包后才发送一次需确认响应的数据包。加大此值可优化传图速度,但是丢包风险也更大(你可能会发现图片有部分位置显示不正常,此时需调小这个值)
<li><b>指令列表: </b>支持的指令可在项目 README 查询(此功能一般只会在开发测试时用到)
<li><b>灰度:</b>目前仅 <code>EPD_4in2</code> 驱动支持 4 级灰度,其它驱动选择此选项结果未知</li>
<li><b>灰度:</b>目前仅 <code>UC8176黑白屏</code> 驱动支持 4 级灰度,其它驱动选择此选项结果未知</li>
<li><b>开源地址:</b>
<a href="https://github.com/tsl0922/EPD-nRF5">tsl0922/EPD-nRF5</a>,
交流群:<a href="https://qm.qq.com/q/SckzhfDxuu">1033086563</a>

View File

@@ -171,7 +171,7 @@ async function sendimg() {
await epdWrite(driver === "02" ? 0x24 : 0x10, imgArray.slice(0, ramSize));
await epdWrite(driver === "02" ? 0x26 : 0x13, imgArray.slice(ramSize));
} else {
await epdWrite(driver === "03" ? 0x10 : 0x13, imgArray);
await epdWrite(driver === "04" ? 0x24 : 0x13, imgArray);
}
if (mode === "4gray") {