Compare commits
249 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 68766cdbed | |||
| 75178652e2 | |||
| ff3eeacaf7 | |||
| 80bd1c9f20 | |||
| f94cc160cf | |||
| 84cd73e503 | |||
| 6076497997 | |||
| 213ad7ee61 | |||
| 1a96307de2 | |||
| c7dc66e04b | |||
| 15aad3f585 | |||
| f9453d8956 | |||
| 9a307e522d | |||
| c3abe79c90 | |||
| 05ce4335ff | |||
| ec2a6c0b88 | |||
| 0966cd45a4 | |||
| e3eb3fd415 | |||
| c4adaef0a5 | |||
| 057daf49a5 | |||
| d70f474f02 | |||
| 5f54f7ca3d | |||
| d896657bf9 | |||
| 3b5a401594 | |||
| 6fb2bb736c | |||
| bd8fdfd858 | |||
| 8af6204ba1 | |||
| 955416dac8 | |||
| fa4a6e255c | |||
| 50c0a14a93 | |||
| c4406b24ba | |||
| 0922c4d55b | |||
| 7a7f09be35 | |||
| 16a61a087c | |||
| 1c2806bddf | |||
| dbb96a891c | |||
| d6ac070e30 | |||
| f4f91f81d6 | |||
| cca7224252 | |||
| 66a4eb66d6 | |||
| dfaeb9a2d9 | |||
| 9d5993930d | |||
| ecad2248d9 | |||
| a323f8e148 | |||
| 05720821f8 | |||
| 90afba647e | |||
| 35fd7dd536 | |||
| cd07c64926 | |||
| 2f5e183f18 | |||
| d3439f6f45 | |||
| 599fa46766 | |||
| e50659a3fb | |||
| aeccc15ab6 | |||
| 594b8bd27e | |||
| e8b9a1f2a9 | |||
| a35c88c8fd | |||
| 8dabda2b5b | |||
| 8dd9bee8d0 | |||
| 543390a977 | |||
| 62266dff58 | |||
| 3dcc95f6f3 | |||
| a59fbf4ed5 | |||
| 5c78d55b04 | |||
| 895e6bc50d | |||
| 4170b86137 | |||
| be2cdc0b90 | |||
| 10ba4f58e2 | |||
| 4dd2762b79 | |||
| e64f4ff16b | |||
| e560cc7df2 | |||
| aa7530e515 | |||
| 2de35b2d2d | |||
| 9fc0aa51d7 | |||
| 2426c387eb | |||
| 33caf09856 | |||
| d2048e01b6 | |||
| f0f764baff | |||
| d860ba1f34 | |||
| 3a24d058c9 | |||
| 72b55b221e | |||
| 9a11e6f47b | |||
| 72c9b2b113 | |||
| 4ab29ae466 | |||
| 8ff990d635 | |||
| 49632d15c9 | |||
| 26c17986c6 | |||
| dff93cb655 | |||
| 25c3f19e5d | |||
| 93efadd5e3 | |||
| d27404964a | |||
| 74127a5f6c | |||
| 7e24105d0c | |||
| 2aa41cb562 | |||
| 0042ce6d32 | |||
| 79e43b093a | |||
| 1757af859c | |||
| 626d0d9776 | |||
| ecc0a9c076 | |||
| 4fe4faf422 | |||
| a1c835e073 | |||
| 9a672a30ff | |||
| 9cc96fd32b | |||
| a935410f82 | |||
| 1a61eac8e0 | |||
| 1f9e7f82fd | |||
| 9f721e6655 | |||
| 3fe1dc0312 | |||
| 5993ceb232 | |||
| 399dca5e14 | |||
| c9185740d7 | |||
| d62314f41f | |||
| 87ca888bb4 | |||
| 71f8369377 | |||
| f6ddb14ec1 | |||
| d551e467b8 | |||
| c05d46a28c | |||
| e6abd496f9 | |||
| 619b5aa53b | |||
| 10381b10cd | |||
| dfe2c865d1 | |||
| 96eccbdc8d | |||
| 2839ea4c35 | |||
| 51b9547e99 | |||
| d3797abf4e | |||
| 4b6ed871a9 | |||
| 0d16eb606f | |||
| b8214fd378 | |||
| 01ffe420eb | |||
| c98cb2bf10 | |||
| f620255c41 | |||
| 719f7bcece | |||
| 2ca8ae62fb | |||
| fa544f9b3c | |||
| 812c2901db | |||
| 524b197105 | |||
| 7283920def | |||
| a4dc633063 | |||
| feaeb11e49 | |||
| 3fc2ff8bc6 | |||
| f48654d3dc | |||
| 261796068e | |||
| 134e0b34b6 | |||
| 6c4a9975a4 | |||
| 776e3cd4c0 | |||
| 76686e5c90 | |||
| cbaa32c27e | |||
| 65d3d55cc4 | |||
| 62124541e9 | |||
| 8de88dd3fd | |||
| c6cc4034df | |||
| b565d56029 | |||
| fec8033fd7 | |||
| 6ab6ae5686 | |||
| eba1f8955a | |||
| a4f4784ed9 | |||
| dddca1ea76 | |||
| c1ff024657 | |||
| c7c9618f48 | |||
| 0df6b78bd6 | |||
| 7918451699 | |||
| 8335611796 | |||
| 0d8c0a37cc | |||
| ab2aa2c4d4 | |||
| e2ec39304c | |||
| 569cce38fa | |||
| 9ae3e48600 | |||
| 388c2cfe4b | |||
| adea6678a5 | |||
| 4a343e58cc | |||
| 61277e74b8 | |||
| efd3c6041c | |||
| 647678ff82 | |||
| 8115ca4fd9 | |||
| db6d3b4acb | |||
| 37420db000 | |||
| b067978c16 | |||
| 09f8031bff | |||
| 1450ca319d | |||
| c139300a58 | |||
| d0d05c67ca | |||
| f660550f86 | |||
| e9384e0c11 | |||
| 9c5a427a34 | |||
| d8346998ce | |||
| 3a59540365 | |||
| d25603166a | |||
| 17b4fc6a47 | |||
| 45a8379426 | |||
| 1e4234d895 | |||
| 2cb413c3d1 | |||
| 5777a1381b | |||
| 15de4e20b8 | |||
| 3802679de4 | |||
| a05a6afaaf | |||
| efd9662cfc | |||
| 00347cbd29 | |||
| b214a3358e | |||
| c7621b5e4c | |||
| 6dc4f698c9 | |||
| f97ca26b01 | |||
| 98bbea3e9c | |||
| f6cdabf3c0 | |||
| dcf28d0868 | |||
| 9cc58099b4 | |||
| 1216862aec | |||
| 7ad0a3cb04 | |||
| bab3eb19bc | |||
| a4d15b2a1e | |||
| 41ad569154 | |||
| faab6d825f | |||
| a2af95b92d | |||
| 53b711584f | |||
| ce8ac61d42 | |||
| d5c94c7a8a | |||
| 7027da00b8 | |||
| 095c8146c3 | |||
| 62c613477a | |||
| d83b98e99b | |||
| ade86c99b4 | |||
| 980b115f1d | |||
| 84049658db | |||
| 068600f98c | |||
| fe7fdd8583 | |||
| f26266ba76 | |||
| 35a918c82b | |||
| 63866fb371 | |||
| 457c21ffd8 | |||
| 65335578a4 | |||
| c0ed8f0a44 | |||
| a9b69010d8 | |||
| 1627b9fa85 | |||
| 1deaf4c426 | |||
| 0f8380e8fe | |||
| 5cc5b50694 | |||
| 5dfc6d70da | |||
| 50007ea9ed | |||
| e9f72490fc | |||
| 8c8ccd8783 | |||
| ee5a5a7181 | |||
| fbaff8cbac | |||
| d875ade8cb | |||
| 15f4fbfdc6 | |||
| 982fce9207 | |||
| 00b62a2831 | |||
| ab4cf79a47 | |||
| d06197a6aa | |||
| efd3dc43ed | |||
| 6de0f442fb | |||
| 29e4350517 |
@@ -30,4 +30,4 @@ If applicable, add screenshots to help explain your problem.
|
|||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
Add your oops.tactility.one URL if you had a crash (scanned from QR).
|
Add your oops.tactilityproject.org URL if you had a crash (scanned from QR).
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
### Checklist
|
### Checklist
|
||||||
|
|
||||||
- [ ] I read [contribution guidelines](https://github.com/ByteWelder/Tactility/blob/main/CONTRIBUTING.md)
|
- [ ] I read [contribution guidelines](https://github.com/TactilityProject/Tactility/blob/main/CONTRIBUTING.md)
|
||||||
- [ ] Code adheres to the [coding style](https://github.com/ByteWelder/Tactility/blob/main/CODING_STYLE.md)
|
- [ ] Code adheres to the [coding style](https://github.com/TactilityProject/Tactility/blob/main/CODING_STYLE.md)
|
||||||
|
|
||||||
### Description
|
### Description
|
||||||
|
|
||||||
|
|||||||
@@ -11,21 +11,28 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: 'Board select'
|
- name: 'Board select'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp sdkconfig.board.${{ inputs.board_id }} sdkconfig
|
run: python device.py ${{ inputs.board_id }}
|
||||||
- name: 'Build'
|
- name: 'Build'
|
||||||
uses: espressif/esp-idf-ci-action@v1
|
uses: espressif/esp-idf-ci-action@v1
|
||||||
with:
|
with:
|
||||||
esp_idf_version: v5.4
|
esp_idf_version: v5.5.2
|
||||||
target: ${{ inputs.arch }}
|
target: ${{ inputs.arch }}
|
||||||
path: './'
|
path: './'
|
||||||
- name: 'Release'
|
- name: 'Release'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: Buildscripts/release.sh ${{ inputs.board_id }}
|
run: Buildscripts/release.sh ${{ inputs.board_id }}
|
||||||
|
- name: 'Merge binary'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
python -m pip install esptool
|
||||||
|
cd release/Tactility-${{ inputs.board_id }}
|
||||||
|
bash ./merge.sh ${{ inputs.arch }}
|
||||||
|
mv Binaries/merged_binary.bin ../Tactility-${{ inputs.board_id }}.bin
|
||||||
- name: 'Upload Artifact: Release'
|
- name: 'Upload Artifact: Release'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
@@ -38,3 +45,9 @@ runs:
|
|||||||
name: Tactility-${{ inputs.board_id }}-symbols
|
name: Tactility-${{ inputs.board_id }}-symbols
|
||||||
path: release/Tactility-${{ inputs.board_id }}-symbols
|
path: release/Tactility-${{ inputs.board_id }}-symbols
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
- name: 'Upload Artifact: Merged binary'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Tactility-${{ inputs.board_id }}.bin
|
||||||
|
path: release/Tactility-${{ inputs.board_id }}.bin
|
||||||
|
retention-days: 30
|
||||||
|
|||||||
@@ -11,25 +11,39 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: 'Board select'
|
- name: 'Board select'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cp sdkconfig.board.${{ inputs.board_id }} sdkconfig
|
run: python device.py ${{ inputs.board_id }}
|
||||||
- name: 'Build'
|
- name: 'Build'
|
||||||
uses: espressif/esp-idf-ci-action@v1
|
uses: espressif/esp-idf-ci-action@v1
|
||||||
with:
|
with:
|
||||||
# NOTE: Update with ESP-IDF!
|
# NOTE: Update with ESP-IDF!
|
||||||
esp_idf_version: v5.4
|
esp_idf_version: v5.5.2
|
||||||
target: ${{ inputs.arch }}
|
target: ${{ inputs.arch }}
|
||||||
path: './'
|
path: './'
|
||||||
- name: 'Release'
|
- name: 'Release'
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
# NOTE: Update with ESP-IDF!
|
# NOTE: Update with ESP-IDF!
|
||||||
ESP_IDF_VERSION: '5.4'
|
ESP_IDF_VERSION: '5.5.2'
|
||||||
run: Buildscripts/release-sdk.sh release/TactilitySDK
|
run: python Buildscripts/release-sdk.py release/TactilitySDK
|
||||||
|
- name: 'Test Integration Prep'
|
||||||
|
shell: bash
|
||||||
|
# The manifest.properties of our integration test uses version 0.0.0 to indicate that it is not using a normal SDK
|
||||||
|
# This way, it only works with our custom build. That means we have to create a copy of the SDK with the correct folder structure:
|
||||||
|
run: |
|
||||||
|
TACTILITY_SDK_NAME="0.0.0-${{ inputs.arch }}"
|
||||||
|
mkdir -p test_sdk/$TACTILITY_SDK_NAME
|
||||||
|
cp -r release/TactilitySDK test_sdk/$TACTILITY_SDK_NAME
|
||||||
|
- name: 'Test Integration'
|
||||||
|
uses: espressif/esp-idf-ci-action@v1
|
||||||
|
with:
|
||||||
|
esp_idf_version: v5.5.2
|
||||||
|
target: ${{ inputs.arch }}
|
||||||
|
command: export TACTILITY_SDK_PATH=../../test_sdk && cd Tests/SdkIntegration && python tactility.py build ${{ inputs.arch }} --local-sdk
|
||||||
- name: 'Upload Artifact'
|
- name: 'Upload Artifact'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout repo"
|
- name: "Checkout repo"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install Linux Dependencies for SDL
|
- name: Install Linux Dependencies for SDL
|
||||||
@@ -36,14 +36,16 @@ runs:
|
|||||||
WLR_LIBINPUT_NO_DEVICES: 1
|
WLR_LIBINPUT_NO_DEVICES: 1
|
||||||
WAYLAND_DISPLAY: wayland-1
|
WAYLAND_DISPLAY: wayland-1
|
||||||
GTK_USE_PORTAL: 0
|
GTK_USE_PORTAL: 0
|
||||||
- name: "Configure Project"
|
- name: Setup cmake
|
||||||
uses: threeal/cmake-action@v1.3.0
|
uses: jwlawson/actions-setup-cmake@v2
|
||||||
|
with:
|
||||||
|
cmake-version: '3.31.x'
|
||||||
- name: "Prepare Project"
|
- name: "Prepare Project"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake -S ./ -B buildsim
|
run: cmake -S ./ -B buildsim
|
||||||
- name: "Build Tests"
|
- name: "Build Tests"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: cmake --build buildsim --target AppSim
|
run: cmake --build buildsim --target FirmwareSim
|
||||||
- name: 'Release'
|
- name: 'Release'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: Buildscripts/release-simulator.sh buildsim release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
run: Buildscripts/release-simulator.sh buildsim release/Simulator-${{ inputs.os_name }}-${{ inputs.platform_name }}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
name: Bundle All
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: 'Download artifacts'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: artifacts
|
||||||
|
- name: 'Upload Artifact'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 'all-artifacts'
|
||||||
|
path: artifacts/
|
||||||
|
retention-days: 3
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
name: Publish Firmware
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
cdn_version:
|
||||||
|
description: The version that determines the path on the CDN
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: 'Download all-artifacts'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 'all-artifacts'
|
||||||
|
path: artifacts
|
||||||
|
- name: 'Install boto3'
|
||||||
|
shell: bash
|
||||||
|
run: pip install boto3
|
||||||
|
- name: 'Generate files'
|
||||||
|
shell: bash
|
||||||
|
run: version=`cat version.txt` && python Buildscripts/CDN/generate-firmware-files.py artifacts artifacts-cdn $version
|
||||||
|
- name: 'Upload files'
|
||||||
|
shell: bash
|
||||||
|
run: python Buildscripts/CDN/upload-firmware-files.py artifacts-cdn ${{ inputs.cdn_version }} ${{ env.CDN_ID }} ${{ env.CDN_TOKEN_NAME }} ${{ env.CDN_TOKEN_VALUE }}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
name: Publish SDK
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: 'Download all-artifacts'
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: 'all-artifacts'
|
||||||
|
path: artifacts
|
||||||
|
- name: 'Install boto3'
|
||||||
|
shell: bash
|
||||||
|
run: pip install boto3
|
||||||
|
- name: 'Generate files'
|
||||||
|
shell: bash
|
||||||
|
run: version=`cat version.txt` && python Buildscripts/CDN/generate-sdk-files.py artifacts artifacts-cdn $version
|
||||||
|
- name: 'Upload files'
|
||||||
|
shell: bash
|
||||||
|
run: version=`cat version.txt` && python Buildscripts/CDN/upload-sdk-files.py artifacts-cdn $version ${{ env.CDN_ID }} ${{ env.CDN_TOKEN_NAME }} ${{ env.CDN_TOKEN_VALUE }}
|
||||||
@@ -1,164 +0,0 @@
|
|||||||
name: Build Firmware
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
cyd-2432s024c:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: cyd-2432s024c
|
|
||||||
arch: esp32
|
|
||||||
cyd-2432s032c:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: cyd-2432s032c
|
|
||||||
arch: esp32
|
|
||||||
cyd-jc2432w328c:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: cyd-jc2432w328c
|
|
||||||
arch: esp32
|
|
||||||
cyd-8048s043c:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: cyd-8048s043c
|
|
||||||
arch: esp32s3
|
|
||||||
cyd-jc8048w550c:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: cyd-jc8048w550c
|
|
||||||
arch: esp32s3
|
|
||||||
cyd-4848s040c:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: cyd-4848s040c
|
|
||||||
arch: esp32s3
|
|
||||||
elecrow-crowpanel-advance-28:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: elecrow-crowpanel-advance-28
|
|
||||||
arch: esp32s3
|
|
||||||
elecrow-crowpanel-advance-35:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: elecrow-crowpanel-advance-35
|
|
||||||
arch: esp32s3
|
|
||||||
elecrow-crowpanel-advance-50:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: elecrow-crowpanel-advance-50
|
|
||||||
arch: esp32s3
|
|
||||||
elecrow-crowpanel-basic-28:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: elecrow-crowpanel-basic-28
|
|
||||||
arch: esp32
|
|
||||||
elecrow-crowpanel-basic-35:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: elecrow-crowpanel-basic-35
|
|
||||||
arch: esp32
|
|
||||||
elecrow-crowpanel-basic-50:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: elecrow-crowpanel-basic-50
|
|
||||||
arch: esp32s3
|
|
||||||
lilygo-tdeck:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: lilygo-tdeck
|
|
||||||
arch: esp32s3
|
|
||||||
m5stack-core2:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: m5stack-core2
|
|
||||||
arch: esp32
|
|
||||||
m5stack-cores3:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: m5stack-cores3
|
|
||||||
arch: esp32s3
|
|
||||||
unphone:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: unphone
|
|
||||||
arch: esp32s3
|
|
||||||
waveshare-s3-touch-43:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-firmware
|
|
||||||
with:
|
|
||||||
board_id: waveshare-s3-touch-43
|
|
||||||
arch: esp32s3
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
name: Build SDK
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize, reopened]
|
|
||||||
|
|
||||||
permissions: read-all
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
esp32:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-sdk
|
|
||||||
with:
|
|
||||||
board_id: cyd-2432s024c
|
|
||||||
arch: esp32
|
|
||||||
esp32s3:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- name: "Build"
|
|
||||||
uses: ./.github/actions/build-sdk
|
|
||||||
with:
|
|
||||||
board_id: lilygo-tdeck
|
|
||||||
arch: esp32s3
|
|
||||||
@@ -7,20 +7,24 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [ opened, synchronize, reopened ]
|
||||||
jobs:
|
jobs:
|
||||||
Build-Simulator-Linux:
|
Linux:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- name: "Build"
|
- name: "Build"
|
||||||
uses: ./.github/actions/build-simulator
|
uses: ./.github/actions/build-simulator
|
||||||
with:
|
with:
|
||||||
os_name: linux
|
os_name: linux
|
||||||
platform_name: amd64
|
platform_name: amd64
|
||||||
publish: true
|
publish: true
|
||||||
Build-Simulator-macOS:
|
macOS:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
- name: "Build"
|
- name: "Build"
|
||||||
uses: ./.github/actions/build-simulator
|
uses: ./.github/actions/build-simulator
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -0,0 +1,109 @@
|
|||||||
|
name: Build Firmware
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
pull_request:
|
||||||
|
types: [ opened, synchronize, reopened ]
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
BuildSdk:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
board: [
|
||||||
|
{ id: generic-esp32, arch: esp32 },
|
||||||
|
{ id: generic-esp32c6, arch: esp32c6 },
|
||||||
|
{ id: generic-esp32p4, arch: esp32p4 },
|
||||||
|
{ id: generic-esp32s3, arch: esp32s3 },
|
||||||
|
]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: "Build SDK"
|
||||||
|
uses: ./.github/actions/build-sdk
|
||||||
|
with:
|
||||||
|
board_id: ${{ matrix.board.id }}
|
||||||
|
arch: ${{ matrix.board.arch }}
|
||||||
|
GenerateDeviceMatrix:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ BuildSdk ]
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- id: set-matrix
|
||||||
|
run: python3 Buildscripts/gh-generate-device-matrix.py
|
||||||
|
BuildFirmware:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: GenerateDeviceMatrix
|
||||||
|
strategy:
|
||||||
|
matrix: ${{ fromJSON(needs.GenerateDeviceMatrix.outputs.matrix) }}
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: "Build Firmware"
|
||||||
|
uses: ./.github/actions/build-firmware
|
||||||
|
with:
|
||||||
|
board_id: ${{ matrix.board.id }}
|
||||||
|
arch: ${{ matrix.board.arch }}
|
||||||
|
BundleArtifacts:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ BuildFirmware ]
|
||||||
|
if: |
|
||||||
|
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
|
||||||
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: "Bundle Artifacts"
|
||||||
|
uses: ./.github/actions/bundle-artifacts
|
||||||
|
PublishFirmwareSnapshot:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ BundleArtifacts ]
|
||||||
|
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: "Publish Firmware Snapshot"
|
||||||
|
env:
|
||||||
|
CDN_ID: ${{ secrets.CDN_ID }}
|
||||||
|
CDN_TOKEN_NAME: ${{ secrets.CDN_TOKEN_NAME }}
|
||||||
|
CDN_TOKEN_VALUE: ${{ secrets.CDN_TOKEN_VALUE }}
|
||||||
|
uses: ./.github/actions/publish-firmware
|
||||||
|
with:
|
||||||
|
cdn_version: snapshot
|
||||||
|
PublishFirmwareStable:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ BundleArtifacts ]
|
||||||
|
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v'))
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: "Publish Firmware Stable"
|
||||||
|
env:
|
||||||
|
CDN_ID: ${{ secrets.CDN_ID }}
|
||||||
|
CDN_TOKEN_NAME: ${{ secrets.CDN_TOKEN_NAME }}
|
||||||
|
CDN_TOKEN_VALUE: ${{ secrets.CDN_TOKEN_VALUE }}
|
||||||
|
uses: ./.github/actions/publish-firmware
|
||||||
|
with:
|
||||||
|
cdn_version: stable
|
||||||
|
PublishSdk:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ BundleArtifacts ]
|
||||||
|
if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
- name: "Publish SDKs"
|
||||||
|
env:
|
||||||
|
CDN_ID: ${{ secrets.CDN_ID }}
|
||||||
|
CDN_TOKEN_NAME: ${{ secrets.CDN_TOKEN_NAME }}
|
||||||
|
CDN_TOKEN_VALUE: ${{ secrets.CDN_TOKEN_VALUE }}
|
||||||
|
uses: ./.github/actions/publish-sdk
|
||||||
@@ -6,11 +6,11 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [ opened, synchronize, reopened ]
|
||||||
jobs:
|
jobs:
|
||||||
Run:
|
TactilityTests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout repo"
|
- name: "Checkout repo"
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: "Configure Project"
|
- name: "Configure Project"
|
||||||
@@ -19,7 +19,25 @@ jobs:
|
|||||||
run: cmake -S ./ -B build
|
run: cmake -S ./ -B build
|
||||||
- name: "Build Tests"
|
- name: "Build Tests"
|
||||||
run: cmake --build build --target build-tests
|
run: cmake --build build --target build-tests
|
||||||
- name: "Run TactilityCore Tests"
|
- name: "Run TactilityFreeRtos Tests"
|
||||||
run: build/Tests/TactilityCore/TactilityCoreTests --exit
|
run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests
|
||||||
- name: "Run TactilityHeadless Tests"
|
- name: "Run Tactility Tests"
|
||||||
run: build/Tests/Tactility/TactilityTests --exit
|
run: build/Tests/Tactility/TactilityTests
|
||||||
|
- name: "Run TactilityKernel Tests"
|
||||||
|
run: build/Tests/TactilityKernel/TactilityKernelTests
|
||||||
|
- name: "Run CryptModuleTests Tests"
|
||||||
|
run: build/Tests/crypt-module/CryptModuleTests
|
||||||
|
DevicetreeTests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
submodules: recursive
|
||||||
|
- name: "Install Python Dependencies"
|
||||||
|
shell: bash
|
||||||
|
run: pip install lark==1.3.1 pyyaml==6.0.3
|
||||||
|
- name: "Run Devicetree Tests"
|
||||||
|
shell: bash
|
||||||
|
working-directory: Buildscripts/DevicetreeCompiler/tests
|
||||||
|
run: python test_integration.py
|
||||||
|
|||||||
+13
-2
@@ -3,10 +3,11 @@
|
|||||||
|
|
||||||
build/
|
build/
|
||||||
buildsim/
|
buildsim/
|
||||||
build-sim/
|
build-*/
|
||||||
cmake-build-*/
|
cmake-*/
|
||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
*.cbp
|
*.cbp
|
||||||
|
CMakeFiles
|
||||||
|
|
||||||
release/
|
release/
|
||||||
|
|
||||||
@@ -16,3 +17,13 @@ sdkconfig.old
|
|||||||
managed_components/
|
managed_components/
|
||||||
dependencies.lock
|
dependencies.lock
|
||||||
|
|
||||||
|
.vscode/
|
||||||
|
*.code-workspace
|
||||||
|
.gitpod.yml
|
||||||
|
|
||||||
|
sdkconfig.board.*.dev
|
||||||
|
|
||||||
|
.tactility/
|
||||||
|
|
||||||
|
.caveman.json
|
||||||
|
.ai/mcp
|
||||||
@@ -10,3 +10,9 @@
|
|||||||
[submodule "Libraries/SDL"]
|
[submodule "Libraries/SDL"]
|
||||||
path = Libraries/SDL
|
path = Libraries/SDL
|
||||||
url = https://github.com/libsdl-org/SDL.git
|
url = https://github.com/libsdl-org/SDL.git
|
||||||
|
[submodule "Libraries/minitar/minitar"]
|
||||||
|
path = Libraries/minitar/minitar
|
||||||
|
url = https://github.com/ByteWelder/minitar.git
|
||||||
|
[submodule "Libraries/cJSON/cJSON"]
|
||||||
|
path = Libraries/cJSON/cJSON
|
||||||
|
url = https://github.com/DaveGamble/cJSON.git
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.20)
|
|
||||||
|
|
||||||
if (DEFINED ENV{ESP_IDF_VERSION})
|
|
||||||
# Read board id/project
|
|
||||||
include("../Buildscripts/board.cmake")
|
|
||||||
init_tactility_globals("../sdkconfig")
|
|
||||||
get_property(TACTILITY_BOARD_PROJECT GLOBAL PROPERTY TACTILITY_BOARD_PROJECT)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRC_DIRS "Source"
|
|
||||||
"Source/HelloWorld"
|
|
||||||
REQUIRES ${BOARD_COMPONENTS}
|
|
||||||
REQUIRES Tactility TactilityC ${TACTILITY_BOARD_PROJECT}
|
|
||||||
)
|
|
||||||
else ()
|
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCES "Source/*.c*")
|
|
||||||
add_executable(AppSim ${SOURCES})
|
|
||||||
target_link_libraries(AppSim
|
|
||||||
PRIVATE Tactility
|
|
||||||
PRIVATE TactilityCore
|
|
||||||
PRIVATE Simulator
|
|
||||||
PRIVATE SDL2::SDL2-static SDL2-static
|
|
||||||
)
|
|
||||||
|
|
||||||
add_definitions(-D_Nullable=)
|
|
||||||
add_definitions(-D_Nonnull=)
|
|
||||||
endif ()
|
|
||||||
-60
@@ -1,60 +0,0 @@
|
|||||||
# Kconfig file for Tactility example app
|
|
||||||
menu "Tactility App"
|
|
||||||
config TT_BOARD_NAME
|
|
||||||
string "Board Name"
|
|
||||||
default ""
|
|
||||||
config TT_BOARD_ID
|
|
||||||
string "Board ID"
|
|
||||||
default ""
|
|
||||||
choice
|
|
||||||
prompt "Board"
|
|
||||||
default TT_BOARD_CUSTOM
|
|
||||||
config TT_BOARD_CUSTOM
|
|
||||||
bool "Custom"
|
|
||||||
config TT_BOARD_CYD_2432S024C
|
|
||||||
bool "CYD 2432S024C"
|
|
||||||
config TT_BOARD_CYD_2432S032C
|
|
||||||
bool "CYD 2432S032C"
|
|
||||||
config TT_BOARD_CYD_8048S043C
|
|
||||||
bool "CYD 8048S043C"
|
|
||||||
config TT_BOARD_CYD_JC2432W328C
|
|
||||||
bool "CYD JC2432W328C"
|
|
||||||
config TT_BOARD_CYD_JC8048W550C
|
|
||||||
bool "CYD JC8048W550C"
|
|
||||||
config TT_BOARD_CYD_4848S040C
|
|
||||||
bool "CYD 4848S040C"
|
|
||||||
config TT_BOARD_ELECROW_CROWPANEL_ADVANCE_28
|
|
||||||
bool "Elecrow CrowPanel Advance 2.8"
|
|
||||||
config TT_BOARD_ELECROW_CROWPANEL_ADVANCE_35
|
|
||||||
bool "Elecrow CrowPanel Advance 3.5"
|
|
||||||
config TT_BOARD_ELECROW_CROWPANEL_ADVANCE_50
|
|
||||||
bool "Elecrow CrowPanel Advance 5.0"
|
|
||||||
config TT_BOARD_ELECROW_CROWPANEL_BASIC_28
|
|
||||||
bool "Elecrow CrowPanel Basic 2.8"
|
|
||||||
config TT_BOARD_ELECROW_CROWPANEL_BASIC_35
|
|
||||||
bool "Elecrow CrowPanel Basic 3.5"
|
|
||||||
config TT_BOARD_ELECROW_CROWPANEL_BASIC_50
|
|
||||||
bool "Elecrow CrowPanel Basic 5.0"
|
|
||||||
config TT_BOARD_LILYGO_TDECK
|
|
||||||
bool "LilyGo T-Deck"
|
|
||||||
config TT_BOARD_M5STACK_CORE2
|
|
||||||
bool "M5Stack Core2"
|
|
||||||
config TT_BOARD_M5STACK_CORES3
|
|
||||||
bool "M5Stack CoreS3"
|
|
||||||
config TT_BOARD_UNPHONE
|
|
||||||
bool "unPhone"
|
|
||||||
config TT_BOARD_WAVESHARE_S3_TOUCH_43
|
|
||||||
bool "Waveshare ESP32 S3 Touch LCD 4.3"
|
|
||||||
help
|
|
||||||
Select a board/hardware configuration.
|
|
||||||
Use TT_BOARD_CUSTOM if you will manually configure the board in your project.
|
|
||||||
endchoice
|
|
||||||
|
|
||||||
config TT_SPLASH_DURATION
|
|
||||||
int "Splash Duration (ms)"
|
|
||||||
default 1000
|
|
||||||
range 0 3000
|
|
||||||
help
|
|
||||||
The minimum time to show the splash screen in milliseconds.
|
|
||||||
When set to 0, startup will continue to desktop as soon as boot operations are finished.
|
|
||||||
endmenu
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
|
||||||
#include <sdkconfig.h>
|
|
||||||
|
|
||||||
// Supported hardware:
|
|
||||||
#if defined(CONFIG_TT_BOARD_LILYGO_TDECK)
|
|
||||||
#include "LilygoTdeck.h"
|
|
||||||
#define TT_BOARD_HARDWARE &lilygo_tdeck
|
|
||||||
#elif defined(CONFIG_TT_BOARD_CYD_2432S024C)
|
|
||||||
#include "CYD2432S024C.h"
|
|
||||||
#define TT_BOARD_HARDWARE &cyd_2432s024c_config
|
|
||||||
#elif defined(CONFIG_TT_BOARD_CYD_2432S032C)
|
|
||||||
#include "CYD2432S032C.h"
|
|
||||||
#define TT_BOARD_HARDWARE &cyd_2432S032c_config
|
|
||||||
#elif (defined(CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_28))
|
|
||||||
#define TT_BOARD_HARDWARE &crowpanel_advance_28
|
|
||||||
#include "CrowPanelAdvance28.h"
|
|
||||||
#elif (defined(CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_35))
|
|
||||||
#define TT_BOARD_HARDWARE &crowpanel_advance_35
|
|
||||||
#include "CrowPanelAdvance35.h"
|
|
||||||
#elif (defined(CONFIG_TT_BOARD_ELECROW_CROWPANEL_ADVANCE_50))
|
|
||||||
#define TT_BOARD_HARDWARE &crowpanel_advance_50
|
|
||||||
#include "CrowPanelAdvance50.h"
|
|
||||||
#elif (defined(CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_28))
|
|
||||||
#define TT_BOARD_HARDWARE &crowpanel_basic_28
|
|
||||||
#include "CrowPanelBasic28.h"
|
|
||||||
#elif (defined(CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_35))
|
|
||||||
#define TT_BOARD_HARDWARE &crowpanel_basic_35
|
|
||||||
#include "CrowPanelBasic35.h"
|
|
||||||
#elif (defined(CONFIG_TT_BOARD_ELECROW_CROWPANEL_BASIC_50))
|
|
||||||
#define TT_BOARD_HARDWARE &crowpanel_basic_50
|
|
||||||
#include "CrowPanelBasic50.h"
|
|
||||||
#elif defined(CONFIG_TT_BOARD_M5STACK_CORE2)
|
|
||||||
#include "M5stackCore2.h"
|
|
||||||
#define TT_BOARD_HARDWARE &m5stack_core2
|
|
||||||
#elif defined(CONFIG_TT_BOARD_M5STACK_CORES3)
|
|
||||||
#include "M5stackCoreS3.h"
|
|
||||||
#define TT_BOARD_HARDWARE &m5stack_cores3
|
|
||||||
#elif defined(CONFIG_TT_BOARD_UNPHONE)
|
|
||||||
#include "UnPhone.h"
|
|
||||||
#define TT_BOARD_HARDWARE &unPhone
|
|
||||||
#elif defined(CONFIG_TT_BOARD_CYD_JC2432W328C)
|
|
||||||
#include "JC2432W328C.h"
|
|
||||||
#define TT_BOARD_HARDWARE &cyd_jc2432w328c_config
|
|
||||||
#elif defined(CONFIG_TT_BOARD_CYD_8048S043C)
|
|
||||||
#include "CYD8048S043C.h"
|
|
||||||
#define TT_BOARD_HARDWARE &cyd_8048s043c_config
|
|
||||||
#elif defined(CONFIG_TT_BOARD_CYD_JC8048W550C)
|
|
||||||
#include "JC8048W550C.h"
|
|
||||||
#define TT_BOARD_HARDWARE &cyd_jc8048w550c_config
|
|
||||||
#elif defined(CONFIG_TT_BOARD_CYD_4848S040C)
|
|
||||||
#include "CYD4848S040C.h"
|
|
||||||
#define TT_BOARD_HARDWARE &cyd_4848s040c_config
|
|
||||||
#elif defined(CONFIG_TT_BOARD_WAVESHARE_S3_TOUCH_43)
|
|
||||||
#include "WaveshareS3Touch43.h"
|
|
||||||
#define TT_BOARD_HARDWARE &waveshare_s3_touch_43
|
|
||||||
#else
|
|
||||||
#define TT_BOARD_HARDWARE NULL
|
|
||||||
#error Replace TT_BOARD_HARDWARE in main.c with your own. Or copy one of the ./sdkconfig.board.* files into ./sdkconfig.
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#else // else simulator
|
|
||||||
|
|
||||||
#include "Simulator.h"
|
|
||||||
|
|
||||||
extern tt::hal::Configuration hardware;
|
|
||||||
#define TT_BOARD_HARDWARE &hardware
|
|
||||||
|
|
||||||
#endif // ESP_PLATFORM
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#include <Tactility/app/AppManifest.h>
|
|
||||||
#include <Tactility/lvgl/Toolbar.h>
|
|
||||||
#include <lvgl.h>
|
|
||||||
|
|
||||||
using namespace tt::app;
|
|
||||||
|
|
||||||
class HelloWorldApp : public App {
|
|
||||||
|
|
||||||
void onShow(AppContext& context, lv_obj_t* parent) override {
|
|
||||||
lv_obj_t* toolbar = tt::lvgl::toolbar_create(parent, context);
|
|
||||||
lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0);
|
|
||||||
|
|
||||||
lv_obj_t* label = lv_label_create(parent);
|
|
||||||
lv_label_set_text(label, "Hello, world!");
|
|
||||||
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
extern const AppManifest hello_world_app = {
|
|
||||||
.id = "HelloWorld",
|
|
||||||
.name = "Hello World",
|
|
||||||
.createApp = create<HelloWorldApp>
|
|
||||||
};
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#include "Boards.h"
|
|
||||||
#include <Tactility/Tactility.h>
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
|
||||||
#include "tt_init.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// extern const tt::app::AppManifest hello_world_app;
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
|
|
||||||
void app_main() {
|
|
||||||
static const tt::Configuration config = {
|
|
||||||
/**
|
|
||||||
* Auto-select a board based on the ./sdkconfig.board.* file
|
|
||||||
* that you copied to ./sdkconfig before you opened this project.
|
|
||||||
*/
|
|
||||||
.hardware = TT_BOARD_HARDWARE,
|
|
||||||
.apps = {
|
|
||||||
// &hello_world_app,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
|
||||||
tt_init_tactility_c(); // ELF bindings for side-loading on ESP32
|
|
||||||
#endif
|
|
||||||
|
|
||||||
tt::run(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // extern
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
dependencies:
|
|
||||||
espressif/esp_lcd_ili9341: "2.0.0"
|
|
||||||
atanisoft/esp_lcd_ili9488: "1.0.10"
|
|
||||||
espressif/esp_lcd_touch: "1.1.2"
|
|
||||||
atanisoft/esp_lcd_touch_xpt2046: "1.0.5"
|
|
||||||
espressif/esp_lcd_touch_cst816s: "1.0.3"
|
|
||||||
espressif/esp_lcd_touch_gt911: "1.1.3"
|
|
||||||
espressif/esp_lcd_touch_ft5x06: "1.0.6~1"
|
|
||||||
espressif/esp_io_expander: "1.0.1"
|
|
||||||
espressif/esp_io_expander_tca95xx_16bit: "1.0.1"
|
|
||||||
espressif/esp_lcd_st7701:
|
|
||||||
version: "1.1.1"
|
|
||||||
rules:
|
|
||||||
- if: "target in [esp32s3, esp32p4]"
|
|
||||||
espressif/esp_lcd_panel_io_additions: "1.0.1"
|
|
||||||
espressif/esp_tinyusb:
|
|
||||||
version: "1.5.0"
|
|
||||||
rules:
|
|
||||||
- if: "target == esp32s3"
|
|
||||||
idf: '5.4'
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
#include "CYD2432S024C.h"
|
|
||||||
#include "hal/YellowDisplay.h"
|
|
||||||
#include "hal/YellowDisplayConstants.h"
|
|
||||||
#include "hal/YellowSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
#define CYD_SPI_TRANSFER_SIZE_LIMIT (TWODOTFOUR_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(TWODOTFOUR_LCD_PIN_BACKLIGHT);
|
|
||||||
}
|
|
||||||
|
|
||||||
const tt::hal::Configuration cyd_2432s024c_config = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createYellowSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
|
||||||
tt::hal::i2c::Configuration {
|
|
||||||
.name = "First",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = tt::hal::i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_33,
|
|
||||||
.scl_io_num = GPIO_NUM_32,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tt::hal::i2c::Configuration {
|
|
||||||
.name = "Second",
|
|
||||||
.port = I2C_NUM_1,
|
|
||||||
.initMode = tt::hal::i2c::InitMode::Disabled,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_NC,
|
|
||||||
.scl_io_num = GPIO_NUM_NC,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
tt::hal::spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_13,
|
|
||||||
.miso_io_num = GPIO_NUM_NC,
|
|
||||||
.sclk_io_num = GPIO_NUM_14,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC, // Quad SPI LCD driver is not yet supported
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC, // Quad SPI LCD driver is not yet supported
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = CYD_SPI_TRANSFER_SIZE_LIMIT,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = tt::hal::spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
|
||||||
},
|
|
||||||
tt::hal::spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_23,
|
|
||||||
.miso_io_num = GPIO_NUM_19,
|
|
||||||
.sclk_io_num = GPIO_NUM_18,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC, // Quad SPI LCD driver is not yet supported
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC, // Quad SPI LCD driver is not yet supported
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = tt::hal::spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
// Capacitive touch version of the 2.4" yellow board
|
|
||||||
extern const tt::hal::Configuration cyd_2432s024c_config;
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
#include "YellowDisplay.h"
|
|
||||||
#include "Cst816Touch.h"
|
|
||||||
#include "YellowDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <Ili934xDisplay.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
||||||
// Note: GPIO 25 for reset and GPIO 21 for interrupt?
|
|
||||||
auto configuration = std::make_unique<Cst816sTouch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
240,
|
|
||||||
320
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Cst816sTouch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
|
|
||||||
TWODOTFOUR_LCD_SPI_HOST,
|
|
||||||
TWODOTFOUR_LCD_PIN_CS,
|
|
||||||
TWODOTFOUR_LCD_PIN_DC,
|
|
||||||
TWODOTFOUR_LCD_HORIZONTAL_RESOLUTION,
|
|
||||||
TWODOTFOUR_LCD_VERTICAL_RESOLUTION,
|
|
||||||
touch
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->mirrorX = true;
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<Ili934xDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define TWODOTFOUR_LCD_PIN_BACKLIGHT GPIO_NUM_27
|
|
||||||
|
|
||||||
// Display
|
|
||||||
#define TWODOTFOUR_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define TWODOTFOUR_LCD_HORIZONTAL_RESOLUTION 240
|
|
||||||
#define TWODOTFOUR_LCD_VERTICAL_RESOLUTION 320
|
|
||||||
#define TWODOTFOUR_LCD_DRAW_BUFFER_HEIGHT (TWODOTFOUR_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
#define TWODOTFOUR_LCD_DRAW_BUFFER_SIZE (TWODOTFOUR_LCD_HORIZONTAL_RESOLUTION * TWODOTFOUR_LCD_DRAW_BUFFER_HEIGHT)
|
|
||||||
#define TWODOTFOUR_LCD_PIN_CS GPIO_NUM_15
|
|
||||||
#define TWODOTFOUR_LCD_PIN_DC GPIO_NUM_2
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#include "YellowSdCard.h"
|
|
||||||
|
|
||||||
#define TAG "twodotfour_sdcard"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
|
|
||||||
#define SDCARD_SPI_HOST SPI3_HOST
|
|
||||||
#define SDCARD_PIN_CS GPIO_NUM_5
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createYellowSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
SDCARD_PIN_CS,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
std::make_shared<tt::Mutex>(),
|
|
||||||
std::vector<gpio_num_t>(),
|
|
||||||
SDCARD_SPI_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createYellowSdCard();
|
|
||||||
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// Touch
|
|
||||||
#define TWODOTFOUR_TOUCH_I2C_PORT I2C_NUM_0
|
|
||||||
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
#include "CYD2432S032C.h"
|
|
||||||
#include "Tactility/lvgl/LvglSync.h"
|
|
||||||
#include "hal/CydDisplay.h"
|
|
||||||
#include "hal/CydSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/kernel/SystemEvents.h>
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
if (!driver::pwmbacklight::init(GPIO_NUM_27)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// This display has a weird glitch with gamma during boot, which results in uneven dark gray colours.
|
|
||||||
// Setting gamma curve index to 0 doesn't work at boot for an unknown reason, so we set the curve index to 1:
|
|
||||||
tt::kernel::subscribeSystemEvent(tt::kernel::SystemEvent::BootInitLvglEnd, [](auto event) {
|
|
||||||
auto display = tt::hal::findFirstDevice<tt::hal::display::DisplayDevice>(tt::hal::Device::Type::Display);
|
|
||||||
assert(display != nullptr);
|
|
||||||
tt::lvgl::lock(portMAX_DELAY);
|
|
||||||
display->setGammaCurve(1U);
|
|
||||||
tt::lvgl::unlock();
|
|
||||||
});
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
const tt::hal::Configuration cyd_2432S032c_config = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
|
||||||
tt::hal::i2c::Configuration {
|
|
||||||
.name = "Internal",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = tt::hal::i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_33,
|
|
||||||
.scl_io_num = GPIO_NUM_32,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
tt::hal::spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_13,
|
|
||||||
.miso_io_num = GPIO_NUM_NC,
|
|
||||||
.sclk_io_num = GPIO_NUM_14,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 0,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = tt::hal::spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
|
||||||
},
|
|
||||||
tt::hal::spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_23,
|
|
||||||
.miso_io_num = GPIO_NUM_19,
|
|
||||||
.sclk_io_num = GPIO_NUM_18,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 0,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = tt::hal::spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
},
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
// Capacitive touch version of the 2.4" yellow board
|
|
||||||
extern const tt::hal::Configuration cyd_2432S032c_config;
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#include "CydDisplay.h"
|
|
||||||
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <Ili934xDisplay.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
240,
|
|
||||||
320
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
|
|
||||||
SPI2_HOST,
|
|
||||||
GPIO_NUM_15,
|
|
||||||
GPIO_NUM_2,
|
|
||||||
240,
|
|
||||||
320,
|
|
||||||
touch,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
0,
|
|
||||||
LCD_RGB_ELEMENT_ORDER_RGB
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<Ili934xDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#include "CydSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
#define SDCARD_SPI_HOST SPI3_HOST
|
|
||||||
#define SDCARD_PIN_CS GPIO_NUM_5
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
SDCARD_PIN_CS,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
std::make_shared<tt::Mutex>(),
|
|
||||||
std::vector<gpio_num_t>(),
|
|
||||||
SDCARD_SPI_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRCS ${SOURCE_FILES}
|
|
||||||
INCLUDE_DIRS "Source"
|
|
||||||
REQUIRES Tactility esp_lvgl_port esp_lcd esp_lcd_st7701 esp_lcd_panel_io_additions GT911 PwmBacklight driver vfs fatfs
|
|
||||||
)
|
|
||||||
@@ -1,82 +0,0 @@
|
|||||||
#include "CYD4848S040C.h"
|
|
||||||
#include "hal/CydDisplay.h"
|
|
||||||
#include "hal/CydSdCard.h"
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_38, 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Configuration cyd_4848s040c_config = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
|
||||||
//Touch
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Internal",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_19,
|
|
||||||
.scl_io_num = GPIO_NUM_45,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//H1 header,
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "External",
|
|
||||||
.port = I2C_NUM_1,
|
|
||||||
.initMode = i2c::InitMode::Disabled,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_NC,
|
|
||||||
.scl_io_num = GPIO_NUM_NC,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
//SD Card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_47,
|
|
||||||
.miso_io_num = GPIO_NUM_41,
|
|
||||||
.sclk_io_num = GPIO_NUM_48,
|
|
||||||
.quadwp_io_num = -1,
|
|
||||||
.quadhd_io_num = -1,
|
|
||||||
.data4_io_num = -1,
|
|
||||||
.data5_io_num = -1,
|
|
||||||
.data6_io_num = -1,
|
|
||||||
.data7_io_num = -1,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
// Capacitive touch version of the 4" square yellow board
|
|
||||||
extern const tt::hal::Configuration cyd_4848s040c_config;
|
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
#include "CydDisplay.h"
|
|
||||||
#include "PwmBacklight.h"
|
|
||||||
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <Tactility/Log.h>
|
|
||||||
|
|
||||||
#include <driver/gpio.h>
|
|
||||||
#include <esp_err.h>
|
|
||||||
#include <esp_lcd_panel_rgb.h>
|
|
||||||
#include <esp_lcd_panel_ops.h>
|
|
||||||
#include <esp_lcd_panel_io.h>
|
|
||||||
#include <esp_lcd_panel_io_additions.h>
|
|
||||||
#include <esp_lcd_st7701.h>
|
|
||||||
#include <esp_lvgl_port.h>
|
|
||||||
|
|
||||||
#define TAG "cyd_display"
|
|
||||||
|
|
||||||
static const st7701_lcd_init_cmd_t st7701_lcd_init_cmds[] = {
|
|
||||||
// {cmd, { data }, data_size, delay_ms}
|
|
||||||
{0xFF, (uint8_t[]) {0x77, 0x01, 0x00, 0x00, 0x10}, 5, 0},
|
|
||||||
{0xC0, (uint8_t[]) {0x3B, 0x00}, 2, 0},
|
|
||||||
{0xC1, (uint8_t[]) {0x0D, 0x02}, 2, 0},
|
|
||||||
{0xC2, (uint8_t[]) {0x31, 0x05}, 2, 0},
|
|
||||||
{0xCD, (uint8_t[]) {0x00}, 1, 0}, //0x08
|
|
||||||
//Positive Voltage Gamma Control
|
|
||||||
{0xB0, (uint8_t[]) {0x00, 0x11, 0x18, 0x0E, 0x11, 0x06, 0x07, 0x08, 0x07, 0x22, 0x04, 0x12, 0x0F, 0xAA, 0x31, 0x18}, 16, 0},
|
|
||||||
//Negative Voltage Gamma Control
|
|
||||||
{0xB1, (uint8_t[]) {0x00, 0x11, 0x19, 0x0E, 0x12, 0x07, 0x08, 0x08, 0x08, 0x22, 0x04, 0x11, 0x11, 0xA9, 0x32, 0x18}, 16, 0},
|
|
||||||
//Page1
|
|
||||||
{0xFF, (uint8_t[]) {0x77, 0x01, 0x00, 0x00, 0x11}, 5, 0},
|
|
||||||
{0xB0, (uint8_t[]) {0x60}, 1, 0}, //Vop=4.7375v
|
|
||||||
{0xB1, (uint8_t[]) {0x32}, 1, 0}, //VCOM=32
|
|
||||||
{0xB2, (uint8_t[]) {0x07}, 1, 0}, //VGH=15v
|
|
||||||
{0xB3, (uint8_t[]) {0x80}, 1, 0},
|
|
||||||
{0xB5, (uint8_t[]) {0x49}, 1, 0}, //VGL=-10.17v
|
|
||||||
{0xB7, (uint8_t[]) {0x85}, 1, 0},
|
|
||||||
{0xB8, (uint8_t[]) {0x21}, 1, 0}, //AVDD=6.6 & AVCL=-4.6
|
|
||||||
{0xC1, (uint8_t[]) {0x78}, 1, 0},
|
|
||||||
{0xC2, (uint8_t[]) {0x78}, 1, 0},
|
|
||||||
{0xE0, (uint8_t[]) {0x00, 0x1B, 0x02}, 3, 0},
|
|
||||||
{0xE1, (uint8_t[]) {0x08, 0xA0, 0x00, 0x00, 0x07, 0xA0, 0x00, 0x00, 0x00, 0x44, 0x44}, 11, 0},
|
|
||||||
{0xE2, (uint8_t[]) {0x11, 0x11, 0x44, 0x44, 0xED, 0xA0, 0x00, 0x00, 0xEC, 0xA0, 0x00, 0x00}, 12, 0},
|
|
||||||
{0xE3, (uint8_t[]) {0x00, 0x00, 0x11, 0x11}, 4, 0},
|
|
||||||
{0xE4, (uint8_t[]) {0x44, 0x44}, 2, 0},
|
|
||||||
{0xE5, (uint8_t[]) {0x0A, 0xE9, 0xD8, 0xA0, 0x0C, 0xEB, 0xD8, 0xA0, 0x0E, 0xED, 0xD8, 0xA0, 0x10, 0xEF, 0xD8, 0xA0}, 16, 0},
|
|
||||||
{0xE6, (uint8_t[]) {0x00, 0x00, 0x11, 0x11}, 4, 0},
|
|
||||||
{0xE7, (uint8_t[]) {0x44, 0x44}, 2, 0},
|
|
||||||
{0xE8, (uint8_t[]) {0x09, 0xE8, 0xD8, 0xA0, 0x0B, 0xEA, 0xD8, 0xA0, 0x0D, 0xEC, 0xD8, 0xA0, 0x0F, 0xEE, 0xD8, 0xA0}, 16, 0},
|
|
||||||
{0xEB, (uint8_t[]) {0x02, 0x00, 0xE4, 0xE4, 0x88, 0x00, 0x40}, 7, 0},
|
|
||||||
{0xEC, (uint8_t[]) {0x3C, 0x00}, 2, 0},
|
|
||||||
{0xED, (uint8_t[]) {0xAB, 0x89, 0x76, 0x54, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x45, 0x67, 0x98, 0xBA}, 16, 0},
|
|
||||||
//VAP & VAN
|
|
||||||
{0xFF, (uint8_t[]) {0x77, 0x01, 0x00, 0x00, 0x13}, 5, 0},
|
|
||||||
{0xE5, (uint8_t[]) {0xE4}, 1, 0},
|
|
||||||
{0xFF, (uint8_t[]) {0x77, 0x01, 0x00, 0x00, 0x00}, 5, 0},
|
|
||||||
{0x3A, (uint8_t[]) {0x60}, 1, 10}, //0x70 RGB888, 0x60 RGB666, 0x50 RGB565
|
|
||||||
{0x11, (uint8_t[]) {0x00}, 0, 120}, //Sleep Out
|
|
||||||
{0x29, (uint8_t[]) {0x00}, 0, 0}, //Display On
|
|
||||||
};
|
|
||||||
|
|
||||||
bool CydDisplay::start() {
|
|
||||||
TT_LOG_I(TAG, "Starting");
|
|
||||||
|
|
||||||
spi_line_config_t line_config = {
|
|
||||||
.cs_io_type = IO_TYPE_GPIO,
|
|
||||||
.cs_gpio_num = GPIO_NUM_39,
|
|
||||||
.scl_io_type = IO_TYPE_GPIO,
|
|
||||||
.scl_gpio_num = GPIO_NUM_48,
|
|
||||||
.sda_io_type = IO_TYPE_GPIO,
|
|
||||||
.sda_gpio_num = GPIO_NUM_47,
|
|
||||||
.io_expander = NULL,
|
|
||||||
};
|
|
||||||
esp_lcd_panel_io_3wire_spi_config_t panel_io_config = ST7701_PANEL_IO_3WIRE_SPI_CONFIG(line_config, 0);
|
|
||||||
ESP_ERROR_CHECK(esp_lcd_new_panel_io_3wire_spi(&panel_io_config, &ioHandle));
|
|
||||||
|
|
||||||
const esp_lcd_rgb_panel_config_t rgb_config = {
|
|
||||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
|
||||||
.timings = {
|
|
||||||
.pclk_hz = 14000000,
|
|
||||||
.h_res = 480,
|
|
||||||
.v_res = 480,
|
|
||||||
.hsync_pulse_width = 10,
|
|
||||||
.hsync_back_porch = 10,
|
|
||||||
.hsync_front_porch = 20,
|
|
||||||
.vsync_pulse_width = 10,
|
|
||||||
.vsync_back_porch = 10,
|
|
||||||
.vsync_front_porch = 10,
|
|
||||||
.flags = {
|
|
||||||
.hsync_idle_low = false,
|
|
||||||
.vsync_idle_low = false,
|
|
||||||
.de_idle_high = false,
|
|
||||||
.pclk_active_neg = false,
|
|
||||||
.pclk_idle_high = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.data_width = 16,
|
|
||||||
.bits_per_pixel = 16,
|
|
||||||
.num_fbs = 2,
|
|
||||||
.bounce_buffer_size_px = 480 * 10,
|
|
||||||
.sram_trans_align = 8,
|
|
||||||
.psram_trans_align = 64,
|
|
||||||
.hsync_gpio_num = GPIO_NUM_16,
|
|
||||||
.vsync_gpio_num = GPIO_NUM_17,
|
|
||||||
.de_gpio_num = GPIO_NUM_18,
|
|
||||||
.pclk_gpio_num = GPIO_NUM_21,
|
|
||||||
.disp_gpio_num = GPIO_NUM_NC,
|
|
||||||
.data_gpio_nums = {
|
|
||||||
GPIO_NUM_4, // B1
|
|
||||||
GPIO_NUM_5, // B2
|
|
||||||
GPIO_NUM_6, // B3
|
|
||||||
GPIO_NUM_7, // B4
|
|
||||||
GPIO_NUM_15, // B5
|
|
||||||
GPIO_NUM_8, // G1
|
|
||||||
GPIO_NUM_20, // G2
|
|
||||||
GPIO_NUM_3, // G3
|
|
||||||
GPIO_NUM_46, // G4
|
|
||||||
GPIO_NUM_9, // G5
|
|
||||||
GPIO_NUM_10, // G6
|
|
||||||
GPIO_NUM_11, // R1
|
|
||||||
GPIO_NUM_12, // R2
|
|
||||||
GPIO_NUM_13, // R3
|
|
||||||
GPIO_NUM_14, // R4
|
|
||||||
GPIO_NUM_0 // R5
|
|
||||||
},
|
|
||||||
.flags = {
|
|
||||||
.disp_active_low = false,
|
|
||||||
.refresh_on_demand = false,
|
|
||||||
.fb_in_psram = true,
|
|
||||||
.double_fb = true,
|
|
||||||
.no_fb = false,
|
|
||||||
.bb_invalidate_cache = true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
st7701_vendor_config_t vendor_config = {
|
|
||||||
.init_cmds = st7701_lcd_init_cmds,
|
|
||||||
.init_cmds_size = sizeof(st7701_lcd_init_cmds) / sizeof(st7701_lcd_init_cmd_t),
|
|
||||||
.rgb_config = &rgb_config,
|
|
||||||
.flags = {
|
|
||||||
.use_mipi_interface = 0,
|
|
||||||
.mirror_by_cmd = 1,
|
|
||||||
.auto_del_panel_io = 0,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const esp_lcd_panel_dev_config_t panel_config = {
|
|
||||||
.reset_gpio_num = GPIO_NUM_NC,
|
|
||||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_RGB,
|
|
||||||
.data_endian = LCD_RGB_DATA_ENDIAN_LITTLE,
|
|
||||||
.bits_per_pixel = 16,
|
|
||||||
.flags = {
|
|
||||||
.reset_active_high = false,
|
|
||||||
},
|
|
||||||
.vendor_config = &vendor_config,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (esp_lcd_new_panel_st7701(ioHandle, &panel_config, &panelHandle) != ESP_OK) {
|
|
||||||
TT_LOG_E(TAG, "Failed to create panel");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
|
|
||||||
TT_LOG_E(TAG, "Failed to reset panel");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
|
|
||||||
TT_LOG_E(TAG, "Failed to init panel");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (esp_lcd_panel_invert_color(panelHandle, false) != ESP_OK) {
|
|
||||||
TT_LOG_E(TAG, "Failed to invert color");
|
|
||||||
}
|
|
||||||
|
|
||||||
esp_lcd_panel_set_gap(panelHandle, 0, 0);
|
|
||||||
|
|
||||||
if (esp_lcd_panel_disp_on_off(panelHandle, true) != ESP_OK) {
|
|
||||||
TT_LOG_E(TAG, "Failed to turn display on");
|
|
||||||
}
|
|
||||||
|
|
||||||
const lvgl_port_display_cfg_t disp_cfg = {
|
|
||||||
.io_handle = ioHandle,
|
|
||||||
.panel_handle = panelHandle,
|
|
||||||
.control_handle = nullptr,
|
|
||||||
.buffer_size = (480 * 480),
|
|
||||||
.double_buffer = true,
|
|
||||||
.trans_size = 0,
|
|
||||||
.hres = 480,
|
|
||||||
.vres = 480,
|
|
||||||
.monochrome = false,
|
|
||||||
.rotation = {
|
|
||||||
.swap_xy = false,
|
|
||||||
.mirror_x = false,
|
|
||||||
.mirror_y = false,
|
|
||||||
},
|
|
||||||
.color_format = LV_COLOR_FORMAT_RGB565,
|
|
||||||
.flags = {
|
|
||||||
.buff_dma = false,
|
|
||||||
.buff_spiram = true,
|
|
||||||
.sw_rotate = false,
|
|
||||||
.swap_bytes = false,
|
|
||||||
.full_refresh = false,
|
|
||||||
.direct_mode = false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const lvgl_port_display_rgb_cfg_t rgb_cfg = {
|
|
||||||
.flags = {
|
|
||||||
.bb_mode = true,
|
|
||||||
.avoid_tearing = false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
displayHandle = lvgl_port_add_disp_rgb(&disp_cfg, &rgb_cfg);
|
|
||||||
TT_LOG_I(TAG, "Finished");
|
|
||||||
return displayHandle != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CydDisplay::stop() {
|
|
||||||
assert(displayHandle != nullptr);
|
|
||||||
|
|
||||||
lvgl_port_remove_disp(displayHandle);
|
|
||||||
|
|
||||||
if (esp_lcd_panel_del(panelHandle) != ESP_OK) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (esp_lcd_panel_io_del(ioHandle) != ESP_OK) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
displayHandle = nullptr;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable CydDisplay::createTouch() {
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
480,
|
|
||||||
480
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
void CydDisplay::setBacklightDuty(uint8_t backlightDuty) {
|
|
||||||
driver::pwmbacklight::setBacklightDuty(backlightDuty);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
return std::make_shared<CydDisplay>();
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <esp_lcd_types.h>
|
|
||||||
#include <lvgl.h>
|
|
||||||
|
|
||||||
class CydDisplay : public tt::hal::display::DisplayDevice {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
|
||||||
esp_lcd_panel_handle_t panelHandle = nullptr;
|
|
||||||
lv_display_t* displayHandle = nullptr;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
std::string getName() const final { return "ST7701S"; }
|
|
||||||
std::string getDescription() const final { return "RGB Display"; }
|
|
||||||
|
|
||||||
bool start() override;
|
|
||||||
|
|
||||||
bool stop() override;
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() override;
|
|
||||||
|
|
||||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
|
||||||
bool supportsBacklightDuty() const override { return true; }
|
|
||||||
|
|
||||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
|
||||||
};
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#include "CydSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto config = std::make_unique<SpiSdCardDevice::Config>(
|
|
||||||
GPIO_NUM_42,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot
|
|
||||||
);
|
|
||||||
|
|
||||||
auto sdcard = std::make_shared<SpiSdCardDevice>(
|
|
||||||
std::move(config)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::static_pointer_cast<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRCS ${SOURCE_FILES}
|
|
||||||
INCLUDE_DIRS "Source"
|
|
||||||
REQUIRES Tactility esp_lvgl_port esp_lcd RgbDisplay GT911 PwmBacklight driver vfs fatfs
|
|
||||||
)
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
#include "CYD8048S043C.h" // Don't remove, or we get a linker error ("undefined reference to `cyd_8048s043c_config'" - GCC bug?)
|
|
||||||
#include "PwmBacklight.h"
|
|
||||||
#include "hal/CydDisplay.h"
|
|
||||||
#include "hal/CydSdCard.h"
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_2, 200);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Configuration cyd_8048s043c_config = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
|
||||||
//Touch
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Internal",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_19,
|
|
||||||
.scl_io_num = GPIO_NUM_20,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//P4 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "External",
|
|
||||||
.port = I2C_NUM_1,
|
|
||||||
.initMode = i2c::InitMode::Disabled,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_17,
|
|
||||||
.scl_io_num = GPIO_NUM_18,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
//SD Card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_11,
|
|
||||||
.miso_io_num = GPIO_NUM_13,
|
|
||||||
.sclk_io_num = GPIO_NUM_12,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
//P4 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_17,
|
|
||||||
.txPin = GPIO_NUM_18,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 9600,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
// Capacitive touch version of the 4.3" yellow board
|
|
||||||
extern const tt::hal::Configuration cyd_8048s043c_config;
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
#include "CydDisplay.h"
|
|
||||||
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
#include <RgbDisplay.h>
|
|
||||||
#include <Tactility/Log.h>
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
|
|
||||||
// Note for future changes: Reset pin is 38 and interrupt pin is 18
|
|
||||||
// or INT = NC, schematic and other info floating around is kinda conflicting...
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
800,
|
|
||||||
480
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
constexpr uint32_t bufferPixels = 800 * 10;
|
|
||||||
|
|
||||||
esp_lcd_rgb_panel_config_t rgb_panel_config = {
|
|
||||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
|
||||||
.timings = {
|
|
||||||
.pclk_hz = 16000000,
|
|
||||||
.h_res = 800,
|
|
||||||
.v_res = 480,
|
|
||||||
.hsync_pulse_width = 4,
|
|
||||||
.hsync_back_porch = 8,
|
|
||||||
.hsync_front_porch = 8,
|
|
||||||
.vsync_pulse_width = 4,
|
|
||||||
.vsync_back_porch = 8,
|
|
||||||
.vsync_front_porch = 8,
|
|
||||||
.flags = {
|
|
||||||
.hsync_idle_low = false,
|
|
||||||
.vsync_idle_low = false,
|
|
||||||
.de_idle_high = false,
|
|
||||||
.pclk_active_neg = true,
|
|
||||||
.pclk_idle_high = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.data_width = 16,
|
|
||||||
.bits_per_pixel = 0,
|
|
||||||
.num_fbs = 2,
|
|
||||||
.bounce_buffer_size_px = bufferPixels,
|
|
||||||
.sram_trans_align = 8,
|
|
||||||
.psram_trans_align = 64,
|
|
||||||
.hsync_gpio_num = GPIO_NUM_39,
|
|
||||||
.vsync_gpio_num = GPIO_NUM_41,
|
|
||||||
.de_gpio_num = GPIO_NUM_40 ,
|
|
||||||
.pclk_gpio_num = GPIO_NUM_42,
|
|
||||||
.disp_gpio_num = GPIO_NUM_NC,
|
|
||||||
.data_gpio_nums = {
|
|
||||||
GPIO_NUM_8, // B3
|
|
||||||
GPIO_NUM_3, // B4
|
|
||||||
GPIO_NUM_46, // B5
|
|
||||||
GPIO_NUM_9, // B6
|
|
||||||
GPIO_NUM_1, // B7
|
|
||||||
GPIO_NUM_5, // G2
|
|
||||||
GPIO_NUM_6, // G3
|
|
||||||
GPIO_NUM_7, // G4
|
|
||||||
GPIO_NUM_15, // G5
|
|
||||||
GPIO_NUM_16, // G6
|
|
||||||
GPIO_NUM_4, // G7
|
|
||||||
GPIO_NUM_45, // R3
|
|
||||||
GPIO_NUM_48, // R4
|
|
||||||
GPIO_NUM_47, // R5
|
|
||||||
GPIO_NUM_21, // R6
|
|
||||||
GPIO_NUM_14, // R7
|
|
||||||
},
|
|
||||||
.flags = {
|
|
||||||
.disp_active_low = false,
|
|
||||||
.refresh_on_demand = false,
|
|
||||||
.fb_in_psram = true,
|
|
||||||
.double_fb = true,
|
|
||||||
.no_fb = false,
|
|
||||||
.bb_invalidate_cache = false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
RgbDisplay::BufferConfiguration buffer_config = {
|
|
||||||
.size = (800 * 480),
|
|
||||||
.useSpi = true,
|
|
||||||
.doubleBuffer = true,
|
|
||||||
.bounceBufferMode = true,
|
|
||||||
.avoidTearing = false
|
|
||||||
};
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<RgbDisplay::Configuration>(
|
|
||||||
rgb_panel_config,
|
|
||||||
buffer_config,
|
|
||||||
touch,
|
|
||||||
LV_COLOR_FORMAT_RGB565,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
driver::pwmbacklight::setBacklightDuty
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<RgbDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "CydSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto config = std::make_unique<SpiSdCardDevice::Config>(
|
|
||||||
GPIO_NUM_10,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot
|
|
||||||
);
|
|
||||||
|
|
||||||
auto sdcard = std::make_shared<SpiSdCardDevice>(
|
|
||||||
std::move(config)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::static_pointer_cast<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRCS ${SOURCE_FILES}
|
|
||||||
INCLUDE_DIRS "Source"
|
|
||||||
REQUIRES Tactility esp_lvgl_port ST7789 CST816S PwmBacklight driver vfs fatfs
|
|
||||||
)
|
|
||||||
@@ -1,148 +0,0 @@
|
|||||||
#include "JC2432W328C.h"
|
|
||||||
#include "hal/YellowDisplay.h"
|
|
||||||
#include "hal/YellowDisplayConstants.h"
|
|
||||||
#include "hal/YellowSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
#define CYD_SPI_TRANSFER_SIZE_LIMIT (JC2432W328C_LCD_DRAW_BUFFER_SIZE * LV_COLOR_DEPTH / 8)
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
//Set the RGB Led Pins to output and turn them off
|
|
||||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
|
|
||||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
|
|
||||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
|
|
||||||
|
|
||||||
//0 on, 1 off... yep it's backwards.
|
|
||||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
|
|
||||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
|
|
||||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
|
|
||||||
|
|
||||||
return driver::pwmbacklight::init(JC2432W328C_LCD_PIN_BACKLIGHT);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Configuration cyd_jc2432w328c_config = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createYellowSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
|
||||||
//Touch
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Internal",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_33,
|
|
||||||
.scl_io_num = GPIO_NUM_32,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "External",
|
|
||||||
.port = I2C_NUM_1,
|
|
||||||
.initMode = i2c::InitMode::Disabled,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_21,
|
|
||||||
.scl_io_num = GPIO_NUM_22,
|
|
||||||
.sda_pullup_en = false,
|
|
||||||
.scl_pullup_en = false,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
//Display
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_13,
|
|
||||||
.miso_io_num = GPIO_NUM_NC,
|
|
||||||
.sclk_io_num = GPIO_NUM_14,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = CYD_SPI_TRANSFER_SIZE_LIMIT,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock()
|
|
||||||
},
|
|
||||||
//SD Card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_23,
|
|
||||||
.miso_io_num = GPIO_NUM_19,
|
|
||||||
.sclk_io_num = GPIO_NUM_18,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
//CN1 header, JST SH 1.25, GND / IO22 / IO21 / 3.3V
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_21,
|
|
||||||
.txPin = GPIO_NUM_22,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 9600,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
// Capacitive touch version of the 2.8" yellow board
|
|
||||||
extern const tt::hal::Configuration cyd_jc2432w328c_config;
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
#include "YellowDisplay.h"
|
|
||||||
#include "Cst816Touch.h"
|
|
||||||
#include "YellowDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <St7789Display.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
||||||
auto configuration = std::make_unique<Cst816sTouch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
240,
|
|
||||||
320
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Cst816sTouch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<St7789Display::Configuration>(
|
|
||||||
JC2432W328C_LCD_SPI_HOST,
|
|
||||||
JC2432W328C_LCD_PIN_CS,
|
|
||||||
JC2432W328C_LCD_PIN_DC,
|
|
||||||
JC2432W328C_LCD_HORIZONTAL_RESOLUTION,
|
|
||||||
JC2432W328C_LCD_VERTICAL_RESOLUTION,
|
|
||||||
touch,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
JC2432W328C_LCD_DRAW_BUFFER_SIZE
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<St7789Display>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
// Display backlight (PWM)
|
|
||||||
#define JC2432W328C_LCD_PIN_BACKLIGHT GPIO_NUM_27
|
|
||||||
|
|
||||||
// Display
|
|
||||||
#define JC2432W328C_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define JC2432W328C_LCD_HORIZONTAL_RESOLUTION 240
|
|
||||||
#define JC2432W328C_LCD_VERTICAL_RESOLUTION 320
|
|
||||||
#define JC2432W328C_LCD_DRAW_BUFFER_HEIGHT (JC2432W328C_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
#define JC2432W328C_LCD_DRAW_BUFFER_SIZE (JC2432W328C_LCD_HORIZONTAL_RESOLUTION * JC2432W328C_LCD_DRAW_BUFFER_HEIGHT)
|
|
||||||
#define JC2432W328C_LCD_PIN_CS GPIO_NUM_15
|
|
||||||
#define JC2432W328C_LCD_PIN_DC GPIO_NUM_2
|
|
||||||
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
#include "YellowSdCard.h"
|
|
||||||
|
|
||||||
#define TAG "jc2432w328c_sdcard"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
#define SDCARD_SPI_HOST SPI3_HOST
|
|
||||||
#define SDCARD_PIN_CS GPIO_NUM_5
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createYellowSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
SDCARD_PIN_CS,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
std::make_shared<tt::Mutex>(),
|
|
||||||
std::vector<gpio_num_t>(),
|
|
||||||
SDCARD_SPI_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createYellowSdCard();
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRCS ${SOURCE_FILES}
|
|
||||||
INCLUDE_DIRS "Source"
|
|
||||||
REQUIRES Tactility esp_lvgl_port esp_lcd RgbDisplay GT911 PwmBacklight driver vfs fatfs
|
|
||||||
)
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
#include "JC8048W550C.h" // Don't remove, or we get a linker error ("undefined reference to `cyd_jc8048w550c_config'" - GCC bug?)
|
|
||||||
#include "PwmBacklight.h"
|
|
||||||
#include "hal/CydDisplay.h"
|
|
||||||
#include "hal/CydSdCard.h"
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_2);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Configuration cyd_jc8048w550c_config = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.power = nullptr,
|
|
||||||
.i2c = {
|
|
||||||
//Touch
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Internal",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_19,
|
|
||||||
.scl_io_num = GPIO_NUM_20,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//P4 header, JST SH 1.25, GND / 3.3V / IO17 / IO18 or
|
|
||||||
//P5 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "External",
|
|
||||||
.port = I2C_NUM_1,
|
|
||||||
.initMode = i2c::InitMode::Disabled,
|
|
||||||
.isMutable = true,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_17,
|
|
||||||
.scl_io_num = GPIO_NUM_18,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
//SD Card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_11,
|
|
||||||
.miso_io_num = GPIO_NUM_13,
|
|
||||||
.sclk_io_num = GPIO_NUM_12,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
//P4 header, JST SH 1.0, GND / 3.3V / IO17 / IO18
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_17,
|
|
||||||
.txPin = GPIO_NUM_18,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 9600,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
// Capacitive touch version of the 5" black board
|
|
||||||
extern const tt::hal::Configuration cyd_jc8048w550c_config;
|
|
||||||
@@ -1,106 +0,0 @@
|
|||||||
#include "RgbDisplay.h"
|
|
||||||
|
|
||||||
#include "CydDisplay.h"
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <Tactility/Log.h>
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
|
|
||||||
// Note for future changes: Reset pin is 38 and interrupt pin is 18
|
|
||||||
// or INT = NC, schematic and other info floating around is kinda conflicting...
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
800,
|
|
||||||
480
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
constexpr uint32_t bufferPixels = 800 * 10;
|
|
||||||
|
|
||||||
esp_lcd_rgb_panel_config_t rgb_panel_config = {
|
|
||||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
|
||||||
.timings = {
|
|
||||||
.pclk_hz = 16000000,
|
|
||||||
.h_res = 800,
|
|
||||||
.v_res = 480,
|
|
||||||
.hsync_pulse_width = 4,
|
|
||||||
.hsync_back_porch = 8,
|
|
||||||
.hsync_front_porch = 8,
|
|
||||||
.vsync_pulse_width = 4,
|
|
||||||
.vsync_back_porch = 8,
|
|
||||||
.vsync_front_porch = 8,
|
|
||||||
.flags = {
|
|
||||||
.hsync_idle_low = false,
|
|
||||||
.vsync_idle_low = false,
|
|
||||||
.de_idle_high = false,
|
|
||||||
.pclk_active_neg = true,
|
|
||||||
.pclk_idle_high = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.data_width = 16,
|
|
||||||
.bits_per_pixel = 0,
|
|
||||||
.num_fbs = 2,
|
|
||||||
.bounce_buffer_size_px = bufferPixels,
|
|
||||||
.sram_trans_align = 8,
|
|
||||||
.psram_trans_align = 64,
|
|
||||||
.hsync_gpio_num = GPIO_NUM_39,
|
|
||||||
.vsync_gpio_num = GPIO_NUM_41,
|
|
||||||
.de_gpio_num = GPIO_NUM_40 ,
|
|
||||||
.pclk_gpio_num = GPIO_NUM_42,
|
|
||||||
.disp_gpio_num = GPIO_NUM_NC,
|
|
||||||
.data_gpio_nums = {
|
|
||||||
GPIO_NUM_8, // B3
|
|
||||||
GPIO_NUM_3, // B4
|
|
||||||
GPIO_NUM_46, // B5
|
|
||||||
GPIO_NUM_9, // B6
|
|
||||||
GPIO_NUM_1, // B7
|
|
||||||
GPIO_NUM_5, // G2
|
|
||||||
GPIO_NUM_6, // G3
|
|
||||||
GPIO_NUM_7, // G4
|
|
||||||
GPIO_NUM_15, // G5
|
|
||||||
GPIO_NUM_16, // G6
|
|
||||||
GPIO_NUM_4, // G7
|
|
||||||
GPIO_NUM_45, // R3
|
|
||||||
GPIO_NUM_48, // R4
|
|
||||||
GPIO_NUM_47, // R5
|
|
||||||
GPIO_NUM_21, // R6
|
|
||||||
GPIO_NUM_14, // R7
|
|
||||||
},
|
|
||||||
.flags = {
|
|
||||||
.disp_active_low = false,
|
|
||||||
.refresh_on_demand = false,
|
|
||||||
.fb_in_psram = true,
|
|
||||||
.double_fb = true,
|
|
||||||
.no_fb = false,
|
|
||||||
.bb_invalidate_cache = false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
RgbDisplay::BufferConfiguration buffer_config = {
|
|
||||||
.size = (800 * 480),
|
|
||||||
.useSpi = true,
|
|
||||||
.doubleBuffer = true,
|
|
||||||
.bounceBufferMode = true,
|
|
||||||
.avoidTearing = false
|
|
||||||
};
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<RgbDisplay::Configuration>(
|
|
||||||
rgb_panel_config,
|
|
||||||
buffer_config,
|
|
||||||
touch,
|
|
||||||
LV_COLOR_FORMAT_RGB565,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
driver::pwmbacklight::setBacklightDuty
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<RgbDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#include "CydSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto config = std::make_unique<SpiSdCardDevice::Config>(
|
|
||||||
GPIO_NUM_10,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
std::make_shared<tt::Mutex>(),
|
|
||||||
std::vector<gpio_num_t>(),
|
|
||||||
SPI2_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto sdcard = std::make_shared<SpiSdCardDevice>(
|
|
||||||
std::move(config)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::static_pointer_cast<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
#include "PwmBacklight.h"
|
|
||||||
#include "Tactility/lvgl/LvglSync.h"
|
|
||||||
#include "hal/CrowPanelDisplay.h"
|
|
||||||
#include "hal/CrowPanelDisplayConstants.h"
|
|
||||||
#include "hal/CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_38);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern const Configuration crowpanel_advance_28 = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.i2c = {
|
|
||||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
|
||||||
// Note: You could repurpose 1 or more UART interfaces as I2C interfaces
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Main",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_15,
|
|
||||||
.scl_io_num = GPIO_NUM_16,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
// Display
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_DISABLED,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_39,
|
|
||||||
.miso_io_num = GPIO_NUM_NC,
|
|
||||||
.sclk_io_num = GPIO_NUM_42,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = CROWPANEL_SPI_TRANSFER_SIZE_LIMIT,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
|
||||||
},
|
|
||||||
// SD card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_6,
|
|
||||||
.miso_io_num = GPIO_NUM_4,
|
|
||||||
.sclk_io_num = GPIO_NUM_5,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 32768,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr // No custom lock needed
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
// "UART0-IN"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART0",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_44,
|
|
||||||
.txPin = GPIO_NUM_43,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// "UART1-OUT"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_2,
|
|
||||||
.rxPin = GPIO_NUM_18,
|
|
||||||
.txPin = GPIO_NUM_17,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
extern const tt::hal::Configuration crowpanel_advance_28;
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
#include "CrowPanelDisplay.h"
|
|
||||||
#include "CrowPanelDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <Ft5x06Touch.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
#include <St7789Display.h>
|
|
||||||
|
|
||||||
#define TAG "crowpanel_display"
|
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
||||||
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
|
||||||
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
240,
|
|
||||||
320,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Ft5x06Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<St7789Display::Configuration>(
|
|
||||||
CROWPANEL_LCD_SPI_HOST,
|
|
||||||
CROWPANEL_LCD_PIN_CS,
|
|
||||||
CROWPANEL_LCD_PIN_DC,
|
|
||||||
320,
|
|
||||||
240,
|
|
||||||
touch,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<St7789Display>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <esp_lcd_types.h>
|
|
||||||
#include <lvgl.h>
|
|
||||||
|
|
||||||
class CrowPanelDisplay : public tt::hal::display::DisplayDevice {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
|
||||||
esp_lcd_panel_handle_t panelHandle = nullptr;
|
|
||||||
lv_display_t* displayHandle = nullptr;
|
|
||||||
bool poweredOn = false;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
std::string getName() const final { return "ST7789"; }
|
|
||||||
std::string getDescription() const final { return "SPI display"; }
|
|
||||||
|
|
||||||
bool start() override;
|
|
||||||
|
|
||||||
bool stop() override;
|
|
||||||
|
|
||||||
void setPowerOn(bool turnOn) override;
|
|
||||||
bool isPoweredOn() const override { return poweredOn; };
|
|
||||||
bool supportsPowerControl() const override { return true; }
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() override;
|
|
||||||
|
|
||||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
|
||||||
bool supportsBacklightDuty() const override { return true; }
|
|
||||||
|
|
||||||
void setGammaCurve(uint8_t index) override;
|
|
||||||
uint8_t getGammaCurveCount() const override { return 4; };
|
|
||||||
|
|
||||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
|
||||||
};
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define CROWPANEL_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define CROWPANEL_LCD_PIN_CS GPIO_NUM_40
|
|
||||||
#define CROWPANEL_LCD_PIN_DC GPIO_NUM_41 // RS
|
|
||||||
#define CROWPANEL_LCD_HORIZONTAL_RESOLUTION 320
|
|
||||||
#define CROWPANEL_LCD_VERTICAL_RESOLUTION 240
|
|
||||||
#define CROWPANEL_LCD_SPI_TRANSFER_HEIGHT (CROWPANEL_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#include "CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
|
|
||||||
#include <esp_vfs_fat.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
#define CROWPANEL_SDCARD_PIN_CS GPIO_NUM_7
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
CROWPANEL_SDCARD_PIN_CS,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
tt::lvgl::getSyncLock(),
|
|
||||||
{},
|
|
||||||
SPI3_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,142 +0,0 @@
|
|||||||
#include "PwmBacklight.h"
|
|
||||||
#include "Tactility/lvgl/LvglSync.h"
|
|
||||||
#include "hal/CrowPanelDisplay.h"
|
|
||||||
#include "hal/CrowPanelDisplayConstants.h"
|
|
||||||
#include "hal/CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_38);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern const Configuration crowpanel_advance_35 = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.i2c = {
|
|
||||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
|
||||||
// Note: You could repurpose 1 or more UART interfaces as I2C interfaces
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Main",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_15,
|
|
||||||
.scl_io_num = GPIO_NUM_16,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
// Display
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_DISABLED,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_39,
|
|
||||||
.miso_io_num = GPIO_NUM_NC,
|
|
||||||
.sclk_io_num = GPIO_NUM_42,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = CROWPANEL_SPI_TRANSFER_SIZE_LIMIT,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
|
||||||
},
|
|
||||||
// SD card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_6,
|
|
||||||
.miso_io_num = GPIO_NUM_4,
|
|
||||||
.sclk_io_num = GPIO_NUM_5,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 32768,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr // No custom lock needed
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
// "UART0-IN"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART0",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_44,
|
|
||||||
.txPin = GPIO_NUM_43,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// "UART1-OUT"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_2,
|
|
||||||
.rxPin = GPIO_NUM_18,
|
|
||||||
.txPin = GPIO_NUM_17,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
extern const tt::hal::Configuration crowpanel_advance_35;
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#include "CrowPanelDisplay.h"
|
|
||||||
#include "CrowPanelDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
#include <Ili9488Display.h>
|
|
||||||
|
|
||||||
#define TAG "crowpanel_display"
|
|
||||||
|
|
||||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
|
||||||
// Note for future changes: Reset pin is 48 and interrupt pin is 47
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
320,
|
|
||||||
480
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<Ili9488Display::Configuration>(
|
|
||||||
CROWPANEL_LCD_SPI_HOST,
|
|
||||||
CROWPANEL_LCD_PIN_CS,
|
|
||||||
CROWPANEL_LCD_PIN_DC,
|
|
||||||
CROWPANEL_LCD_HORIZONTAL_RESOLUTION,
|
|
||||||
CROWPANEL_LCD_VERTICAL_RESOLUTION,
|
|
||||||
touch,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<Ili9488Display>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <esp_lcd_types.h>
|
|
||||||
#include <lvgl.h>
|
|
||||||
|
|
||||||
class CrowPanelDisplay : public tt::hal::display::DisplayDevice {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
|
||||||
esp_lcd_panel_handle_t panelHandle = nullptr;
|
|
||||||
lv_display_t* displayHandle = nullptr;
|
|
||||||
bool poweredOn = false;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
std::string getName() const final { return "ST7789"; }
|
|
||||||
std::string getDescription() const final { return "SPI display"; }
|
|
||||||
|
|
||||||
bool start() override;
|
|
||||||
|
|
||||||
bool stop() override;
|
|
||||||
|
|
||||||
void setPowerOn(bool turnOn) override;
|
|
||||||
bool isPoweredOn() const override { return poweredOn; };
|
|
||||||
bool supportsPowerControl() const override { return true; }
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() override;
|
|
||||||
|
|
||||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
|
||||||
bool supportsBacklightDuty() const override { return true; }
|
|
||||||
|
|
||||||
void setGammaCurve(uint8_t index) override;
|
|
||||||
uint8_t getGammaCurveCount() const override { return 4; };
|
|
||||||
|
|
||||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
|
||||||
};
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define CROWPANEL_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define CROWPANEL_LCD_PIN_CS GPIO_NUM_40
|
|
||||||
#define CROWPANEL_LCD_PIN_DC GPIO_NUM_41 // RS
|
|
||||||
#define CROWPANEL_LCD_HORIZONTAL_RESOLUTION 320
|
|
||||||
#define CROWPANEL_LCD_VERTICAL_RESOLUTION 480
|
|
||||||
#define CROWPANEL_LCD_SPI_TRANSFER_HEIGHT (CROWPANEL_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#include "CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
|
|
||||||
#include <esp_vfs_fat.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
#define CROWPANEL_SDCARD_PIN_CS GPIO_NUM_7
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
CROWPANEL_SDCARD_PIN_CS,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
tt::lvgl::getSyncLock(),
|
|
||||||
{},
|
|
||||||
SPI3_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
#include "hal/CrowPanelDisplay.h"
|
|
||||||
#include "hal/CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
#include <TCA9534.h>
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
TCA9534_IO_EXP io_expander = {
|
|
||||||
.I2C_ADDR = 0x18,
|
|
||||||
.i2c_master_port = I2C_NUM_0,
|
|
||||||
.interrupt_pin = GPIO_NUM_NC,
|
|
||||||
.interrupt_task = nullptr
|
|
||||||
};
|
|
||||||
|
|
||||||
// Enable LCD backlight
|
|
||||||
set_tca9534_io_pin_direction(&io_expander, TCA9534_IO1, TCA9534_OUTPUT);
|
|
||||||
set_tca9534_io_pin_output_state(&io_expander, TCA9534_IO1, 255);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
extern const Configuration crowpanel_advance_50 = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.i2c = {
|
|
||||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
|
||||||
// Note: You could repurpose 1 or more UART interfaces as I2C interfaces
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Main",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_15,
|
|
||||||
.scl_io_num = GPIO_NUM_16,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
// SD card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_6,
|
|
||||||
.miso_io_num = GPIO_NUM_4,
|
|
||||||
.sclk_io_num = GPIO_NUM_5,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr // No custom lock needed
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
// "UART0-OUT"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART0",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_44,
|
|
||||||
.txPin = GPIO_NUM_43,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// "UART1-OUT"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_2,
|
|
||||||
.rxPin = GPIO_NUM_19,
|
|
||||||
.txPin = GPIO_NUM_20,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
extern const tt::hal::Configuration crowpanel_advance_50;
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
#include "CrowPanelDisplay.h"
|
|
||||||
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <RgbDisplay.h>
|
|
||||||
#include <Tactility/Log.h>
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
|
|
||||||
// Note for future changes: Reset pin is 38 and interrupt pin is 18
|
|
||||||
// or INT = NC, schematic and other info floating around is kinda conflicting...
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
800,
|
|
||||||
480
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
constexpr uint32_t bufferPixels = 800 * 10;
|
|
||||||
|
|
||||||
esp_lcd_rgb_panel_config_t rgb_panel_config = {
|
|
||||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
|
||||||
.timings = {
|
|
||||||
.pclk_hz = 15000000, // TODO: 21 MHz was too much and caused drift when opening wifi/SD/apps. Try something inbetween 15 and 21 MHz.
|
|
||||||
.h_res = 800,
|
|
||||||
.v_res = 480,
|
|
||||||
.hsync_pulse_width = 4,
|
|
||||||
.hsync_back_porch = 8,
|
|
||||||
.hsync_front_porch = 8,
|
|
||||||
.vsync_pulse_width = 4,
|
|
||||||
.vsync_back_porch = 8,
|
|
||||||
.vsync_front_porch = 8,
|
|
||||||
.flags = {
|
|
||||||
.hsync_idle_low = false,
|
|
||||||
.vsync_idle_low = false,
|
|
||||||
.de_idle_high = false,
|
|
||||||
.pclk_active_neg = true,
|
|
||||||
.pclk_idle_high = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.data_width = 16,
|
|
||||||
.bits_per_pixel = 0,
|
|
||||||
.num_fbs = 2,
|
|
||||||
.bounce_buffer_size_px = bufferPixels,
|
|
||||||
.sram_trans_align = 8,
|
|
||||||
.psram_trans_align = 64,
|
|
||||||
.hsync_gpio_num = GPIO_NUM_40,
|
|
||||||
.vsync_gpio_num = GPIO_NUM_41,
|
|
||||||
.de_gpio_num = GPIO_NUM_42 ,
|
|
||||||
.pclk_gpio_num = GPIO_NUM_39,
|
|
||||||
.disp_gpio_num = GPIO_NUM_NC,
|
|
||||||
.data_gpio_nums = {
|
|
||||||
GPIO_NUM_21, // B3
|
|
||||||
GPIO_NUM_47, // B4
|
|
||||||
GPIO_NUM_48, // B5
|
|
||||||
GPIO_NUM_45, // B6
|
|
||||||
GPIO_NUM_38, // B7
|
|
||||||
GPIO_NUM_9, // G2
|
|
||||||
GPIO_NUM_10, // G3
|
|
||||||
GPIO_NUM_11, // G4
|
|
||||||
GPIO_NUM_12, // G5
|
|
||||||
GPIO_NUM_13, // G6
|
|
||||||
GPIO_NUM_14, // G7
|
|
||||||
GPIO_NUM_7, // R3
|
|
||||||
GPIO_NUM_17, // R4
|
|
||||||
GPIO_NUM_18, // R5
|
|
||||||
GPIO_NUM_3, // R6
|
|
||||||
GPIO_NUM_46, // R7
|
|
||||||
},
|
|
||||||
.flags = {
|
|
||||||
.disp_active_low = false,
|
|
||||||
.refresh_on_demand = false,
|
|
||||||
.fb_in_psram = true,
|
|
||||||
.double_fb = true,
|
|
||||||
.no_fb = false,
|
|
||||||
.bb_invalidate_cache = false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
RgbDisplay::BufferConfiguration buffer_config = {
|
|
||||||
.size = (800 * 480),
|
|
||||||
.useSpi = true,
|
|
||||||
.doubleBuffer = true,
|
|
||||||
.bounceBufferMode = true,
|
|
||||||
.avoidTearing = false
|
|
||||||
};
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<RgbDisplay::Configuration>(
|
|
||||||
rgb_panel_config,
|
|
||||||
buffer_config,
|
|
||||||
touch,
|
|
||||||
LV_COLOR_FORMAT_RGB565,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<RgbDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#include "CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
#include <esp_vfs_fat.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
// See https://github.com/Elecrow-RD/CrowPanel-Advance-HMI-ESP32-AI-Display/blob/master/5.0/factory_code/factory_code.ino
|
|
||||||
GPIO_NUM_0, // It's actually not connected, but in the demo pin 0 is used
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
#include "PwmBacklight.h"
|
|
||||||
#include "Tactility/lvgl/LvglSync.h"
|
|
||||||
#include "hal/CrowPanelDisplay.h"
|
|
||||||
#include "hal/CrowPanelDisplayConstants.h"
|
|
||||||
#include "hal/CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Xpt2046Power.h>
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_27);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern const Configuration crowpanel_basic_28 = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.power = getOrCreatePower,
|
|
||||||
.i2c = {
|
|
||||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
|
||||||
// Note: You could repurpose 1 or more UART interfaces as I2C interfaces
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Main",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_22,
|
|
||||||
.scl_io_num = GPIO_NUM_21,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
// Display
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_DISABLED,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_13,
|
|
||||||
.miso_io_num = GPIO_NUM_12,
|
|
||||||
.sclk_io_num = GPIO_NUM_14,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = CROWPANEL_SPI_TRANSFER_SIZE_LIMIT,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
|
||||||
},
|
|
||||||
// SD card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_23,
|
|
||||||
.miso_io_num = GPIO_NUM_19,
|
|
||||||
.sclk_io_num = GPIO_NUM_18,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 32768,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr // No custom lock needed
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
// "UART1"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_16,
|
|
||||||
.txPin = GPIO_NUM_17,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
extern const tt::hal::Configuration crowpanel_basic_28;
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#include "CrowPanelDisplay.h"
|
|
||||||
#include "CrowPanelDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <Ili934xDisplay.h>
|
|
||||||
#include <Xpt2046Touch.h>
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
std::shared_ptr<Xpt2046Touch> createTouch() {
|
|
||||||
auto configuration = std::make_unique<Xpt2046Touch::Configuration>(
|
|
||||||
CROWPANEL_LCD_SPI_HOST,
|
|
||||||
CROWPANEL_TOUCH_PIN_CS,
|
|
||||||
240,
|
|
||||||
320,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Xpt2046Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<Ili934xDisplay::Configuration>(
|
|
||||||
CROWPANEL_LCD_SPI_HOST,
|
|
||||||
CROWPANEL_LCD_PIN_CS,
|
|
||||||
CROWPANEL_LCD_PIN_DC,
|
|
||||||
240,
|
|
||||||
320,
|
|
||||||
touch
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->mirrorX = true;
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<Ili934xDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <esp_lcd_types.h>
|
|
||||||
#include <lvgl.h>
|
|
||||||
|
|
||||||
class CrowPanelDisplay : public tt::hal::display::DisplayDevice {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
|
||||||
esp_lcd_panel_handle_t panelHandle = nullptr;
|
|
||||||
lv_display_t* displayHandle = nullptr;
|
|
||||||
bool poweredOn = false;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
std::string getName() const final { return "ST7789"; }
|
|
||||||
std::string getDescription() const final { return "SPI display"; }
|
|
||||||
|
|
||||||
bool start() override;
|
|
||||||
|
|
||||||
bool stop() override;
|
|
||||||
|
|
||||||
void setPowerOn(bool turnOn) override;
|
|
||||||
bool isPoweredOn() const override { return poweredOn; };
|
|
||||||
bool supportsPowerControl() const override { return true; }
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() override;
|
|
||||||
|
|
||||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
|
||||||
bool supportsBacklightDuty() const override { return true; }
|
|
||||||
|
|
||||||
void setGammaCurve(uint8_t index) override;
|
|
||||||
uint8_t getGammaCurveCount() const override { return 4; };
|
|
||||||
|
|
||||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
|
||||||
};
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define CROWPANEL_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define CROWPANEL_LCD_PIN_CS GPIO_NUM_15
|
|
||||||
#define CROWPANEL_TOUCH_PIN_CS GPIO_NUM_33
|
|
||||||
#define CROWPANEL_LCD_PIN_DC GPIO_NUM_2 // RS
|
|
||||||
#define CROWPANEL_LCD_HORIZONTAL_RESOLUTION 320
|
|
||||||
#define CROWPANEL_LCD_VERTICAL_RESOLUTION 240
|
|
||||||
#define CROWPANEL_LCD_SPI_TRANSFER_HEIGHT (CROWPANEL_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#include "CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
|
|
||||||
#include <esp_vfs_fat.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
GPIO_NUM_5,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
tt::lvgl::getSyncLock(),
|
|
||||||
{},
|
|
||||||
SPI3_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRCS ${SOURCE_FILES}
|
|
||||||
INCLUDE_DIRS "Source"
|
|
||||||
REQUIRES Tactility esp_lvgl_port ILI9488 XPT2046 PwmBacklight driver
|
|
||||||
)
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
#include "PwmBacklight.h"
|
|
||||||
#include "Tactility/lvgl/LvglSync.h"
|
|
||||||
#include "hal/CrowPanelDisplay.h"
|
|
||||||
#include "hal/CrowPanelDisplayConstants.h"
|
|
||||||
#include "hal/CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Xpt2046Power.h>
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
#define CROWPANEL_SPI_TRANSFER_SIZE_LIMIT (CROWPANEL_LCD_HORIZONTAL_RESOLUTION * CROWPANEL_LCD_SPI_TRANSFER_HEIGHT * (LV_COLOR_DEPTH / 8))
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_27);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern const Configuration crowpanel_basic_35 = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.power = getOrCreatePower,
|
|
||||||
.i2c = {
|
|
||||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
|
||||||
// Note: You could repurpose 1 or more UART interfaces as I2C interfaces
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Main",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_22,
|
|
||||||
.scl_io_num = GPIO_NUM_21,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
// Display
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_DISABLED,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_13,
|
|
||||||
.miso_io_num = GPIO_NUM_33,
|
|
||||||
.sclk_io_num = GPIO_NUM_14,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = CROWPANEL_SPI_TRANSFER_SIZE_LIMIT,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = tt::lvgl::getSyncLock() // esp_lvgl_port owns the lock for the display
|
|
||||||
},
|
|
||||||
// SD card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI3_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_23,
|
|
||||||
.miso_io_num = GPIO_NUM_19,
|
|
||||||
.sclk_io_num = GPIO_NUM_18,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 32768,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr // No custom lock needed
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
// "UART1"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_3,
|
|
||||||
.txPin = GPIO_NUM_1,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
extern const tt::hal::Configuration crowpanel_basic_35;
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
#include "CrowPanelDisplay.h"
|
|
||||||
#include "CrowPanelDisplayConstants.h"
|
|
||||||
|
|
||||||
#include <Ili9488Display.h>
|
|
||||||
#include <Xpt2046Touch.h>
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
|
|
||||||
std::shared_ptr<Xpt2046Touch> createTouch() {
|
|
||||||
auto configuration = std::make_unique<Xpt2046Touch::Configuration>(
|
|
||||||
CROWPANEL_LCD_SPI_HOST,
|
|
||||||
CROWPANEL_TOUCH_PIN_CS,
|
|
||||||
320,
|
|
||||||
480,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Xpt2046Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This display is mirrored on X, but that doesn't seem to work with the driver.
|
|
||||||
* Instead, we swap XY, which does work. That results in a landscape image.
|
|
||||||
*/
|
|
||||||
auto configuration = std::make_unique<Ili9488Display::Configuration>(
|
|
||||||
CROWPANEL_LCD_SPI_HOST,
|
|
||||||
CROWPANEL_LCD_PIN_CS,
|
|
||||||
CROWPANEL_LCD_PIN_DC,
|
|
||||||
480,
|
|
||||||
320,
|
|
||||||
touch,
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
configuration->mirrorX = true;
|
|
||||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
|
||||||
|
|
||||||
return std::make_shared<Ili9488Display>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/display/DisplayDevice.h"
|
|
||||||
#include <esp_lcd_types.h>
|
|
||||||
#include <lvgl.h>
|
|
||||||
|
|
||||||
class CrowPanelDisplay : public tt::hal::display::DisplayDevice {
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
esp_lcd_panel_io_handle_t ioHandle = nullptr;
|
|
||||||
esp_lcd_panel_handle_t panelHandle = nullptr;
|
|
||||||
lv_display_t* displayHandle = nullptr;
|
|
||||||
bool poweredOn = false;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
std::string getName() const final { return "ST7789"; }
|
|
||||||
std::string getDescription() const final { return "SPI display"; }
|
|
||||||
|
|
||||||
bool start() override;
|
|
||||||
|
|
||||||
bool stop() override;
|
|
||||||
|
|
||||||
void setPowerOn(bool turnOn) override;
|
|
||||||
bool isPoweredOn() const override { return poweredOn; };
|
|
||||||
bool supportsPowerControl() const override { return true; }
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() override;
|
|
||||||
|
|
||||||
void setBacklightDuty(uint8_t backlightDuty) override;
|
|
||||||
bool supportsBacklightDuty() const override { return true; }
|
|
||||||
|
|
||||||
void setGammaCurve(uint8_t index) override;
|
|
||||||
uint8_t getGammaCurveCount() const override { return 4; };
|
|
||||||
|
|
||||||
lv_display_t* _Nullable getLvglDisplay() const override { return displayHandle; }
|
|
||||||
};
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define CROWPANEL_LCD_SPI_HOST SPI2_HOST
|
|
||||||
#define CROWPANEL_LCD_PIN_CS GPIO_NUM_15
|
|
||||||
#define CROWPANEL_TOUCH_PIN_CS GPIO_NUM_12
|
|
||||||
#define CROWPANEL_LCD_PIN_DC GPIO_NUM_2 // RS
|
|
||||||
#define CROWPANEL_LCD_HORIZONTAL_RESOLUTION 320
|
|
||||||
#define CROWPANEL_LCD_VERTICAL_RESOLUTION 240
|
|
||||||
#define CROWPANEL_LCD_SPI_TRANSFER_HEIGHT (CROWPANEL_LCD_VERTICAL_RESOLUTION / 10)
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#include "CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
|
|
||||||
#include <esp_vfs_fat.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
GPIO_NUM_5,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot,
|
|
||||||
tt::lvgl::getSyncLock(),
|
|
||||||
{},
|
|
||||||
SPI3_HOST
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
|
||||||
|
|
||||||
idf_component_register(
|
|
||||||
SRCS ${SOURCE_FILES}
|
|
||||||
INCLUDE_DIRS "Source"
|
|
||||||
REQUIRES Tactility esp_lvgl_port RgbDisplay GT911 PwmBacklight driver
|
|
||||||
)
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
#include "hal/CrowPanelDisplay.h"
|
|
||||||
#include "hal/CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
using namespace tt::hal;
|
|
||||||
|
|
||||||
bool initBoot() {
|
|
||||||
return driver::pwmbacklight::init(GPIO_NUM_2);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern const Configuration crowpanel_basic_50 = {
|
|
||||||
.initBoot = initBoot,
|
|
||||||
.createDisplay = createDisplay,
|
|
||||||
.sdcard = createSdCard(),
|
|
||||||
.i2c = {
|
|
||||||
// There is only 1 (internal for touch, and also serves as "I2C-OUT" port)
|
|
||||||
// Note: You could repurpose 1 or more UART interfaces as I2C interfaces
|
|
||||||
i2c::Configuration {
|
|
||||||
.name = "Main",
|
|
||||||
.port = I2C_NUM_0,
|
|
||||||
.initMode = i2c::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.config = (i2c_config_t) {
|
|
||||||
.mode = I2C_MODE_MASTER,
|
|
||||||
.sda_io_num = GPIO_NUM_19,
|
|
||||||
.scl_io_num = GPIO_NUM_20,
|
|
||||||
.sda_pullup_en = true,
|
|
||||||
.scl_pullup_en = true,
|
|
||||||
.master = {
|
|
||||||
.clk_speed = 400000
|
|
||||||
},
|
|
||||||
.clk_flags = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.spi {
|
|
||||||
// SD card
|
|
||||||
spi::Configuration {
|
|
||||||
.device = SPI2_HOST,
|
|
||||||
.dma = SPI_DMA_CH_AUTO,
|
|
||||||
.config = {
|
|
||||||
.mosi_io_num = GPIO_NUM_11,
|
|
||||||
.miso_io_num = GPIO_NUM_13,
|
|
||||||
.sclk_io_num = GPIO_NUM_12,
|
|
||||||
.quadwp_io_num = GPIO_NUM_NC,
|
|
||||||
.quadhd_io_num = GPIO_NUM_NC,
|
|
||||||
.data4_io_num = GPIO_NUM_NC,
|
|
||||||
.data5_io_num = GPIO_NUM_NC,
|
|
||||||
.data6_io_num = GPIO_NUM_NC,
|
|
||||||
.data7_io_num = GPIO_NUM_NC,
|
|
||||||
.data_io_default_level = false,
|
|
||||||
.max_transfer_sz = 8192,
|
|
||||||
.flags = 0,
|
|
||||||
.isr_cpu_id = ESP_INTR_CPU_AFFINITY_AUTO,
|
|
||||||
.intr_flags = 0
|
|
||||||
},
|
|
||||||
.initMode = spi::InitMode::ByTactility,
|
|
||||||
.isMutable = false,
|
|
||||||
.lock = nullptr
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.uart {
|
|
||||||
// "UART1"
|
|
||||||
uart::Configuration {
|
|
||||||
.name = "UART1",
|
|
||||||
.port = UART_NUM_1,
|
|
||||||
.rxPin = GPIO_NUM_44,
|
|
||||||
.txPin = GPIO_NUM_43,
|
|
||||||
.rtsPin = GPIO_NUM_NC,
|
|
||||||
.ctsPin = GPIO_NUM_NC,
|
|
||||||
.rxBufferSize = 1024,
|
|
||||||
.txBufferSize = 1024,
|
|
||||||
.config = {
|
|
||||||
.baud_rate = 115200,
|
|
||||||
.data_bits = UART_DATA_8_BITS,
|
|
||||||
.parity = UART_PARITY_DISABLE,
|
|
||||||
.stop_bits = UART_STOP_BITS_1,
|
|
||||||
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
|
|
||||||
.rx_flow_ctrl_thresh = 0,
|
|
||||||
.source_clk = UART_SCLK_DEFAULT,
|
|
||||||
.flags = {
|
|
||||||
.allow_pd = 0,
|
|
||||||
.backup_before_sleep = 0,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <Tactility/hal/Configuration.h>
|
|
||||||
|
|
||||||
extern const tt::hal::Configuration crowpanel_basic_50;
|
|
||||||
@@ -1,105 +0,0 @@
|
|||||||
#include "CrowPanelDisplay.h"
|
|
||||||
|
|
||||||
#include <Gt911Touch.h>
|
|
||||||
#include <PwmBacklight.h>
|
|
||||||
#include <RgbDisplay.h>
|
|
||||||
#include <Tactility/Log.h>
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable createTouch() {
|
|
||||||
// Note for future changes: Reset pin is 38 and interrupt pin is 18
|
|
||||||
// or INT = NC, schematic and other info floating around is kinda conflicting...
|
|
||||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
|
||||||
I2C_NUM_0,
|
|
||||||
800,
|
|
||||||
480
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
|
||||||
}
|
|
||||||
|
|
||||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
|
||||||
auto touch = createTouch();
|
|
||||||
|
|
||||||
constexpr uint32_t bufferPixels = 800 * 10;
|
|
||||||
|
|
||||||
esp_lcd_rgb_panel_config_t rgb_panel_config = {
|
|
||||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
|
||||||
.timings = {
|
|
||||||
.pclk_hz = 15000000,
|
|
||||||
.h_res = 800,
|
|
||||||
.v_res = 480,
|
|
||||||
.hsync_pulse_width = 4,
|
|
||||||
.hsync_back_porch = 43,
|
|
||||||
.hsync_front_porch = 8,
|
|
||||||
.vsync_pulse_width = 4,
|
|
||||||
.vsync_back_porch = 12,
|
|
||||||
.vsync_front_porch = 8,
|
|
||||||
.flags = {
|
|
||||||
.hsync_idle_low = false,
|
|
||||||
.vsync_idle_low = false,
|
|
||||||
.de_idle_high = false,
|
|
||||||
.pclk_active_neg = true,
|
|
||||||
.pclk_idle_high = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
.data_width = 16,
|
|
||||||
.bits_per_pixel = 0,
|
|
||||||
.num_fbs = 2,
|
|
||||||
.bounce_buffer_size_px = bufferPixels,
|
|
||||||
.sram_trans_align = 8,
|
|
||||||
.psram_trans_align = 64,
|
|
||||||
.hsync_gpio_num = GPIO_NUM_39,
|
|
||||||
.vsync_gpio_num = GPIO_NUM_41,
|
|
||||||
.de_gpio_num = GPIO_NUM_40 ,
|
|
||||||
.pclk_gpio_num = GPIO_NUM_0,
|
|
||||||
.disp_gpio_num = GPIO_NUM_NC,
|
|
||||||
.data_gpio_nums = {
|
|
||||||
GPIO_NUM_8, // B0
|
|
||||||
GPIO_NUM_3, // B1
|
|
||||||
GPIO_NUM_46, // B2
|
|
||||||
GPIO_NUM_9, // B3
|
|
||||||
GPIO_NUM_1, // B4
|
|
||||||
GPIO_NUM_5, // G0
|
|
||||||
GPIO_NUM_6, // G1
|
|
||||||
GPIO_NUM_7, // G2
|
|
||||||
GPIO_NUM_15, // G3
|
|
||||||
GPIO_NUM_16, // G4
|
|
||||||
GPIO_NUM_4, // G5
|
|
||||||
GPIO_NUM_45, // R0
|
|
||||||
GPIO_NUM_48, // R1
|
|
||||||
GPIO_NUM_47, // R2
|
|
||||||
GPIO_NUM_21, // R3
|
|
||||||
GPIO_NUM_14, // R4
|
|
||||||
},
|
|
||||||
.flags = {
|
|
||||||
.disp_active_low = false,
|
|
||||||
.refresh_on_demand = false,
|
|
||||||
.fb_in_psram = true,
|
|
||||||
.double_fb = true,
|
|
||||||
.no_fb = false,
|
|
||||||
.bb_invalidate_cache = false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
RgbDisplay::BufferConfiguration buffer_config = {
|
|
||||||
.size = (800 * 480),
|
|
||||||
.useSpi = true,
|
|
||||||
.doubleBuffer = true,
|
|
||||||
.bounceBufferMode = true,
|
|
||||||
.avoidTearing = false
|
|
||||||
};
|
|
||||||
|
|
||||||
auto configuration = std::make_unique<RgbDisplay::Configuration>(
|
|
||||||
rgb_panel_config,
|
|
||||||
buffer_config,
|
|
||||||
touch,
|
|
||||||
LV_COLOR_FORMAT_RGB565,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
driver::pwmbacklight::setBacklightDuty
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::make_shared<RgbDisplay>(std::move(configuration));
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#include "CrowPanelSdCard.h"
|
|
||||||
|
|
||||||
#include <Tactility/hal/sdcard/SpiSdCardDevice.h>
|
|
||||||
#include <Tactility/lvgl/LvglSync.h>
|
|
||||||
|
|
||||||
#include <esp_vfs_fat.h>
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SpiSdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard() {
|
|
||||||
auto* configuration = new SpiSdCardDevice::Config(
|
|
||||||
GPIO_NUM_10,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
GPIO_NUM_NC,
|
|
||||||
SdCardDevice::MountBehaviour::AtBoot
|
|
||||||
);
|
|
||||||
|
|
||||||
auto* sdcard = (SdCardDevice*) new SpiSdCardDevice(
|
|
||||||
std::unique_ptr<SpiSdCardDevice::Config>(configuration)
|
|
||||||
);
|
|
||||||
|
|
||||||
return std::shared_ptr<SdCardDevice>(sdcard);
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "Tactility/hal/sdcard/SdCardDevice.h"
|
|
||||||
|
|
||||||
using tt::hal::sdcard::SdCardDevice;
|
|
||||||
|
|
||||||
std::shared_ptr<SdCardDevice> createSdCard();
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user