PPE
支持的芯片[ RTL8721Dx ][ RTL8721F ]
概述
PPE(像素处理引擎)是一款弱化的 2D 图像处理引擎,提供基础的图像处理能力,专为满足嵌入式系统等对资源和成本有严格要求的场景而设计。
PPE 支持常用的像素级操作,如颜色转换、缩放、Alpha 混合、抠色等,可高效完成常见的 2D 图像处理任务,但并不具备复杂 3D 渲染能力。
功能特性
PPE 有 3 个输入层和 1 个输出层。有以下特性:
Alpha 混合
缩放
窗口配置
抠色
像素转换
多输入输出源
备注
Alpha 混合功能和缩放功能是并列功能,不能同时使用。
在使用 alpha 混合功能或者缩放功能时,可以同时使用其他功能特性。
Alpha 混合
PPE 支持最高 3 层 alpha 混合功能。
alpha 混合功能计算公式如下:
缩放
PPE 使用双线性插值算法可以实现良好的缩放效果,最高可放大或者缩小 16 倍。
备注
使用缩放时,不支持可变像素起始位置。
只有第一层支持缩放。
窗口配置
PPE 的窗口配置功能有以下特性:
可变像素起始位置。即可以控制输入窗口在输出窗口的位置。
可变窗口大小。可以配置输入窗口和输出窗口的大小。
可变行宽度。可以实现输入窗口的裁剪功能,和输出窗口的画中画功能。
抠色
当输出窗口的像素符合设定的值时,该像素将会输出 0 值。
像素转换
输入和输出支持多种像素格式,包括 ARGB8888,RGB888, RGB565 等多种常见格式。
支持的所有格式参考文件 ameba_ppe.h 中的 PPE_PIXEL_FORMAT。部分格式如 XRGB8888 中的 X 表示 alpha 值取反,即实际计算时会对 X 值取反进行计算。
多输入输出源
输入地址可以是 PPE 设定的内部像素值,也可以是内存。
输出的地址可以是内存,也可以是 QSPI。通过 QSPI 可以直接将输出显示到外接的屏幕上。
PPE 有 3 个输入层和 1 个输出层。有以下特性:
Alpha 混合
缩放
窗口配置
抠色
像素转换
多输入源
旋转
异或
Alpha 混合
PPE 支持最高 3 层 alpha 混合功能。还支持 PPE 内部的背景层。
alpha 混合功能计算公式如下:
缩放
PPE 使用双线性插值算法可以实现良好的缩放效果,最高可放大或者缩小 16 倍。
备注
仅第一层和第二层输入层支持缩放功能。
窗口配置
PPE 的窗口配置功能有以下特性:
可变像素起始位置。即可以控制输入窗口在输出窗口的位置。
可变窗口大小。可以配置输入窗口和输出窗口的大小。
可变行宽度。可以实现输入窗口的裁剪功能,和输出窗口的画中画功能。
抠色
当输出窗口的像素符合设定的值时,该像素将会输出 0 值。抠色支持外抠色和内抠色两种模式。
内抠色满足以下条件的像素将会输出 0:
外抠色满足以下条件的像素将会输出 0:
像素转换
输入和输出支持多种像素格式,包括 ARGB8888,RGB888, RGB565 等多种常见格式。
支持的所有格式参考文件 ameba_ppe.h 中的 PPE_PIXEL_FORMAT。部分格式如 XRGB8888 中的 X 表示 alpha 值取反,即实际计算时会对 X 值取反进行计算。
多输入源
输入地址可以是 PPE 设定的内部像素值,也可以是内存。
旋转
支持 90,180,270 度的旋转。
备注
仅第一层支持旋转功能。
异或
支持 2 层或者 3 层数据的异或。即:
R = A ⊕ B
R = A ⊕ B ⊕ C
备注
使用异或功能时,无法使用其他特性。
应用示例
SDK 提供了功能示例帮助开发者了解和使用 PPE :
raw 示例
路径:
{SDK}\example\peripheral\raw\Display\PPE\{demo}
以下是对 raw 示例功能的简要说明:
raw_ppe_as_dma 演示如何把 ppe 当作 dma 搬运数据或者显示到 QSPI 中;
raw_ppe_3_layer_alpha_blend 演示如何使用 3 层 alpha 混合;
raw_ppe_scale 演示如何使用 scale 功能;
raw_ppe_auto_reload 演示如何使用 autoload 功能一次处理多帧;
raw_ppe_linklist 演示如何使用 linklist 功能一次处理多帧;
Raw API
PPE Exported Types
-
enum PPE_PIXEL_SOURCE
PPE Pixel Source Definition.
Values:
/* Pixel data from constant color register. */ PPE_LAYER_SRC_CONST /* Pixel data read from memory via DMA. */ PPE_LAYER_SRC_FROM_DMA
-
enum PPE_GLOBAL_STATE
PPE Global State Definition.
Values:
/* PPE is disabled. */ PPE_STATE_DISABLE = 0 /* PPE is running. */ PPE_STATE_RUNNING = 1
-
struct PPE_InputLayer_InitTypeDef
PPE Input layer Init Structure Definition.
Public Members
-
u32 src_addr
Source address of the layer pixel data.
-
u32 start_x
X coordinate of the top-left pixel in the result window.
-
u32 start_y
Y coordinate of the top-left pixel in the result window.
-
u32 width
Width of the input layer in pixels.
-
u32 height
Height of the input layer in pixels.
-
u32 const_ABGR8888_value
Constant pixel color in ABGR8888 format, used when src is PPE_LAYER_SRC_CONST.
-
u32 key_color_value
Transparent (chroma-key) color value.
-
u32 line_len
Number of bytes between two vertically adjacent pixels in memory (line stride).
-
PPE_PIXEL_FORMAT format
Pixel format of the input layer; see PPE_PIXEL_FORMAT.
-
PPE_PIXEL_SOURCE src
Pixel data source; see PPE_PIXEL_SOURCE.
-
int color_key_en
Color keying enable: 1 to enable, 0 to disable.
-
u32 src_addr
-
struct PPE_LLI_GLB
PPE Global register Format Definition.
Public Members
-
u32 LL_CFG
Linked list configuration register value.
-
u32 LLP
Linked list pointer register value.
-
u32 SCA_RATIO_X
Horizontal scale ratio register value.
-
u32 SCA_RATIO_Y
Vertical scale ratio register value.
-
u32 LL_CFG
-
enum PPE_PIXEL_FORMAT
PPE Pixel Format Definition.
Values:
/* 32bpp ABGR 8-8-8-8 format. */ PPE_ABGR8888 = 0x0 /* 32bpp ARGB 8-8-8-8 format. */ PPE_ARGB8888 /* 32bpp XBGR 8-8-8-8 format. */ PPE_XBGR8888 /* 32bpp XRGB 8-8-8-8 format. */ PPE_XRGB8888 /* 32bpp BGRA 8-8-8-8 format. */ PPE_BGRA8888 /* 32bpp RGBA 8-8-8-8 format. */ PPE_RGBA8888 /* 32bpp BGRX 8-8-8-8 format. */ PPE_BGRX8888 /* 32bpp RGBX 8-8-8-8 format. */ PPE_RGBX8888 /* 16bpp ABGR 4-4-4-4 format. */ PPE_ABGR4444 /* 16bpp ARGB 4-4-4-4 format. */ PPE_ARGB4444 /* 16bpp XBGR 4-4-4-4 format. */ PPE_XBGR4444 /* 16bpp XRGB 4-4-4-4 format. */ PPE_XRGB4444 /* 16bpp BGRA 4-4-4-4 format. */ PPE_BGRA4444 /* 16bpp RGBA 4-4-4-4 format. */ PPE_RGBA4444 /* 16bpp BGRX 4-4-4-4 format. */ PPE_BGRX4444 /* 16bpp RGBX 4-4-4-4 format. */ PPE_RGBX4444 /* 8bpp ABGR 2-2-2-2 format. (= 0x10) */ PPE_ABGR2222 /* 8bpp ARGB 2-2-2-2 format. */ PPE_ARGB2222 /* 8bpp XBGR 2-2-2-2 format. */ PPE_XBGR2222 /* 8bpp XRGB 2-2-2-2 format. */ PPE_XRGB2222 /* 8bpp BGRA 2-2-2-2 format. */ PPE_BGRA2222 /* 8bpp RGBA 2-2-2-2 format. */ PPE_RGBA2222 /* 8bpp BGRX 2-2-2-2 format. */ PPE_BGRX2222 /* 8bpp RGBX 2-2-2-2 format. */ PPE_RGBX2222 /* 24bpp ABGR 8-5-6-5 format. */ PPE_ABGR8565 /* 24bpp ARGB 8-5-6-5 format. */ PPE_ARGB8565 /* 24bpp XBGR 8-5-6-5 format. */ PPE_XBGR8565 /* 24bpp XRGB 8-5-6-5 format. */ PPE_XRGB8565 /* 24bpp BGRA 5-6-5-8 format. */ PPE_BGRA5658 /* 24bpp RGBA 5-6-5-8 format. */ PPE_RGBA5658 /* 24bpp BGRX 5-6-5-8 format. */ PPE_BGRX5658 /* 24bpp RGBX 5-6-5-8 format. */ PPE_RGBX5658 /* 16bpp ABGR 1-5-5-5 format. (= 0x20) */ PPE_ABGR1555 /* 16bpp ARGB 1-5-5-5 format. */ PPE_ARGB1555 /* 16bpp XBGR 1-5-5-5 format. */ PPE_XBGR1555 /* 16bpp XRGB 1-5-5-5 format. */ PPE_XRGB1555 /* 16bpp BGRA 5-5-5-1 format. */ PPE_BGRA5551 /* 16bpp RGBA 5-5-5-1 format. */ PPE_RGBA5551 /* 16bpp BGRX 5-5-5-1 format. */ PPE_BGRX5551 /* 16bpp RGBX 5-5-5-1 format. */ PPE_RGBX5551 /* 24bpp BGR 8-8-8 format. */ PPE_BGR888 /* 24bpp RGB 8-8-8 format. */ PPE_RGB888 /* 16bpp BGR 5-6-5 format. */ PPE_BGR565 /* 16bpp RGB 5-6-5 format. */ PPE_RGB565 /* 8bpp alpha-only format. */ PPE_A8 /* 8bpp ignored-alpha format. */ PPE_X8 /* 32bpp ABGR 8-6-6-6 format. */ PPE_ABGR8666 = 0x32 /* 32bpp ARGB 8-6-6-6 format. */ PPE_ARGB8666 /* 32bpp XBGR 8-6-6-6 format. */ PPE_XBGR8666 /* 32bpp XRGB 8-6-6-6 format. */ PPE_XRGB8666 /* 32bpp BGRA 6-6-6-8 format. */ PPE_BGRA6668 /* 32bpp RGBA 6-6-6-8 format. */ PPE_RGBA6668 /* 32bpp BGRX 6-6-6-8 format. */ PPE_BGRX6668 /* 32bpp RGBX 6-6-6-8 format. */ PPE_RGBX6668
-
struct PPE_ResultLayer_InitTypeDef
PPE Result layer Init Structure Definition.
Public Members
-
u32 src_addr
Destination address for the composited output.
-
u32 width
Width of the output image in pixels.
-
u32 height
Height of the output image in pixels.
-
u32 line_len
Number of bytes between two vertically adjacent pixels in memory (line stride).
-
PPE_PIXEL_FORMAT format
Pixel format of the output layer; see PPE_PIXEL_FORMAT.
-
PPE_ADDR_TYPE type
Address type of the output buffer; see PPE_ADDR_TYPE.
-
u32 src_addr
-
enum PPE_ADDR_TYPE
PPE Result Layer Address Type.
Values:
/* Address in internal memory. */ PPE_ADDR_MEM /* Address in QSPI flash. */ PPE_ADDR_QSPI
-
enum PPE_ARBURST
PPE Arburst Definition.
Values:
/* AXI FIXED burst type. */ PPE_ARBURST_FIX /* AXI INCR burst type. */ PPE_ARBURST_INCR
-
enum PPE_DMA_HANDSHAKE
PPE DMA Handshake Definition.
Values:
/* Hardware DMA handshake mode. */ PPE_DMA_HW_HANDSHAKE /* Software DMA handshake mode. */ PPE_DMA_SW_HANDSHAKE
-
struct PPE_InitTypeDef
PPE Function Structure Definition.
Public Members
-
u32 function
PPE function mode selection; see PPE_FUNCTION_ALPHA_BLEND and PPE_FUNCTION_SCALE.
-
u32 blend_layer_num
Number of input layers used for alpha blending.
-
u32 function
-
struct PPE_LLI_LAYER
PPE LLI Layer Format Definition.
Public Members
-
u32 LAYER_ADDR
Address of the first pixel.
-
u32 LAYER_POS
Position of the first pixel in the result window.
-
u32 LAYER_WINSIZE
Window size: height[31:16] and width[15:0] in pixels.
-
u32 LAYER_CONST_PIX
Constant pixel value in ABGR8888 format.
-
u32 LAYER_ADDR
-
enum PPE_GLOBAL_STATE
PPE Global State Definition.
Values:
/* PPE is disabled. */ PPE_STATE_DISABLE = 0 /* PPE is running. */ PPE_STATE_RUNNING = 1 /* PPE is inactive. */ PPE_STATE_INACTIVE = 2 /* PPE is suspended. */ PPE_STATE_SUSPEND = 3
-
struct PPE_InputLayer_InitTypeDef
PPE Input layer Init Structure Definition.
Public Members
-
u32 src_addr
Source address of the layer pixel data.
-
u32 pic_width
Width of the input picture in pixels.
-
u32 pic_height
Height of the input picture in pixels.
-
PPE_PIXEL_FORMAT format
Pixel format of the input layer; see PPE_PIXEL_FORMAT.
-
PPE_PIXEL_SOURCE pic_src
Pixel data source; see PPE_PIXEL_SOURCE.
-
PPE_INTERP_TYPE interp
Interpolation type for scaling; see PPE_INTERP_TYPE.
-
PPE_KEY_MODE key_mode
Color keying mode; see PPE_KEY_MODE.
-
u32 line_len
Number of bytes between two vertically adjacent pixels in memory (line stride).
-
u32 const_ABGR8888_value
Constant pixel color in ABGR8888 format, used when pic_src is PPE_LAYER_SRC_CONST.
-
u32 win_min_x
X coordinate of the top-left corner of the input window in the canvas.
-
u32 win_min_y
Y coordinate of the top-left corner of the input window in the canvas.
-
u32 win_max_x
X coordinate of the bottom-right corner of the input window in the canvas.
-
u32 win_max_y
Y coordinate of the bottom-right corner of the input window in the canvas.
-
u32 key_min_bgr
Minimum BGR color for the key match range in BGR888 format.
-
u32 key_max_bgr
Maximum BGR color for the key match range in BGR888 format.
-
float scale_x
Horizontal scaling factor; valid values are 16/1, 16/2, 16/3, ..., 16/65535.
-
float scale_y
Vertical scaling factor; valid values are 16/1, 16/2, 16/3, ..., 16/65535.
-
u32 angle
Rotation angle in degrees (0, 90, 180, or 270).
-
u32 src_addr
-
struct PPE_LLI_GLB
PPE Global register Format Definition.
Public Members
-
u32 LAY_EN
Layer enable register value.
-
u32 LL_CFG
Linked list configuration register value.
-
u32 LLP
Linked list pointer register value.
-
u32 LAY_EN
-
enum PPE_PIXEL_FORMAT
PPE Pixel Format Definition.
Values:
/* 32bpp ABGR 8-8-8-8 format. */ PPE_ABGR8888 = 0x0 /* 32bpp ARGB 8-8-8-8 format. */ PPE_ARGB8888 /* 32bpp XBGR 8-8-8-8 format. */ PPE_XBGR8888 /* 32bpp XRGB 8-8-8-8 format. */ PPE_XRGB8888 /* 32bpp BGRA 8-8-8-8 format. */ PPE_BGRA8888 /* 32bpp RGBA 8-8-8-8 format. */ PPE_RGBA8888 /* 32bpp BGRX 8-8-8-8 format. */ PPE_BGRX8888 /* 32bpp RGBX 8-8-8-8 format. */ PPE_RGBX8888 /* 16bpp ABGR 4-4-4-4 format. */ PPE_ABGR4444 /* 16bpp ARGB 4-4-4-4 format. */ PPE_ARGB4444 /* 16bpp XBGR 4-4-4-4 format. */ PPE_XBGR4444 /* 16bpp XRGB 4-4-4-4 format. */ PPE_XRGB4444 /* 16bpp BGRA 4-4-4-4 format. */ PPE_BGRA4444 /* 16bpp RGBA 4-4-4-4 format. */ PPE_RGBA4444 /* 16bpp BGRX 4-4-4-4 format. */ PPE_BGRX4444 /* 16bpp RGBX 4-4-4-4 format. */ PPE_RGBX4444 /* 8bpp ABGR 2-2-2-2 format. (= 0x10) */ PPE_ABGR2222 /* 8bpp ARGB 2-2-2-2 format. */ PPE_ARGB2222 /* 8bpp XBGR 2-2-2-2 format. */ PPE_XBGR2222 /* 8bpp XRGB 2-2-2-2 format. */ PPE_XRGB2222 /* 8bpp BGRA 2-2-2-2 format. */ PPE_BGRA2222 /* 8bpp RGBA 2-2-2-2 format. */ PPE_RGBA2222 /* 8bpp BGRX 2-2-2-2 format. */ PPE_BGRX2222 /* 8bpp RGBX 2-2-2-2 format. */ PPE_RGBX2222 /* 24bpp ABGR 8-5-6-5 format. */ PPE_ABGR8565 /* 24bpp ARGB 8-5-6-5 format. */ PPE_ARGB8565 /* 24bpp XBGR 8-5-6-5 format. */ PPE_XBGR8565 /* 24bpp XRGB 8-5-6-5 format. */ PPE_XRGB8565 /* 24bpp BGRA 5-6-5-8 format. */ PPE_BGRA5658 /* 24bpp RGBA 5-6-5-8 format. */ PPE_RGBA5658 /* 24bpp BGRX 5-6-5-8 format. */ PPE_BGRX5658 /* 24bpp RGBX 5-6-5-8 format. */ PPE_RGBX5658 /* 16bpp ABGR 1-5-5-5 format. (= 0x20) */ PPE_ABGR1555 /* 16bpp ARGB 1-5-5-5 format. */ PPE_ARGB1555 /* 16bpp XBGR 1-5-5-5 format. */ PPE_XBGR1555 /* 16bpp XRGB 1-5-5-5 format. */ PPE_XRGB1555 /* 16bpp BGRA 5-5-5-1 format. */ PPE_BGRA5551 /* 16bpp RGBA 5-5-5-1 format. */ PPE_RGBA5551 /* 16bpp BGRX 5-5-5-1 format. */ PPE_BGRX5551 /* 16bpp RGBX 5-5-5-1 format. */ PPE_RGBX5551 /* 24bpp BGR 8-8-8 format. */ PPE_BGR888 /* 24bpp RGB 8-8-8 format. */ PPE_RGB888 /* 16bpp BGR 5-6-5 format. */ PPE_BGR565 /* 16bpp RGB 5-6-5 format. */ PPE_RGB565 /* 8bpp alpha-only format. */ PPE_A8 /* 8bpp ignored-alpha format. */ PPE_X8 /* 32bpp ABGR 8-6-6-6 format. */ PPE_ABGR8666 = 0x34 /* 32bpp ARGB 8-6-6-6 format. */ PPE_ARGB8666 /* 32bpp XBGR 8-6-6-6 format. */ PPE_XBGR8666 /* 32bpp XRGB 8-6-6-6 format. */ PPE_XRGB8666 /* 32bpp BGRA 6-6-6-8 format. */ PPE_BGRA6668 /* 32bpp RGBA 6-6-6-8 format. */ PPE_RGBA6668 /* 32bpp BGRX 6-6-6-8 format. */ PPE_BGRX6668 /* 32bpp RGBX 6-6-6-8 format. */ PPE_RGBX6668 /* 16bpp BGR 5-6-5 swapped format. (= 0x3C) */ PPE_BGR565_S /* 16bpp RGB 5-6-5 swapped format. */ PPE_RGB565_S
-
struct PPE_ResultLayer_InitTypeDef
PPE Result layer Init Structure Definition.
Public Members
-
u32 src_addr
Destination address for the composited output.
-
u32 pic_width
Width of the output canvas in pixels.
-
u32 pic_height
Height of the output canvas in pixels.
-
PPE_PIXEL_FORMAT format
Pixel format of the output layer; see PPE_PIXEL_FORMAT.
-
PPE_BACKGROUND_SOURCE bg_src
Background source selection; see PPE_BACKGROUND_SOURCE.
-
u32 line_len
Number of bytes between two vertically adjacent pixels in memory (line stride).
-
u32 const_bg
Constant background color in ABGR8888 format, used when bg_src is PPE_BACKGROUND_SOURCE_CONST_BG.
-
u32 blk_width
Block width in pixels; must be greater than 0 and not exceed canvas width.
-
u32 blk_height
Block height in pixels; must be greater than 0 and not exceed canvas height.
-
u32 xor_en
XOR blending enable: 1 to enable, 0 to disable.
-
u32 src_addr
-
enum PPE_BACKGROUND_SOURCE
PPE Background Source Definition.
Values:
/* Use constant background color register. */ PPE_BACKGROUND_SOURCE_CONST_BG /* Use input layer 1 as background. */ PPE_BACKGROUND_SOURCE_LAYER1
-
enum PPE_INTERP_TYPE
PPE Interpolation Type Definition.
Values:
/* Nearest-neighbor interpolation. */ PPE_INTERP_TYPE_Nearest_Neighbor /* Bilinear interpolation. */ PPE_INTERP_TYPE_Bilinear
-
enum PPE_KEY_MODE
PPE Color Key Mode Definition.
Values:
/* Color keying disabled. */ PPE_KEY_MODE_DISABLE /* Key matches pixels inside the defined color range. */ PPE_KEY_MODE_INSIDE_MODE = 0x2 /* Key matches pixels outside the defined color range. */ PPE_KEY_MODE_OUTSIDE_MODE
-
struct PPE_LLI_INPUT_LAYER
PPE LLI Input Layer Format Definition.
Public Members
-
u32 ADDR_L
Low 32 bits of the source pixel data address.
-
u32 PIC_SIZE
Picture size: height[26:16] and width[10:0] in pixels.
-
u32 PIC_CFG
Picture configuration: line length, key mode, interpolation, pixel source, and format.
-
u32 CONST_PIX
Constant pixel value in ABGR8888 format.
-
u32 WIN_MIN
Minimum window coordinate: Y_MIN[26:16] and X_MIN[10:0].
-
u32 WIN_MAX
Maximum window coordinate: Y_MAX[26:16] and X_MAX[10:0].
-
u32 KEY_MIN
Minimum BGR value for the color key match range in BGR888 format.
-
u32 KEY_MAX
Maximum BGR value for the color key match range in BGR888 format.
-
u32 MATRIX_E11
Element E11 of the coordinates transformation matrix.
-
u32 MATRIX_E12
Element E12 of the coordinates transformation matrix.
-
u32 MATRIX_E13
Element E13 of the coordinates transformation matrix.
-
u32 MATRIX_E21
Element E21 of the coordinates transformation matrix.
-
u32 MATRIX_E22
Element E22 of the coordinates transformation matrix.
-
u32 MATRIX_E23
Element E23 of the coordinates transformation matrix.
-
u32 MATRIX_E31
Element E31 of the coordinates transformation matrix.
-
u32 MATRIX_E32
Element E32 of the coordinates transformation matrix.
-
u32 MATRIX_E33
Element E33 of the coordinates transformation matrix.
-
u32 ADDR_L
-
struct PPE_LLI_RESULT_LAYER
PPE LLI Result Layer Format Definition.
Public Members
-
u32 ADDR_L
Low 32 bits of the output pixel data address.
-
u32 PIC_SIZE
Canvas size: height[26:16] and width[10:0] in pixels.
-
u32 PIC_CFG
Picture configuration: line length, background source, and pixel format.
-
u32 CONST_BG
Constant background color in ABGR8888 format.
-
u32 ADDR_L
PPE Exported Constants
/* Check if PPE channel index is valid (0-16). */
#define IS_PPE_CHN_INDEX (((chn) < 17) && ((chn) >= 0))
/* Check if PPE alpha blend layer count is valid (< 16). */
#define IS_PPE_ALPHA_BLEND_LAYER_NUM ((layer_num) < 16)
/* Index of the PPE result (output) layer. */
#define PPE_RESULT_LAYER_INDEX 0
/* Index of PPE input layer 1. */
#define PPE_INPUT_LAYER1_INDEX 1
/* Index of PPE input layer 2. */
#define PPE_INPUT_LAYER2_INDEX 2
/* Index of PPE input layer 3. */
#define PPE_INPUT_LAYER3_INDEX 3
/* Bit mask for PPE result layer selection. */
#define PPE_RESULT_LAYER_BIT ((u32)0x1 << PPE_RESULT_LAYER_INDEX)
/* Bit mask for PPE input layer 1 selection. */
#define PPE_INPUT_LAYER1_BIT ((u32)0x1 << PPE_INPUT_LAYER1_INDEX)
/* Bit mask for PPE input layer 2 selection. */
#define PPE_INPUT_LAYER2_BIT ((u32)0x1 << PPE_INPUT_LAYER2_INDEX)
/* Bit mask for PPE input layer 3 selection. */
#define PPE_INPUT_LAYER3_BIT ((u32)0x1 << PPE_INPUT_LAYER3_INDEX)
/* PPE function mode: alpha blending. */
#define PPE_FUNCTION_ALPHA_BLEND ((u32)0x0)
/* PPE function mode: scaling. */
#define PPE_FUNCTION_SCALE ((u32)0x1)
/* Check if PPE function selection is valid. */
#define IS_PPE_FUNCTION (((func) == PPE_FUNCTION_ALPHA_BLEND) || ((func) == PPE_FUNCTION_SCALE))
Not supported.
PPE Exported Functions
-
void PPE_AutoClearCmd(int NewState)
Enable or disable auto clear after loading.
- 参数:
NewState -- The new state. This parameter can be: ENABLE or DISABLE.
-
void PPE_AutoReloadClrLayerAll(void)
Clear all auto reload layers.
-
void PPE_AutoReloadSetLayer(u32 layers)
Configure auto reload layers.
- 参数:
layers --
Auto reload layers. This parameter can be one or combinations of the following values:
PPE_RESULT_LAYER_BIT: result layer.
PPE_INPUT_LAYER1_BIT: input layer1.
PPE_INPUT_LAYER2_BIT: input layer2.
PPE_INPUT_LAYER3_BIT: input layer3.
-
int PPE_ChannelInactiveCheck(u8 chn_id)
Check if a layer is inactive.
- 参数:
chn_id -- The layer number to be checked.
- 返回:
Layer inactive status:
0: the layer is active
1: the layer is inactive
-
void PPE_ClearINTPendingBit(u32 PPE_INT)
Clear specific interrupt status.
- 参数:
PPE_INT -- Specifies the PPE interrupt type. This parameter can be one or combinations of PPE_INTR_ST.
-
void PPE_Cmd(int state)
Enable or disable PPE.
- 参数:
state -- The state of PPE. This parameter can be ENABLE or DISABLE.
备注
DISABLE may have no effect on some platforms.
-
u32 PPE_GetAllIntStatus(void)
Get all interrupt status.
- 返回:
Current PPE interrupt status.
-
u32 PPE_GetGlobalState(void)
Get PPE global state.
- 返回:
One of PPE_GLOBAL_STATE.
-
u32 PPE_GetValid(void)
Get the setting valid value for polling.
- 返回:
Set valid bit status:
0: User can call PPE_SetValid() to tell PPE the settings are valid
1: Settings valid bit is set
-
void PPE_InitInputLayer(u8 id, PPE_InputLayer_InitTypeDef *layer_init_struct)
Initialize specific input layer.
- 参数:
id -- Input layer number. Can be PPE_INPUT_LAYER1_INDEX or PPE_INPUT_LAYER2_INDEX or PPE_INPUT_LAYER3_INDEX.
layer_init_struct -- Pointer to a PPE_InputLayer_InitTypeDef structure that contains the configuration information for the specified input layer.
-
void PPE_InitResultLayer(PPE_ResultLayer_InitTypeDef *layer_init_struct)
Initialize result layer.
- 参数:
layer_init_struct -- Pointer to a PPE_ResultLayer_InitTypeDef structure that contains the configuration information for the result layer.
-
void PPE_InputLayer_StructInit(PPE_InputLayer_InitTypeDef *layer_init_struct)
Fill each layer_init_struct member with its default value.
- 参数:
layer_init_struct -- Pointer to a PPE_InputLayer_InitTypeDef structure which will be initialized.
-
void PPE_LLSetLayer(u32 layers)
Set layers used by the first linked list item.
- 参数:
layers --
Linked list layers. This parameter can be one or combinations of the following values:
PPE_RESULT_LAYER_BIT: result layer.
PPE_INPUT_LAYER1_BIT: input layer1.
PPE_INPUT_LAYER2_BIT: input layer2.
PPE_INPUT_LAYER3_BIT: input layer3.
-
void PPE_MaskAllInt(void)
Mask all interrupt.
-
void PPE_MaskINTConfig(u32 PPE_INT_MSK, int NewState)
Enable or disable the specified interrupt.
- 参数:
PPE_INT_MSK -- Specifies the PPE interrupt type. This parameter can be one or combinations of PPE_INTR_ST.
NewState -- The new state. This parameter can be: ENABLE or DISABLE.
-
void PPE_ResultLayer_StructInit(PPE_ResultLayer_InitTypeDef *layer_init_struct)
Fill each layer_init_struct member with its default value.
- 参数:
layer_init_struct -- Pointer to a PPE_ResultLayer_InitTypeDef structure which will be initialized.
-
void PPE_Resume(void)
Resume PPE from suspend state.
-
void PPE_SetLLP(u32 lli)
Set the LLP value to the pointer of the first linked list item.
- 参数:
lli -- Pointer to the first linked list item. Must align to 4 bytes.
-
void PPE_SetLine(u32 line)
Set line index for line over interrupt.
- 参数:
line -- The line index.
-
void PPE_SetValid(void)
Tell PPE the settings are valid for the auto reload function.
-
void PPE_Suspend(void)
Suspend PPE.
-
void PPE_Abort(void)
Abort PPE.
-
void PPE_Init(PPE_InitTypeDef *PPE_init_struct)
Initialize the PPE peripheral according to the specified parameters in the PPE_init_struct.
- 参数:
PPE_init_struct -- Pointer to a PPE_InitTypeDef structure that contains the configuration information for the specified PPE peripheral.
-
void PPE_SetScaleRation(float scale_x, float scale_y)
Set the scale ratio.
- 参数:
scale_x -- Scale ratio in the X direction. No smaller than 1/16.
scale_y -- Scale ratio in the Y direction. No smaller than 1/16.
-
void PPE_StructInit(PPE_InitTypeDef *PPE_init_struct)
Fill each PPE_init_struct member with its default value.
- 参数:
PPE_init_struct -- Pointer to a PPE_InitTypeDef structure which will be initialized.
-
void PPE_LayerEn(u32 layers)
Enable input layers.
- 参数:
layers --
Input layers to be enabled. This parameter can be one or combinations of the following values:
PPE_INPUT_LAYER1_BIT: input layer1.
PPE_INPUT_LAYER2_BIT: input layer2.
PPE_INPUT_LAYER3_BIT: input layer3.
-
void PPE_XOR_Int_handler(void (*xor_cb)(void))
Register the XOR interrupt handler callback.
- 参数:
xor_cb -- XOR function callback.
-
void PPE_XOR_init(void)
Initialize the XOR function.
-
void PPE_XOR_process(u32 src1, u32 src2, u32 src3, u32 dst)
Start XOR.
- 参数:
src1 -- XOR input data source address 1.
src2 -- XOR input data source address 2.
src3 -- XOR input data source address 3.
dst -- XOR output data destination address.