diff --git a/.github/workflows/esp-idf_build.yml b/.github/workflows/esp-idf_build.yml new file mode 100644 index 0000000..cc7e967 --- /dev/null +++ b/.github/workflows/esp-idf_build.yml @@ -0,0 +1,26 @@ +name: Build the ESP-IDF Project + +on: + push: + pull_request: + +jobs: + build: + strategy: + matrix: + idf_ver: [release-v5.0, release-v5.1, release-v5.2] + idf_target: [esp32s3] + + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + with: + submodules: "recursive" + - name: ESP-IDF build + uses: espressif/esp-idf-ci-action@v1 + with: + esp_idf_version: ${{ matrix.idf_ver }} + target: ${{ matrix.idf_target }} + path: ePaper-ESP-IDF diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4094038 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SECRETS.md diff --git a/ePaper-ESP-IDF/.clang-format b/ePaper-ESP-IDF/.clang-format new file mode 100644 index 0000000..3f19e61 --- /dev/null +++ b/ePaper-ESP-IDF/.clang-format @@ -0,0 +1 @@ +BasedOnStyle: Chromium diff --git a/ePaper-ESP-IDF/.gitignore b/ePaper-ESP-IDF/.gitignore new file mode 100644 index 0000000..9bb5b6d --- /dev/null +++ b/ePaper-ESP-IDF/.gitignore @@ -0,0 +1,16 @@ +# esp-idf +build/ +sdkconfig +sdkconfig.old +managed_components + +# They ignored Idea (Webstorm) completely +.idea/ + +# However, they kept the following 4 files version controlled +.vscode/* +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +.history/* +__pycache__ diff --git a/ePaper-ESP-IDF/.vscode/launch.json b/ePaper-ESP-IDF/.vscode/launch.json new file mode 100644 index 0000000..6d2236f --- /dev/null +++ b/ePaper-ESP-IDF/.vscode/launch.json @@ -0,0 +1,10 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "espidf", + "name": "Launch", + "request": "launch" + } + ] +} \ No newline at end of file diff --git a/ePaper-ESP-IDF/.vscode/tasks.json b/ePaper-ESP-IDF/.vscode/tasks.json new file mode 100644 index 0000000..1dc7915 --- /dev/null +++ b/ePaper-ESP-IDF/.vscode/tasks.json @@ -0,0 +1,259 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Build - Build project", + "type": "shell", + "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py build", + "windows": { + "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py build", + "options": { + "env": { + "PATH": "${env:PATH};${config:idf.customExtraPaths}" + } + } + }, + "options": { + "env": { + "PATH": "${env:PATH}:${config:idf.customExtraPaths}" + } + }, + "problemMatcher": [ + { + "owner": "cpp", + "fileLocation": [ + "autoDetect", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + ], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "Set ESP-IDF Target", + "type": "shell", + "command": "${command:espIdf.setTarget}", + "problemMatcher": { + "owner": "cpp", + "fileLocation": [ + "autoDetect", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + }, + { + "label": "Clean - Clean the project", + "type": "shell", + "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py fullclean", + "windows": { + "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py fullclean", + "options": { + "env": { + "PATH": "${env:PATH};${config:idf.customExtraPaths}" + } + } + }, + "options": { + "env": { + "PATH": "${env:PATH}:${config:idf.customExtraPaths}" + } + }, + "problemMatcher": [ + { + "owner": "cpp", + "fileLocation": [ + "autoDetect", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + ] + }, + { + "label": "Flash - Flash the device", + "type": "shell", + "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.flashBaudRate} flash", + "windows": { + "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py flash -p ${config:idf.portWin} -b ${config:idf.flashBaudRate}", + "options": { + "env": { + "PATH": "${env:PATH};${config:idf.customExtraPaths}" + } + } + }, + "options": { + "env": { + "PATH": "${env:PATH}:${config:idf.customExtraPaths}" + } + }, + "problemMatcher": [ + { + "owner": "cpp", + "fileLocation": [ + "autoDetect", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + ] + }, + { + "label": "Monitor: Start the monitor", + "type": "shell", + "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} monitor", + "windows": { + "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py -p ${config:idf.portWin} monitor", + "options": { + "env": { + "PATH": "${env:PATH};${config:idf.customExtraPaths}" + } + } + }, + "options": { + "env": { + "PATH": "${env:PATH}:${config:idf.customExtraPaths}" + } + }, + "problemMatcher": [ + { + "owner": "cpp", + "fileLocation": [ + "autoDetect", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + ], + "dependsOn": "Flash - Flash the device" + }, + { + "label": "OpenOCD: Start openOCD", + "type": "shell", + "presentation": { + "echo": true, + "reveal": "never", + "focus": false, + "panel": "new" + }, + "command": "openocd -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}", + "windows": { + "command": "openocd.exe -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}", + "options": { + "env": { + "PATH": "${env:PATH};${config:idf.customExtraPaths}" + } + } + }, + "options": { + "env": { + "PATH": "${env:PATH}:${config:idf.customExtraPaths}" + } + }, + "problemMatcher": { + "owner": "cpp", + "fileLocation": [ + "autoDetect", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + }, + { + "label": "adapter", + "type": "shell", + "command": "${config:idf.pythonBinPath}", + "isBackground": true, + "options": { + "env": { + "PATH": "${env:PATH}:${config:idf.customExtraPaths}", + "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter" + } + }, + "problemMatcher": { + "background": { + "beginsPattern": "\bDEBUG_ADAPTER_STARTED\b", + "endsPattern": "DEBUG_ADAPTER_READY2CONNECT", + "activeOnStart": true + }, + "pattern": { + "regexp": "(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+),(\\d+)\\s-(.+)\\s(ERROR)", + "file": 8, + "line": 2, + "column": 3, + "severity": 4, + "message": 9 + } + }, + "args": [ + "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter_main.py", + "-e", + "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf", + "-s", + "$OPENOCD_SCRIPTS", + "-dn", + "esp32", + "-om", + "connect_to_instance", + "-t", + "xtensa-esp32-elf-" + + ], + "windows": { + "command": "${config:idf.pythonBinPathWin}", + "options": { + "env": { + "PATH": "${env:PATH};${config:idf.customExtraPaths}", + "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter" + } + } + } + } + ] +} \ No newline at end of file diff --git a/ePaper-ESP-IDF/CMakeLists.txt b/ePaper-ESP-IDF/CMakeLists.txt new file mode 100644 index 0000000..cba78f7 --- /dev/null +++ b/ePaper-ESP-IDF/CMakeLists.txt @@ -0,0 +1,8 @@ +# For more information about build system see +# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(TideDisplay) diff --git a/ePaper-ESP-IDF/components/timber/CMakeLists.txt b/ePaper-ESP-IDF/components/timber/CMakeLists.txt new file mode 100644 index 0000000..2639839 --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "timber.cpp" "tree.cpp" "tree_esp32.cpp" + INCLUDE_DIRS "include") diff --git a/ePaper-ESP-IDF/components/timber/include/timber.h b/ePaper-ESP-IDF/components/timber/include/timber.h new file mode 100644 index 0000000..24cc0ff --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/include/timber.h @@ -0,0 +1,15 @@ +#pragma once +#include +#include "tree.h" +#include "tree_esp32.h" + +class Timber { + public: + static void tag(char* tag); + static void plant(Tree tree); + static void d(char* message); + static void i(char* message); + static void w(char* message); + static void e(char* message); + static void v(char* message); +}; \ No newline at end of file diff --git a/ePaper-ESP-IDF/components/timber/include/tree.h b/ePaper-ESP-IDF/components/timber/include/tree.h new file mode 100644 index 0000000..7c0045f --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/include/tree.h @@ -0,0 +1,6 @@ +#pragma once + +class Tree { + public: + virtual ~Tree(); +}; diff --git a/ePaper-ESP-IDF/components/timber/include/tree_esp32.h b/ePaper-ESP-IDF/components/timber/include/tree_esp32.h new file mode 100644 index 0000000..6edc512 --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/include/tree_esp32.h @@ -0,0 +1,7 @@ +#pragma once +#include "tree.h" + +class TreeESP32 : public Tree { + public: + ~TreeESP32(); +}; diff --git a/ePaper-ESP-IDF/components/timber/timber.cpp b/ePaper-ESP-IDF/components/timber/timber.cpp new file mode 100644 index 0000000..73d970a --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/timber.cpp @@ -0,0 +1,30 @@ +#include "timber.h" +#include + +void Timber::tag(char* tag) { + printf("Tag: %s\n", tag); +} + +void Timber::plant(Tree tree) { + printf("Planting tree\n"); +} + +void Timber::d(char* message) { + printf("Debug: %s\n", message); +} + +void Timber::i(char* message) { + printf("Info: %s\n", message); +} + +void Timber::w(char* message) { + printf("Warning: %s\n", message); +} + +void Timber::e(char* message) { + printf("Error: %s\n", message); +} + +void Timber::v(char* message) { + printf("Verbose: %s\n", message); +} diff --git a/ePaper-ESP-IDF/components/timber/tree.cpp b/ePaper-ESP-IDF/components/timber/tree.cpp new file mode 100644 index 0000000..f3172ed --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/tree.cpp @@ -0,0 +1,6 @@ +#include "tree.h" +#include + +Tree::~Tree() { + printf("Tree destructor\n"); +}; diff --git a/ePaper-ESP-IDF/components/timber/tree_esp32.cpp b/ePaper-ESP-IDF/components/timber/tree_esp32.cpp new file mode 100644 index 0000000..ec6a8ef --- /dev/null +++ b/ePaper-ESP-IDF/components/timber/tree_esp32.cpp @@ -0,0 +1,7 @@ +#include "tree_esp32.h" + +#include + +TreeESP32::~TreeESP32() { + printf("TreeESP32 destructor\n"); +}; diff --git a/ePaper-ESP-IDF/dependencies.lock b/ePaper-ESP-IDF/dependencies.lock new file mode 100644 index 0000000..0a2b767 --- /dev/null +++ b/ePaper-ESP-IDF/dependencies.lock @@ -0,0 +1,15 @@ +dependencies: + idf: + component_hash: null + source: + type: idf + version: 5.2.1 + lvgl/lvgl: + component_hash: d7c1ac037ae6e85d94897f807d6e7ba0946a83e720074fc95a4f6241da9f9f53 + source: + service_url: https://api.components.espressif.com/ + type: service + version: 8.4.0 +manifest_hash: bab870b38425e93ab4bb13b0cc217e242c20a60d075924a73d9521dba226ee4f +target: esp32s3 +version: 1.0.0 diff --git a/ePaper-ESP-IDF/main/CMakeLists.txt b/ePaper-ESP-IDF/main/CMakeLists.txt new file mode 100644 index 0000000..a9397ae --- /dev/null +++ b/ePaper-ESP-IDF/main/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRCS "main.cpp" + INCLUDE_DIRS "." + PRIV_REQUIRES timber) diff --git a/ePaper-ESP-IDF/main/Kconfig b/ePaper-ESP-IDF/main/Kconfig new file mode 100644 index 0000000..b20545a --- /dev/null +++ b/ePaper-ESP-IDF/main/Kconfig @@ -0,0 +1,7 @@ +menu "Tide Display" + config USE_TOUCH + bool "use touch screen for navigation" + default y + help + Enable touch screen support for navigation. +endmenu diff --git a/ePaper-ESP-IDF/main/idf_component.yml b/ePaper-ESP-IDF/main/idf_component.yml new file mode 100644 index 0000000..4d3557f --- /dev/null +++ b/ePaper-ESP-IDF/main/idf_component.yml @@ -0,0 +1,17 @@ +## IDF Component Manager Manifest File +dependencies: + ## Required IDF version + idf: + version: ">=4.1.0" + # # Put list of dependencies here + # # For components maintained by Espressif: + # component: "~1.0.0" + # # For 3rd party components: + # username/component: ">=1.0.0,<2.0.0" + # username2/component2: + # version: "~1.0.0" + # # For transient dependencies `public` flag can be set. + # # `public` flag doesn't have an effect dependencies of the `main` component. + # # All dependencies of `main` are public by default. + # public: true + lvgl/lvgl: "^8.4.0" diff --git a/ePaper-ESP-IDF/main/main.cpp b/ePaper-ESP-IDF/main/main.cpp new file mode 100644 index 0000000..e84eabb --- /dev/null +++ b/ePaper-ESP-IDF/main/main.cpp @@ -0,0 +1,7 @@ +#include +#include "timber.h" + +extern "C" void app_main(void) { + Timber::plant(TreeESP32()); + Timber::tag("ESP32Timber"); +} diff --git a/ePaper-ESP-IDF/partitions.csv b/ePaper-ESP-IDF/partitions.csv new file mode 100644 index 0000000..28511d0 --- /dev/null +++ b/ePaper-ESP-IDF/partitions.csv @@ -0,0 +1,7 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x640000, +app1, app, ota_1, 0x650000,0x640000, +spiffs, data, spiffs, 0xc90000,0x360000, +coredump, data, coredump,0xFF0000,0x10000, \ No newline at end of file diff --git a/ePaper-ESP-IDF/sdkconfig.defaults b/ePaper-ESP-IDF/sdkconfig.defaults new file mode 100644 index 0000000..56b063d --- /dev/null +++ b/ePaper-ESP-IDF/sdkconfig.defaults @@ -0,0 +1,16 @@ +# Logging +CONFIG_LOG_DEFAULT_LEVEL_DEBUG=y +CONFIG_LOG_DEFAULT_LEVEL=4 +CONFIG_LOG_MAXIMUM_LEVEL=4 + +# Flash Size +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" + +# PSRAM +CONFIG_SPIRAM=y +CONFIG_SPIRAM_MODE_OCT=y + +# Partition +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" diff --git a/ePaper-ESP-IDF/sdkconfig.defaults.esp32s3 b/ePaper-ESP-IDF/sdkconfig.defaults.esp32s3 new file mode 100644 index 0000000..b01fdbe --- /dev/null +++ b/ePaper-ESP-IDF/sdkconfig.defaults.esp32s3 @@ -0,0 +1 @@ +CONFIG_IDF_TARGET="esp32s3" diff --git a/ePaper-ESP-IDF/version.txt b/ePaper-ESP-IDF/version.txt new file mode 100644 index 0000000..8a9ecc2 --- /dev/null +++ b/ePaper-ESP-IDF/version.txt @@ -0,0 +1 @@ +0.0.1 \ No newline at end of file