add 7.5" and fix UC8179 begin

This commit is contained in:
ladyada 2025-08-06 11:14:09 -04:00
parent a612173810
commit d488075fb4
6 changed files with 82 additions and 6 deletions

View file

@ -252,7 +252,7 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
// Serial.printf("(%d, %d) : ", x, y);
uint16_t addr;
if (_data_entry_mode == THINKING_UC8179) {
if (_data_entry_mode == THINKINK_UC8179) {
addr = ((uint32_t)(HEIGHT - 1 - y) * (uint32_t)WIDTH + x) / 8;
} else { // THINKINK_STANDARD default!
addr = ((uint32_t)(WIDTH - 1 - x) * (uint32_t)_HEIGHT + y) / 8;
@ -276,7 +276,7 @@ void Adafruit_EPD::drawPixel(int16_t x, int16_t y, uint16_t color) {
color_bit = layer_colors[color] & 0x2;
uint8_t bit_idx;
if (_data_entry_mode == THINKING_UC8179) {
if (_data_entry_mode == THINKINK_UC8179) {
bit_idx = x;
} else { // THINKINK_STANDARD default!
bit_idx = y;

View file

@ -46,8 +46,8 @@ enum {
};
typedef enum {
THINKINK_STANDARD, // 99% of panels use this setup!
THINKING_UC8179, // .... except for UC8179?
THINKINK_STANDARD = 0, // 99% of panels use this setup!
THINKINK_UC8179 = 1, // .... except for UC8179?
} thinkink_sramentrymode_t;
typedef enum {

View file

@ -46,5 +46,6 @@
#include "panels/ThinkInk_583_Mono_AAAMFGN.h"
#include "panels/ThinkInk_583_Tricolor_AABMFGNR.h"
#include "panels/ThinkInk_750_Tricolor_AABMFGNR.h"
#include "panels/ThinkInk_750_Mono_AAAMFGN.h"
#endif // _ADAFRUIT_THINKINK_H_

View file

@ -137,7 +137,7 @@ void Adafruit_UC8179::busy_wait(void) {
/**************************************************************************/
void Adafruit_UC8179::begin(bool reset) {
// UUUUGH, SRAM is not organized the same way for this chip?
_data_entry_mode = THINKING_UC8179;
_data_entry_mode = THINKINK_UC8179;
Adafruit_EPD::begin(reset);
setBlackBuffer(0, true); // black defaults to inverted

View file

@ -53,7 +53,7 @@ class ThinkInk_583_Mono_AAAMFGN : public Adafruit_UC8179 {
: Adafruit_UC8179(648, 480, DC, RST, CS, SRCS, BUSY, spi){};
void begin(thinkinkmode_t mode = THINKINK_MONO) {
Adafruit_EPD::begin(true);
Adafruit_UC8179::begin(true);
setColorBuffer(1, false); // layer 1 uninverted
setBlackBuffer(1, false); // only one buffer

View file

@ -0,0 +1,75 @@
#ifndef _THINKINK_750_MONO_AAAMFGN_H
#define _THINKINK_750_MONO_AAAMFGN_H
#include "Adafruit_EPD.h"
const uint8_t uc8179_750_mono_init_code[]{UC8179_POWERSETTING,
4,
0x07, // VGH=20V
0x07, // VGL=-20V
0x3F, // VDH=15V
0x3F, // VDL=-15V
UC8179_POWERON,
0,
0xFF,
100, // busy wait
UC8179_PANELSETTING,
1,
0b010111, // BW OTP LUT
UC8179_TRES,
4,
0x03,
0x20,
0x01,
0xE0,
UC8179_DUALSPI,
1,
0x00,
UC8179_WRITE_VCOM,
2,
0x10,
0x07,
UC8179_TCON,
1,
0x22,
0xFE};
class ThinkInk_750_Mono_AAAMFGN : public Adafruit_UC8179 {
private:
public:
ThinkInk_750_Mono_AAAMFGN(int16_t SID, int16_t SCLK, int16_t DC, int16_t RST,
int16_t CS, int16_t SRCS, int16_t MISO,
int16_t BUSY = -1)
: Adafruit_UC8179(800, 480, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
ThinkInk_750_Mono_AAAMFGN(int16_t DC, int16_t RST, int16_t CS, int16_t SRCS,
int16_t BUSY = -1, SPIClass* spi = &SPI)
: Adafruit_UC8179(800, 480, DC, RST, CS, SRCS, BUSY, spi){};
void begin(thinkinkmode_t mode = THINKINK_MONO) {
Adafruit_EPD::begin(true);
setColorBuffer(1, false); // layer 1 uninverted
setBlackBuffer(1, false); // only one buffer
_epd_init_code = uc8179_750_mono_init_code;
layer_colors[EPD_WHITE] = 0b00;
layer_colors[EPD_BLACK] = 0b01;
layer_colors[EPD_RED] = 0b10;
layer_colors[EPD_GRAY] = 0b10;
layer_colors[EPD_LIGHT] = 0b00;
layer_colors[EPD_DARK] = 0b01;
default_refresh_delay = 3000;
setRotation(0);
// DO NOT power down again!
};
};
#endif // _THINKINK_750_MONO_AAAMFGN