-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#393 start with VCOM measuring example
- Loading branch information
1 parent
aad8e95
commit 0c8a4af
Showing
12 changed files
with
32,605 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(app_sources "main.c") | ||
|
||
idf_component_register(SRCS ${app_sources} REQUIRES epdiy) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* 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 "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; | ||
EpdRect dragon_area = { .x = 0, .y = 0, .width = dragon_width, .height = dragon_height }; | ||
|
||
void idf_loop() { | ||
epd_fullclear(&hl, temperature); | ||
epd_copy_to_framebuffer(dragon_area, dragon_data, epd_hl_get_framebuffer(&hl)); | ||
// Supposedly to measure VCOM the display needs to update | ||
// all the time with a NULL waveform (That we don't know how it is) | ||
// MODE_GC16 or MODE_DU ? | ||
//epd_fill_rect(epd_full_screen(), 0, epd_hl_get_framebuffer(&hl)); | ||
epd_hl_update_screen(&hl, MODE_DU, temperature); | ||
|
||
tps_vcom_kickback_rdy(); | ||
vTaskDelay(20); | ||
/* | ||
epd_fill_rect(epd_full_screen(), 255, epd_hl_get_framebuffer(&hl)); | ||
epd_hl_update_screen(&hl, MODE_GC16, temperature); | ||
vTaskDelay(100); */ | ||
} | ||
|
||
void idf_setup() { | ||
epd_init(&DEMO_BOARD, &ED097TC2, EPD_LUT_64K); | ||
hl = epd_hl_init(EPD_BUILTIN_WAVEFORM); | ||
|
||
|
||
tps_vcom_kickback(); | ||
tps_vcom_kickback_start(); | ||
|
||
while ( 1 ) { | ||
idf_loop(); | ||
} | ||
} | ||
|
||
#ifndef ARDUINO_ARCH_ESP32 | ||
void app_main() { | ||
idf_setup(); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |
Empty file.
Oops, something went wrong.