-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/ppa_example' into 'master'
ppa: added ppa dsi example Closes IDF-10077 See merge request espressif/esp-idf!31703
- Loading branch information
Showing
17 changed files
with
902 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# The following lines of boilerplate have to be in your project's CMakeLists | ||
# in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(ppa_dsi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
| Supported Targets | ESP32-P4 | | ||
| ----------------- | -------- | | ||
|
||
|
||
# PPA DSI example | ||
|
||
## Overview | ||
|
||
This example demonstrates how to use the esp_driver_ppa component to process a given image and display it via DSI interface. | ||
|
||
The example used image will be first scaled up, rotated at counter-clockwise direction and rotated back, mirrored and mirror back, and scaled down. Then the image will be blended with a whole red image with less transparency. Next the `ESP32` word will be color-keyed out. Lastly a frame will be filled around the `ESP32`. | ||
|
||
## Usage | ||
|
||
The subsections below give only absolutely necessary information. For full steps to configure ESP-IDF and use it to build and run projects, see [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#get-started). | ||
|
||
|
||
### Hardware Required | ||
|
||
This example requires: | ||
|
||
- ILI9881C LCD screen | ||
- ESP32P4 devkit | ||
|
||
|
||
GND | ||
┌─────────────────────────────────────────────────────────┐ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
┌───────────────-─────────────┴──────────────────┐ │ | ||
│ │ ┌──────────┴───────────┐ | ||
│ │ DSI DATA 1P │ │ | ||
│ ├───────────────────────────┤ │ | ||
│ │ │ │ | ||
│ │ DSI DATA 1N │ │ | ||
│ ├───────────────────────────┤ │ | ||
│ ESP32-P4 │ │ │ | ||
│ │ DSI CLK N │ ILI9881C │ | ||
│ ├───────────────────────────┤ │ | ||
│ │ │ │ | ||
│ │ DSI CLK P │ │ | ||
│ ├───────────────────────────┤ │ | ||
│ │ │ │ | ||
│ │ DSI DATA 0P │ │ | ||
│ ├───────────────────────────┤ │ | ||
│ │ │ │ | ||
│ │ DSI DATA 0N │ │ | ||
│ ├───────────────────────────┤ │ | ||
│ │ │ │ | ||
│ │ └──────────────────────┘ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
│ │ | ||
└────────────────────────────────────────────────┘ | ||
|
||
|
||
### Set Chip Target | ||
|
||
First of all, your target must be supported by both: | ||
|
||
- **By your ESP-IDF version**: For the full list of supported targets, run: | ||
``` | ||
idf.py --list-targets | ||
``` | ||
- **By this example**: For the full list of supported targets, refer to the supported targets table at the top of this README. | ||
|
||
After you make sure that your target is supported, go to your example project directory and [set the chip target](https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/tools/idf-py.html#select-the-target-chip-set-target): | ||
|
||
``` | ||
idf.py set-target <target> | ||
``` | ||
|
||
For example, to set esp32-P4 as the chip target, run: | ||
|
||
``` | ||
idf.py set-target esp32p4 | ||
``` | ||
|
||
|
||
### Build and Flash | ||
|
||
Execute the following command to build the project, flash it to your development board, and run the monitor tool to view the serial output: | ||
|
||
``` | ||
idf.py build flash monitor | ||
``` | ||
|
||
This command can be reduced to `idf.py flash monitor`. | ||
|
||
If the above command fails, check the log on the serial monitor which usually provides information on the possible cause of the issue. | ||
|
||
To exit the serial monitor, use `Ctrl` + `]`. | ||
|
||
|
||
## Example Output | ||
|
||
If you see the following console output, your example should be running correctly: | ||
|
||
``` | ||
I (1555) main_task: Calling app_main() | ||
I (1555) ili9881c: ID1: 0x98, ID2: 0x81, ID3: 0x5c | ||
I (1795) ppa_dsi: JPEG image decoded! Size of the decoded image is: 320px x 240px | ||
start srm operations | ||
start blend operations | ||
start fill operations | ||
I (10085) main_task: Returned from app_main() | ||
``` | ||
|
||
|
||
## Reference | ||
|
||
- Link to the ESP-IDF feature's API reference, for example [ESP-IDF: Pixel-Processing Accelerator](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/peripherals/ppa.html) | ||
- [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#get-started) | ||
- [Project Configuration](https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html) (Kconfig Options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(srcs "ppa_dsi_main.c") | ||
|
||
if(CONFIG_EXAMPLE_SOURCE_IMAGE_FORMAT_RGB565) | ||
list(APPEND srcs "image.c") | ||
endif() | ||
|
||
set(embed_files) | ||
|
||
if(CONFIG_EXAMPLE_SOURCE_IMAGE_FORMAT_JPEG) | ||
list(APPEND embed_files "image.jpg") | ||
endif() | ||
|
||
idf_component_register(SRCS ${srcs} | ||
INCLUDE_DIRS "." | ||
REQUIRES esp_mm esp_driver_ppa dsi_init | ||
EMBED_FILES ${embed_files} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
menu "Example Configuration" | ||
config EXAMPLE_USED_LDO_CHAN_ID | ||
int "example used LDO channel ID" | ||
default 3 | ||
help | ||
Example used LDO channel ID, you may check datasheet to know more details. | ||
|
||
config EXAMPLE_USED_LDO_VOLTAGE_MV | ||
int "example used LDO voltage in mV" | ||
default 2500 | ||
range 0 3300 | ||
help | ||
Example used LDO voltage, in mV | ||
|
||
choice EXAMPLE_SOURCE_IMAGE_FORMAT | ||
prompt "Select source image format" | ||
default EXAMPLE_SOURCE_IMAGE_FORMAT_JPEG | ||
help | ||
Select the source image format | ||
|
||
config EXAMPLE_SOURCE_IMAGE_FORMAT_JPEG | ||
bool "JPEG" | ||
|
||
config EXAMPLE_SOURCE_IMAGE_FORMAT_RGB565 | ||
bool "RGB565" | ||
endchoice | ||
|
||
endmenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dependencies: | ||
espressif/esp_lcd_ili9881c: "*" | ||
idf: | ||
version: ">=5.3.0" | ||
dsi_init: | ||
path: ${IDF_PATH}/examples/peripherals/camera/camera_dsi/components/dsi_init | ||
esp_jpeg: ">=1.0.2" |
Oops, something went wrong.