Merge pull request #460 from abrender/addespidfcode
Add examples & Github Actions test for ESP-IDF.
This commit is contained in:
commit
e27231f5ca
15 changed files with 192 additions and 0 deletions
49
.github/workflows/esp-idf_with-gfx.yml
vendored
Normal file
49
.github/workflows/esp-idf_with-gfx.yml
vendored
Normal 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'
|
34
.github/workflows/esp-idf_without-gfx.yml
vendored
Normal file
34
.github/workflows/esp-idf_without-gfx.yml
vendored
Normal 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
12
examples/esp-idf/.gitignore
vendored
Normal 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
|
10
examples/esp-idf/with-gfx/CMakeLists.txt
Normal file
10
examples/esp-idf/with-gfx/CMakeLists.txt
Normal 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)
|
17
examples/esp-idf/with-gfx/README.md
Normal file
17
examples/esp-idf/with-gfx/README.md
Normal 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`
|
4
examples/esp-idf/with-gfx/components/.gitignore
vendored
Normal file
4
examples/esp-idf/with-gfx/components/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
5
examples/esp-idf/with-gfx/main/CMakeLists.txt
Normal file
5
examples/esp-idf/with-gfx/main/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
idf_component_register(
|
||||||
|
SRC_DIRS "." ${SRCDIRS}
|
||||||
|
INCLUDE_DIRS ${INCLUDEDIRS}
|
||||||
|
REQUIRES ESP32-HUB75-MatrixPanel-I2S-DMA
|
||||||
|
)
|
14
examples/esp-idf/with-gfx/main/main.cpp
Normal file
14
examples/esp-idf/with-gfx/main/main.cpp
Normal 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");
|
||||||
|
}
|
1
examples/esp-idf/with-gfx/sdkconfig.defaults
Normal file
1
examples/esp-idf/with-gfx/sdkconfig.defaults
Normal file
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_FREERTOS_HZ=1000
|
10
examples/esp-idf/without-gfx/CMakeLists.txt
Normal file
10
examples/esp-idf/without-gfx/CMakeLists.txt
Normal 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)
|
14
examples/esp-idf/without-gfx/README.md
Normal file
14
examples/esp-idf/without-gfx/README.md
Normal 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`
|
4
examples/esp-idf/without-gfx/components/.gitignore
vendored
Normal file
4
examples/esp-idf/without-gfx/components/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
5
examples/esp-idf/without-gfx/main/CMakeLists.txt
Normal file
5
examples/esp-idf/without-gfx/main/CMakeLists.txt
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
idf_component_register(
|
||||||
|
SRC_DIRS "." ${SRCDIRS}
|
||||||
|
INCLUDE_DIRS ${INCLUDEDIRS}
|
||||||
|
REQUIRES ESP32-HUB75-MatrixPanel-I2S-DMA
|
||||||
|
)
|
12
examples/esp-idf/without-gfx/main/main.cpp
Normal file
12
examples/esp-idf/without-gfx/main/main.cpp
Normal 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();
|
||||||
|
}
|
1
examples/esp-idf/without-gfx/sdkconfig.defaults
Normal file
1
examples/esp-idf/without-gfx/sdkconfig.defaults
Normal file
|
@ -0,0 +1 @@
|
||||||
|
CONFIG_ESP32_HUB75_USE_GFX=n
|
Loading…
Reference in a new issue