Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#381 Add Lilygo S3 board #383

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ set(app_sources "src/epdiy.c"
"src/board/epd_board.c"
"src/board/epd_board_common.c"
"src/board/epd_board_lilygo_t5_47.c"
"src/board/lilygo_board_s3.c"
"src/board/epd_board_v2_v3.c"
"src/board/epd_board_v4.c"
"src/board/epd_board_v5.c"
Expand Down
4 changes: 4 additions & 0 deletions examples/lilygo_s3/CMakeLists.txt
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)
11 changes: 11 additions & 0 deletions examples/lilygo_s3/README.md
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
3 changes: 3 additions & 0 deletions examples/lilygo_s3/main/CMakeLists.txt
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)
30,942 changes: 30,942 additions & 0 deletions examples/lilygo_s3/main/dragon.h

Large diffs are not rendered by default.

47 changes: 47 additions & 0 deletions examples/lilygo_s3/main/main.c
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
30 changes: 30 additions & 0 deletions examples/lilygo_s3/main/main.ino
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.
Loading
Loading