Merge branch 'feature/esp32p4_ppa_ll_support' into 'master'

feat(ppa): add low level support for PPA

See merge request espressif/esp-idf!28268
This commit is contained in:
Song Ruo Jing
2024-01-17 23:18:35 +08:00
7 changed files with 961 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -17,12 +17,17 @@ extern "C" {
---------------------------------------------------------------*/
/**
* @brief Color Space
*
* @note Save enum 0 for special purpose
*/
typedef enum {
COLOR_SPACE_RAW, ///< Color space raw
COLOR_SPACE_RGB, ///< Color space rgb
COLOR_SPACE_YUV, ///< Color space yuv
COLOR_SPACE_GRAY, ///< Color space gray
COLOR_SPACE_RAW = 1, ///< Color space raw
COLOR_SPACE_RGB, ///< Color space rgb
COLOR_SPACE_YUV, ///< Color space yuv
COLOR_SPACE_GRAY, ///< Color space gray
COLOR_SPACE_ARGB, ///< Color space argb
COLOR_SPACE_ALPHA, ///< Color space alpha (A)
COLOR_SPACE_CLUT, ///< Color look-up table (L)
} color_space_t;
/*---------------------------------------------------------------
@@ -64,6 +69,29 @@ typedef enum {
COLOR_PIXEL_GRAY8, ///< 8 bits, grayscale
} color_pixel_gray_format_t;
/**
* @brief ARGB Format
*/
typedef enum {
COLOR_PIXEL_ARGB8888, ///< 32 bits, 8 bits per A(alpha)/R/G/B value
} color_pixel_argb_format_t;
/**
* @brief Alpha(A) Format
*/
typedef enum {
COLOR_PIXEL_A4, ///< 4 bits, opacity only
COLOR_PIXEL_A8, ///< 8 bits, opacity only
} color_pixel_alpha_format_t;
/**
* @brief CLUT(L) Format
*/
typedef enum {
COLOR_PIXEL_L4, ///< 4 bits, color look-up table
COLOR_PIXEL_L8, ///< 8 bits, color look-up table
} color_pixel_clut_format_t;
/*---------------------------------------------------------------
Color Space Pixel Struct Type
---------------------------------------------------------------*/

View File

@@ -0,0 +1,59 @@
/*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "hal/color_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumeration of engines in PPA modules
*/
typedef enum {
PPA_ENGINE_TYPE_SR, /*!< PPA Scaling and Rotating (SR) engine, used to perform scale_and_rotate */
PPA_ENGINE_TYPE_BLEND, /*!< PPA Blending engine, used to perform blend or fill */
} ppa_engine_type_t;
/**
* @brief Enumeration of PPA Scaling and Rotating available rotation angle (in the counterclockwise direction)
*/
typedef enum {
PPA_SR_ROTATION_ANGLE_0, /*!< Picture does no rotation */
PPA_SR_ROTATION_ANGLE_90, /*!< Picture rotates 90 degrees CCW */
PPA_SR_ROTATION_ANGLE_180, /*!< Picture rotates 180 degrees CCW */
PPA_SR_ROTATION_ANGLE_270, /*!< Picture rotates 270 degrees CCW */
} ppa_sr_rotation_angle_t;
/**
* @brief Enumeration of PPA Scaling and Rotating available color mode
*/
typedef enum {
PPA_SR_COLOR_MODE_ARGB8888 = COLOR_TYPE_ID(COLOR_SPACE_ARGB, COLOR_PIXEL_ARGB8888), /*!< PPA SR color mode: ARGB8888 */
PPA_SR_COLOR_MODE_RGB888 = COLOR_TYPE_ID(COLOR_SPACE_RGB, COLOR_PIXEL_RGB888), /*!< PPA SR color mode: RGB888 */
PPA_SR_COLOR_MODE_RGB565 = COLOR_TYPE_ID(COLOR_SPACE_RGB, COLOR_PIXEL_RGB565), /*!< PPA SR color mode: RGB565 */
PPA_SR_COLOR_MODE_YUV420 = COLOR_TYPE_ID(COLOR_SPACE_YUV, COLOR_PIXEL_YUV420), /*!< PPA SR color mode: YUV420 */
} ppa_sr_color_mode_t;
/**
* @brief Enumeration of PPA Blending available color mode
*/
typedef enum {
PPA_BLEND_COLOR_MODE_ARGB8888 = COLOR_TYPE_ID(COLOR_SPACE_ARGB, COLOR_PIXEL_ARGB8888), /*!< PPA Blending color mode: ARGB8888 */
PPA_BLEND_COLOR_MODE_RGB888 = COLOR_TYPE_ID(COLOR_SPACE_RGB, COLOR_PIXEL_RGB888), /*!< PPA Blending color mode: RGB888 */
PPA_BLEND_COLOR_MODE_RGB565 = COLOR_TYPE_ID(COLOR_SPACE_RGB, COLOR_PIXEL_RGB565), /*!< PPA Blending color mode: RGB565 */
PPA_BLEND_COLOR_MODE_L8 = COLOR_TYPE_ID(COLOR_SPACE_CLUT, COLOR_PIXEL_L8), /*!< PPA Blending color mode: L8, only available on blending inputs */
PPA_BLEND_COLOR_MODE_L4 = COLOR_TYPE_ID(COLOR_SPACE_CLUT, COLOR_PIXEL_L4), /*!< PPA Blending color mode: L4, only available on blending inputs */
PPA_BLEND_COLOR_MODE_A8 = COLOR_TYPE_ID(COLOR_SPACE_ALPHA, COLOR_PIXEL_A8), /*!< PPA Blending color mode: A8, only available on blending foreground input */
PPA_BLEND_COLOR_MODE_A4 = COLOR_TYPE_ID(COLOR_SPACE_ALPHA, COLOR_PIXEL_A4), /*!< PPA Blending color mode: A4, only available on blending foreground input */
} ppa_blend_color_mode_t;
#ifdef __cplusplus
}
#endif