Прошло 2 года.

This commit is contained in:
Кобелев Андрей Андреевич
2026-03-10 22:54:23 +03:00
parent c7636ebd6f
commit a111352dc5
313 changed files with 274971 additions and 1409 deletions

View File

@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.16.0)
set(EXTRA_COMPONENT_DIRS "../../")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(dragon_example)

View File

@@ -0,0 +1,7 @@
A demo showing a Full-Screen Image
==================================
*The image size is chosen to fit a 1200 * 825 display!*
Image by David REVOY / CC BY (https://creativecommons.org/licenses/by/3.0)
https://commons.wikimedia.org/wiki/File:Durian_-_Sintel-wallpaper-dragon.jpg

View File

@@ -0,0 +1,3 @@
set(app_sources "main.c")
idf_component_register(SRCS ${app_sources} REQUIRES epdiy)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
/* Simple firmware for a ESP32 displaying a static image on an EPaper Screen */
#include "esp_heap_caps.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "dragon.h"
#include "epd_highlevel.h"
#include "epdiy.h"
#include "board/tps65185.h"
EpdiyHighlevelState hl;
// choose the default demo board depending on the architecture
#ifdef CONFIG_IDF_TARGET_ESP32
#define DEMO_BOARD epd_board_v6
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
#define DEMO_BOARD epd_board_v7
#endif
int temperature = 25;
void draw_dragon() {
EpdRect dragon_area = { .x = 0, .y = 0, .width = dragon_width, .height = dragon_height };
epd_poweron();
epd_fullclear(&hl, temperature);
epd_copy_to_framebuffer(dragon_area, dragon_data, epd_hl_get_framebuffer(&hl));
enum EpdDrawError _err = epd_hl_update_screen(&hl, MODE_GC16, temperature);
epd_poweroff();
}
void idf_loop() {
// make a full black | white print to force epdiy to send the update
epd_fill_rect(epd_full_screen(), 0, epd_hl_get_framebuffer(&hl));
epd_hl_update_screen(&hl, MODE_DU, temperature);
vTaskDelay(pdMS_TO_TICKS(1));
epd_fill_rect(epd_full_screen(), 255, epd_hl_get_framebuffer(&hl));
epd_hl_update_screen(&hl, MODE_DU, temperature);
}
void idf_setup() {
epd_init(&DEMO_BOARD, &ED097TC2, EPD_LUT_64K);
hl = epd_hl_init(&epdiy_NULL);
// starts the board in kickback more
tps_vcom_kickback();
// display starts to pass BLACK to WHITE but doing nothing+
// dince the NULL waveform is full of 0 "Do nothing for each pixel"
idf_loop();
// start measure and set ACQ bit:
tps_vcom_kickback_start();
int isrdy = 1;
int kickback_volt = 0;
while (kickback_volt == 0) {
idf_loop();
isrdy++;
kickback_volt = tps_vcom_kickback_rdy();
}
ESP_LOGI("vcom", "readings are of %d mV. It was ready in %d refreshes", kickback_volt, isrdy);
vTaskDelay(pdMS_TO_TICKS(2000));
esp_restart();
}
#ifndef ARDUINO_ARCH_ESP32
void app_main() {
idf_setup();
}
#endif

View File

@@ -0,0 +1,30 @@
/**
* This is the Arduino wrapper for the "Demo" example.
* Please go to the main.c for the main example file.
*
* This example was developed for the ESP IoT Development Framework (IDF).
* You can still use this code in the Arduino IDE, but it may not look
* and feel like a classic Arduino sketch.
* If you are looking for an example with Arduino look-and-feel,
* please check the other examples.
*/
// Important: These are C functions, so they must be declared with C linkage!
extern "C" {
void idf_setup();
void idf_loop();
}
void setup() {
if (psramInit()) {
Serial.println("\nThe PSRAM is correctly initialized");
} else {
Serial.println("\nPSRAM does not work");
}
idf_setup();
}
void loop() {
idf_loop();
}

File diff suppressed because it is too large Load Diff