start of the epd. Problem right now 0xff display black. Will have to investigate
This commit is contained in:
Submodule
+1
Submodule Client/.tmp_seeed_gfx added at eefdf5f3fb
@@ -0,0 +1,62 @@
|
||||
# EPD Reference Driver — GDEY075T7 (UC8179)
|
||||
|
||||
## Source
|
||||
|
||||
**Repository:** [ekosboard/firmware](https://github.com/ekosboard/firmware)
|
||||
**File:** [`src/components/EPD/driver/epd_GDEY075T7.c`](https://github.com/ekosboard/firmware/blob/main/src/components/EPD/driver/epd_GDEY075T7.c)
|
||||
|
||||
## Panel Info
|
||||
|
||||
- **Controller:** UC8179
|
||||
- **Panel:** GDEY075T7 (Good Display 7.5" B/W, 800×480)
|
||||
- **Platform:** ESP-IDF (native SPI)
|
||||
- **Grayscale:** 4-level support present but marked as "NOT TESTED"
|
||||
|
||||
## Key Implementation Details
|
||||
|
||||
### BUSY Pin Polarity
|
||||
- **Reference driver:** HIGH = Busy, LOW = Idle
|
||||
- **⚠️ Our board is INVERTED:** LOW = Busy, HIGH = Idle
|
||||
- Wait loop polls `gpio_get_level(BUSY) == 0` to detect idle (reference)
|
||||
- Our code uses `== 0` to wait while busy (opposite meaning, same code pattern)
|
||||
|
||||
### Clear Screen (White)
|
||||
- Writes `0xFF` to **both** old (0x10) and new (0x13) data layers
|
||||
- `0xFF` = White, `0x00` = Black
|
||||
|
||||
### Display Image
|
||||
- Writes `0x00` to old data layer (0x10) — assumes previous state was black
|
||||
- Writes actual image data to new data layer (0x13)
|
||||
|
||||
### Sleep Sequence
|
||||
1. `0x50` with `0xF7` — VCOM and data interval setting before sleep
|
||||
2. `0x02` — Power Off
|
||||
3. Wait for BUSY idle
|
||||
4. `0x07` + `0xA5` — Deep Sleep
|
||||
|
||||
### Init Sequence (Full Refresh)
|
||||
1. Hardware reset (RST low 10ms, high 10ms)
|
||||
2. `0x01` — Power Setting: VGH=20V, VGL=-20V, VDH=15V, VDL=-15V, VDHR=4.2V
|
||||
3. `0x06` — Booster Soft Start: 0x17, 0x17, 0x28, 0x17
|
||||
4. `0x04` — Power On + 100ms delay + wait busy
|
||||
5. `0x00` — Panel Setting: `0x1F` (KW B/W mode)
|
||||
6. `0x61` — Resolution: 800×480
|
||||
7. `0x15` — DUSPI disabled
|
||||
8. `0x50` — VCOM: 0x10, 0x07
|
||||
9. `0x60` — TCON: 0x22
|
||||
10. `0xE3` — PWS: 0x22
|
||||
|
||||
### Fast Refresh
|
||||
- `0xE0` → `0x02` (enable fast mode)
|
||||
- `0xE5` → `0x5A` (fast refresh timing)
|
||||
|
||||
### Partial Update
|
||||
- Uses `0x91` (partial in) / `0x92` (partial out) + `0x90` (resolution setting)
|
||||
- Writes `~data` (inverted) to old layer to force transitions
|
||||
- Sets `0x50` → `0x21` (N2OCP disabled) for partial mode
|
||||
|
||||
### 4-Level Grayscale
|
||||
- Requires different booster settings: `0x27, 0x27, 0x18, 0x17`
|
||||
- `0xE5` → `0x5F` for grayscale timing
|
||||
- Data encoding: 2 bits per pixel (0xC0=white, 0x00=black, 0x80=gray1, 0x40=gray2)
|
||||
- Old layer and new layer encode different bit planes, both inverted (`~temp3`)
|
||||
@@ -1,4 +1,12 @@
|
||||
dependencies:
|
||||
epd:
|
||||
dependencies:
|
||||
- name: idf
|
||||
version: '>=5.0.0'
|
||||
source:
|
||||
path: C:\Dev\Classified\Calendink\components\epd
|
||||
type: local
|
||||
version: 1.0.0
|
||||
espressif/ethernet_init:
|
||||
component_hash: 9f7d29acf5fe32315579ddb6247388291cda555aa529409108c0ada0aa7cd99d
|
||||
dependencies:
|
||||
@@ -164,11 +172,12 @@ dependencies:
|
||||
type: local
|
||||
version: 1.0.0
|
||||
direct_dependencies:
|
||||
- epd
|
||||
- espressif/mdns
|
||||
- http_client
|
||||
- idf
|
||||
- led
|
||||
- network
|
||||
manifest_hash: 097f2b35eb7bfe4a05687f2391f9fd078cab6437b8459fd420c47d1fa7a3c3d4
|
||||
manifest_hash: 534458d93ffd9c5d8b40be759ddfb47940a38560cb0565b9d0ba18f8ec7510b7
|
||||
target: esp32c6
|
||||
version: 2.0.0
|
||||
|
||||
@@ -2,4 +2,5 @@ idf_component_register(SRCS "main.cpp" "provider.cpp"
|
||||
PRIV_REQUIRES driver nvs_flash
|
||||
esp_event esp_timer
|
||||
led network http_client mdns
|
||||
epd
|
||||
INCLUDE_DIRS ".")
|
||||
|
||||
@@ -9,3 +9,5 @@ dependencies:
|
||||
path: "../../components/led"
|
||||
http_client:
|
||||
path: "../../components/http_client"
|
||||
epd:
|
||||
path: "../../components/epd"
|
||||
|
||||
+43
-32
@@ -1,3 +1,4 @@
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
|
||||
#include "esp_event.h"
|
||||
@@ -9,6 +10,7 @@
|
||||
#include "nvs_flash.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#include "epd.hpp"
|
||||
#include "led.hpp"
|
||||
#include "network.hpp"
|
||||
#include "provider.hpp"
|
||||
@@ -33,45 +35,54 @@ extern "C" void app_main()
|
||||
setup_led();
|
||||
|
||||
// Connect to WiFi
|
||||
ESP_LOGI(TAG, "Initializing WiFi connection");
|
||||
initialize_network();
|
||||
|
||||
esp_err_t err = connect_wifi(CONFIG_CALENDINK_WIFI_SSID,
|
||||
CONFIG_CALENDINK_WIFI_PASSWORD, false);
|
||||
|
||||
if (err == ESP_OK)
|
||||
if (false)
|
||||
{
|
||||
uint8_t retries = 1;
|
||||
do
|
||||
ESP_LOGI(TAG, "Initializing WiFi connection");
|
||||
initialize_network();
|
||||
|
||||
esp_err_t err = connect_wifi(CONFIG_CALENDINK_WIFI_SSID,
|
||||
CONFIG_CALENDINK_WIFI_PASSWORD, false);
|
||||
|
||||
if (err == ESP_OK)
|
||||
{
|
||||
err = check_wifi_connection(retries);
|
||||
if (err != ESP_OK)
|
||||
uint8_t retries = 1;
|
||||
do
|
||||
{
|
||||
ESP_LOGW(TAG, "WiFi connection check timeout, retrying... (%d)",
|
||||
retries);
|
||||
led_blink_number(3, 255, 0, 0);
|
||||
}
|
||||
retries++;
|
||||
} while (err == ESP_ERR_TIMEOUT &&
|
||||
retries <= CONFIG_CALENDINK_WIFI_RETRIES);
|
||||
}
|
||||
err = check_wifi_connection(retries);
|
||||
if (err != ESP_OK)
|
||||
{
|
||||
ESP_LOGW(TAG, "WiFi connection check timeout, retrying... (%d)",
|
||||
retries);
|
||||
led_blink_number(3, 255, 0, 0);
|
||||
}
|
||||
retries++;
|
||||
} while (err == ESP_ERR_TIMEOUT &&
|
||||
retries <= CONFIG_CALENDINK_WIFI_RETRIES);
|
||||
}
|
||||
|
||||
if (err == ESP_OK)
|
||||
{
|
||||
ESP_LOGI(TAG, "Successfully connected to WiFi!");
|
||||
test_provider_communication();
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGE(TAG, "Failed to connect to WiFi.");
|
||||
if (err == ESP_OK)
|
||||
{
|
||||
ESP_LOGI(TAG, "Successfully connected to WiFi!");
|
||||
test_provider_communication();
|
||||
}
|
||||
else
|
||||
{
|
||||
ESP_LOGE(TAG, "Failed to connect to WiFi.");
|
||||
}
|
||||
}
|
||||
|
||||
turn_off_led();
|
||||
|
||||
while (true)
|
||||
{
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
}
|
||||
ESP_LOGI(TAG, "Initializing EPD");
|
||||
epd_init();
|
||||
epd_init_display();
|
||||
epd_clear(epd_color_t::WHITE);
|
||||
epd_refresh();
|
||||
epd_shutdown_display();
|
||||
|
||||
shutdown_network();
|
||||
if (false)
|
||||
{
|
||||
disconnect_wifi();
|
||||
shutdown_network();
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user