Add examples & Github Actions test for ESP-IDF.

This pull request adds two examples and tests using the ESP-IDF framework:

* A test with the Arduino GFX library (which requires the arduino-esp32 library & Arduino BusIO library)
* A test without the Arduino GFX library, which can be compiled without any additional dependencies.

Having these tests helps prevent any future regressions that may break users of the ESP-IDF platform.
This commit is contained in:
Avi 2023-05-16 12:23:27 -04:00
parent 8b6fb5ef23
commit fa2cb74ba1
15 changed files with 192 additions and 0 deletions

49
.github/workflows/esp-idf_with-gfx.yml vendored Normal file
View file

@ -0,0 +1,49 @@
name: esp-idf with Adafruit GFX Library
on:
push:
paths-ignore:
- '**.md'
- 'doc/**'
- '.github/**'
pull_request:
paths-ignore:
- '**.md'
- 'doc/**'
- '.github/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout ESP32-HUB75-MatrixPanel-I2S-DMA component
uses: actions/checkout@v2
with:
path: 'examples/esp-idf/with-gfx/components/ESP32-HUB75-MatrixPanel-I2S-DMA'
- name: Checkout Adafruit-GFX-Library repo
uses: actions/checkout@v2
with:
repository: 'adafruit/Adafruit-GFX-Library'
path: 'examples/esp-idf/with-gfx/components/Adafruit-GFX-Library'
- name: Checkout Adafruit_BusIO repo
uses: actions/checkout@v2
with:
repository: 'adafruit/Adafruit_BusIO'
path: 'examples/esp-idf/with-gfx/components/Adafruit_BusIO'
- name: Checkout arduino-esp32 repo
uses: actions/checkout@v2
with:
repository: 'espressif/arduino-esp32'
path: 'examples/esp-idf/with-gfx/components/arduino'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v4.4.4
target: esp32
path: 'examples/esp-idf/with-gfx'

View file

@ -0,0 +1,34 @@
name: esp-idf without Adafruit GFX Library
on:
push:
paths-ignore:
- '**.md'
- 'doc/**'
- '.github/**'
pull_request:
paths-ignore:
- '**.md'
- 'doc/**'
- '.github/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Checkout ESP32-HUB75-MatrixPanel-I2S-DMA component
uses: actions/checkout@v2
with:
path: 'examples/esp-idf/without-gfx/components/ESP32-HUB75-MatrixPanel-I2S-DMA'
- name: esp-idf build
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v4.4
target: esp32
path: 'examples/esp-idf/without-gfx'

12
examples/esp-idf/.gitignore vendored Normal file
View file

@ -0,0 +1,12 @@
# ESP-IDF default build directory
build
# Temporary files
*.swp
# lock files for examples and components
dependencies.lock
sdkconfig*
# Unignore sdkconfig.defaults
!sdkconfig.defaults

View file

@ -0,0 +1,10 @@
# This is a boilerplate top-level project CMakeLists.txt file.
# This is the primary file which CMake uses to learn how to build the project.
#
# Most of the important stuff happens in the 'main' directory.
#
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#example-project for more details.
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(with-gfx)

View file

@ -0,0 +1,17 @@
# ESP-IDF Example With Adafruit GFX Library
This folder contains example code for using this library with `esp-idf` and the [Adafruit GFX library](https://github.com/adafruit/Adafruit-GFX-Library).
First, follow the [Getting Started Guide for ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) to install ESP-IDF onto your computer.
When you are ready to start your first project with this library, follow folow these steps:
1. Copy the files in this folder (and sub folders) into a new directory for your project.
1. Clone the required repositories:
```
git clone https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git components/ESP32-HUB75-MatrixPanel-I2S-DMA
git clone https://github.com/adafruit/Adafruit-GFX-Library.git components/Adafruit-GFX-Library
git clone https://github.com/adafruit/Adafruit_BusIO.git components/Adafruit_BusIO
git clone https://github.com/espressif/arduino-esp32.git components/arduino
```
1. Build your project: `idf.py build`

View file

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View file

@ -0,0 +1,5 @@
idf_component_register(
SRC_DIRS "." ${SRCDIRS}
INCLUDE_DIRS ${INCLUDEDIRS}
REQUIRES ESP32-HUB75-MatrixPanel-I2S-DMA
)

View file

@ -0,0 +1,14 @@
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
MatrixPanel_I2S_DMA *dma_display = nullptr;
extern "C" void app_main() {
HUB75_I2S_CFG mxconfig(/* width = */ 64, /* height = */ 64, /* chain = */ 1);
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->begin();
dma_display->setBrightness8(80);
dma_display->clearScreen();
// `println` is only available when the Adafruit GFX library is used.
dma_display->println("Test message");
}

View file

@ -0,0 +1 @@
CONFIG_FREERTOS_HZ=1000

View file

@ -0,0 +1,10 @@
# This is a boilerplate top-level project CMakeLists.txt file.
# This is the primary file which CMake uses to learn how to build the project.
#
# Most of the important stuff happens in the 'main' directory.
#
# See https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/build-system.html#example-project for more details.
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(without-gfx)

View file

@ -0,0 +1,14 @@
# ESP-IDF Example Without Adafruit GFX Library
This folder contains example code for using this library with `esp-idf`.
First, follow the [Getting Started Guide for ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html) to install ESP-IDF onto your computer.
When you are ready to start your first project with this library, follow folow these steps:
1. Copy the files in this folder (and sub folders) into a new directory for your project.
1. Clone the required repositories:
```
git clone https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git components/ESP32-HUB75-MatrixPanel-I2S-DMA
```
1. Build your project: `idf.py build`

View file

@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

View file

@ -0,0 +1,5 @@
idf_component_register(
SRC_DIRS "." ${SRCDIRS}
INCLUDE_DIRS ${INCLUDEDIRS}
REQUIRES ESP32-HUB75-MatrixPanel-I2S-DMA
)

View file

@ -0,0 +1,12 @@
#include "ESP32-HUB75-MatrixPanel-I2S-DMA.h"
MatrixPanel_I2S_DMA *dma_display = nullptr;
extern "C" void app_main() {
HUB75_I2S_CFG mxconfig(/* width = */ 64, /* height = */ 64, /* chain = */ 1);
dma_display = new MatrixPanel_I2S_DMA(mxconfig);
dma_display->begin();
dma_display->setBrightness8(80);
dma_display->clearScreen();
}

View file

@ -0,0 +1 @@
CONFIG_ESP32_HUB75_USE_GFX=n