-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#381 Add Lilygo S3 board (untested with hardware)
- Loading branch information
1 parent
cbdaaa7
commit 10fbc27
Showing
12 changed files
with
34,267 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
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,11 @@ | ||
A demo showing a Full-Screen Image | ||
================================== | ||
|
||
This demo is temporary only to test Lilygo new S3 display: | ||
https://github.com/Xinyuan-LilyGO/LilyGo-EPD47/issues/93 | ||
|
||
*The image size is chosen to fit a 1200 * 825 display!* | ||
|
||
(so the dragon is too big for this one but it doesn't matter for this test) | ||
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,47 @@ | ||
/* 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" | ||
|
||
EpdiyHighlevelState hl; | ||
|
||
// This demo is only for new Lilygo S3 board | ||
#define DEMO_BOARD lilygo_board_s3 | ||
|
||
|
||
void idf_loop() { | ||
EpdRect dragon_area = { .x = 0, .y = 0, .width = dragon_width, .height = dragon_height }; | ||
|
||
int temperature = 25; | ||
|
||
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(); | ||
// 10 secs delay | ||
vTaskDelay(pdMS_TO_TICKS(10000)); | ||
} | ||
|
||
void idf_setup() { | ||
epd_init(&DEMO_BOARD, &ED047TC1, EPD_LUT_64K); | ||
epd_set_vcom(1560); // No idea what is the best but doesn't matter much for now | ||
hl = epd_hl_init(EPD_BUILTIN_WAVEFORM); | ||
} | ||
|
||
#ifndef ARDUINO_ARCH_ESP32 | ||
void app_main() { | ||
idf_setup(); | ||
|
||
while (1) { | ||
idf_loop(); | ||
}; | ||
} | ||
#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.