The MCUXpresso SDK provides a driver for the Pixel Pipeline (PXP)
The PXP is used to process graphics buffers or composite video and graphics data before sending to an LCD display or TV encoder. The PXP driver only provides functional APIs. It does not maintain software level state, so that the APIs could be involved directly to any upper layer graphics framework easily.
To use the PXP driver, call PXP_Init first to enable and initialize the peripheral. Generally, call the PXP driver APIs the configure input buffer, output buffer, and other setting such as flip, rotate, then call PXP_Start, thus the PXP starts the processing. When finished, the flag kPXP_CompleteFlag asserts. PXP also supports operation queuing, it means that a new operation could be submited to PXP while the current PXP operation is running. When current operation finished, the new operation configurations are loaded to PXP register and new processing starts.
Typical use case
PXP normal operation
This example shows how to perform vertical flip to process surface and save to output buffer. The input and output buffer pixel format are RGB888.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/pxp
PXP operation queue
This example shows how to perform vertical flip to process surface using operation queue. The input and output buffer pixel format are RGB888.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/pxp
|
enum | _pxp_interrupt_enable {
kPXP_CommandLoadInterruptEnable = PXP_CTRL_NEXT_IRQ_ENABLE_MASK,
kPXP_CompleteInterruptEnable = PXP_CTRL_IRQ_ENABLE_MASK
} |
| PXP interrupts to enable. More...
|
|
enum | _pxp_flags {
kPXP_CommandLoadFlag = PXP_STAT_NEXT_IRQ_MASK,
kPXP_CompleteFlag = PXP_STAT_IRQ0_MASK,
kPXP_Axi0ReadErrorFlag = PXP_STAT_AXI_READ_ERROR_0_MASK,
kPXP_Axi0WriteErrorFlag = PXP_STAT_AXI_WRITE_ERROR_0_MASK
} |
| PXP status flags. More...
|
|
enum | pxp_flip_mode_t {
kPXP_FlipDisable = 0U,
kPXP_FlipHorizontal = 0x01U,
kPXP_FlipVertical = 0x02U,
kPXP_FlipBoth = 0x03U
} |
| PXP output flip mode. More...
|
|
enum | pxp_rotate_position_t {
kPXP_RotateOutputBuffer = 0U,
kPXP_RotateProcessSurface
} |
| PXP rotate mode. More...
|
|
enum | pxp_rotate_degree_t {
kPXP_Rotate0 = 0U,
kPXP_Rotate90,
kPXP_Rotate180,
kPXP_Rotate270
} |
| PXP rotate degree. More...
|
|
enum | pxp_interlaced_output_mode_t {
kPXP_OutputProgressive = 0U,
kPXP_OutputField0,
kPXP_OutputField1,
kPXP_OutputInterlaced
} |
| PXP interlaced output mode. More...
|
|
enum | pxp_output_pixel_format_t {
kPXP_OutputPixelFormatARGB8888 = 0x0,
kPXP_OutputPixelFormatRGB888 = 0x4,
kPXP_OutputPixelFormatRGB888P = 0x5,
kPXP_OutputPixelFormatARGB1555 = 0x8,
kPXP_OutputPixelFormatARGB4444 = 0x9,
kPXP_OutputPixelFormatRGB555 = 0xC,
kPXP_OutputPixelFormatRGB444 = 0xD,
kPXP_OutputPixelFormatRGB565 = 0xE,
kPXP_OutputPixelFormatYUV1P444 = 0x10,
kPXP_OutputPixelFormatUYVY1P422 = 0x12,
kPXP_OutputPixelFormatVYUY1P422 = 0x13,
kPXP_OutputPixelFormatY8 = 0x14,
kPXP_OutputPixelFormatY4 = 0x15,
kPXP_OutputPixelFormatYUV2P422 = 0x18,
kPXP_OutputPixelFormatYUV2P420 = 0x19,
kPXP_OutputPixelFormatYVU2P422 = 0x1A,
kPXP_OutputPixelFormatYVU2P420 = 0x1B
} |
| PXP output buffer format. More...
|
|
enum | pxp_ps_pixel_format_t {
kPXP_PsPixelFormatRGB888 = 0x4,
kPXP_PsPixelFormatRGB555 = 0xC,
kPXP_PsPixelFormatRGB444 = 0xD,
kPXP_PsPixelFormatRGB565 = 0xE,
kPXP_PsPixelFormatYUV1P444 = 0x10,
kPXP_PsPixelFormatUYVY1P422 = 0x12,
kPXP_PsPixelFormatVYUY1P422 = 0x13,
kPXP_PsPixelFormatY8 = 0x14,
kPXP_PsPixelFormatY4 = 0x15,
kPXP_PsPixelFormatYUV2P422 = 0x18,
kPXP_PsPixelFormatYUV2P420 = 0x19,
kPXP_PsPixelFormatYVU2P422 = 0x1A,
kPXP_PsPixelFormatYVU2P420 = 0x1B,
kPXP_PsPixelFormatYVU422 = 0x1E,
kPXP_PsPixelFormatYVU420 = 0x1F
} |
| PXP process surface buffer pixel format. More...
|
|
enum | pxp_as_pixel_format_t {
kPXP_AsPixelFormatARGB8888 = 0x0,
kPXP_AsPixelFormatRGB888 = 0x4,
kPXP_AsPixelFormatARGB1555 = 0x8,
kPXP_AsPixelFormatARGB4444 = 0x9,
kPXP_AsPixelFormatRGB555 = 0xC,
kPXP_AsPixelFormatRGB444 = 0xD,
kPXP_AsPixelFormatRGB565 = 0xE
} |
| PXP alpha surface buffer pixel format. More...
|
|
enum | pxp_alpha_mode_t {
kPXP_AlphaEmbedded,
kPXP_AlphaOverride,
kPXP_AlphaMultiply,
kPXP_AlphaRop
} |
| PXP alpha mode during blending. More...
|
|
enum | pxp_rop_mode_t {
kPXP_RopMaskAs = 0x0,
kPXP_RopMaskNotAs = 0x1,
kPXP_RopMaskAsNot = 0x2,
kPXP_RopMergeAs = 0x3,
kPXP_RopMergeNotAs = 0x4,
kPXP_RopMergeAsNot = 0x5,
kPXP_RopNotCopyAs = 0x6,
kPXP_RopNot = 0x7,
kPXP_RopNotMaskAs = 0x8,
kPXP_RopNotMergeAs = 0x9,
kPXP_RopXorAs = 0xA,
kPXP_RopNotXorAs = 0xB
} |
| PXP ROP mode during blending. More...
|
|
enum | pxp_block_size_t {
kPXP_BlockSize8 = 0U,
kPXP_BlockSize16
} |
| PXP process block size. More...
|
|
enum | pxp_csc1_mode_t {
kPXP_Csc1YUV2RGB = 0U,
kPXP_Csc1YCbCr2RGB
} |
| PXP CSC1 mode. More...
|
|
enum | pxp_csc2_mode_t {
kPXP_Csc2YUV2RGB = 0U,
kPXP_Csc2YCbCr2RGB,
kPXP_Csc2RGB2YUV,
kPXP_Csc2RGB2YCbCr
} |
| PXP CSC2 mode. More...
|
|
enum | pxp_ram_t {
kPXP_RamDither0Lut = 0U,
kPXP_RamDither1Lut = 3U,
kPXP_RamDither2Lut = 4U
} |
| PXP internal memory. More...
|
|
enum | _pxp_dither_mode {
kPXP_DitherPassThrough = 0U,
kPXP_DitherOrdered = 3U,
kPXP_DitherQuantOnly = 4U
} |
| PXP dither mode. More...
|
|
enum | _pxp_dither_lut_mode {
kPXP_DitherLutOff = 0U,
kPXP_DitherLutPreDither,
kPXP_DitherLutPostDither
} |
| PXP dither LUT mode. More...
|
|
enum | _pxp_dither_matrix_size {
kPXP_DitherMatrix8 = 1,
kPXP_DitherMatrix16
} |
| PXP dither matrix size. More...
|
|
|
static void | PXP_SetProcessSurfaceBackGroundColor (PXP_Type *base, uint32_t backGroundColor) |
| Set the back ground color of PS. More...
|
|
void | PXP_SetProcessSurfaceBufferConfig (PXP_Type *base, const pxp_ps_buffer_config_t *config) |
| Set the process surface input buffer configuration. More...
|
|
void | PXP_SetProcessSurfaceScaler (PXP_Type *base, uint16_t inputWidth, uint16_t inputHeight, uint16_t outputWidth, uint16_t outputHeight) |
| Set the process surface scaler configuration. More...
|
|
void | PXP_SetProcessSurfacePosition (PXP_Type *base, uint16_t upperLeftX, uint16_t upperLeftY, uint16_t lowerRightX, uint16_t lowerRightY) |
| Set the process surface position in output buffer. More...
|
|
void | PXP_SetProcessSurfaceColorKey (PXP_Type *base, uint32_t colorKeyLow, uint32_t colorKeyHigh) |
| Set the process surface color key. More...
|
|
struct pxp_output_buffer_config_t |
uint32_t pxp_output_buffer_config_t::buffer0Addr |
uint32_t pxp_output_buffer_config_t::buffer1Addr |
uint16_t pxp_output_buffer_config_t::pitchBytes |
uint16_t pxp_output_buffer_config_t::width |
uint16_t pxp_output_buffer_config_t::height |
struct pxp_ps_buffer_config_t |
bool pxp_ps_buffer_config_t::swapByte |
uint32_t pxp_ps_buffer_config_t::bufferAddr |
uint32_t pxp_ps_buffer_config_t::bufferAddrU |
uint32_t pxp_ps_buffer_config_t::bufferAddrV |
uint16_t pxp_ps_buffer_config_t::pitchBytes |
struct pxp_as_buffer_config_t |
uint32_t pxp_as_buffer_config_t::bufferAddr |
uint16_t pxp_as_buffer_config_t::pitchBytes |
struct pxp_as_blend_config_t |
uint8_t pxp_as_blend_config_t::alpha |
bool pxp_as_blend_config_t::invertAlpha |
Converting from YUV/YCbCr color spaces to the RGB color space uses the following equation structure:
R = A1(Y+D1) + A2(U+D2) + A3(V+D3) G = B1(Y+D1) + B2(U+D2) + B3(V+D3) B = C1(Y+D1) + C2(U+D2) + C3(V+D3)
Converting from the RGB color space to YUV/YCbCr color spaces uses the following equation structure:
Y = A1*R + A2*G + A3*B + D1 U = B1*R + B2*G + B3*B + D2 V = C1*R + C2*G + C3*B + D3
float pxp_csc2_config_t::A1 |
float pxp_csc2_config_t::A2 |
float pxp_csc2_config_t::A3 |
float pxp_csc2_config_t::B1 |
float pxp_csc2_config_t::B2 |
float pxp_csc2_config_t::B3 |
float pxp_csc2_config_t::C1 |
float pxp_csc2_config_t::C2 |
float pxp_csc2_config_t::C3 |
int16_t pxp_csc2_config_t::D1 |
int16_t pxp_csc2_config_t::D2 |
int16_t pxp_csc2_config_t::D3 |
struct pxp_dither_final_lut_data_t |
uint32_t pxp_dither_final_lut_data_t::data_3_0 |
Data 0 is the least significant byte.
uint32_t pxp_dither_final_lut_data_t::data_7_4 |
Data 4 is the least significant byte.
uint32_t pxp_dither_final_lut_data_t::data_11_8 |
Data 8 is the least significant byte.
uint32_t pxp_dither_final_lut_data_t::data_15_12 |
Data 12 is the least significant byte.
struct pxp_dither_config_t |
Data Fields |
uint32_t | enableDither0: 1 |
| Enable dither engine 0 or not, set 1 to enable, 0 to disable. More...
|
|
uint32_t | enableDither1: 1 |
| Enable dither engine 1 or not, set 1 to enable, 0 to disable. More...
|
|
uint32_t | enableDither2: 1 |
| Enable dither engine 2 or not, set 1 to enable, 0 to disable. More...
|
|
uint32_t | ditherMode0: 3 |
| Dither mode for dither engine 0. More...
|
|
uint32_t | ditherMode1: 3 |
| Dither mode for dither engine 1. More...
|
|
uint32_t | ditherMode2: 3 |
| Dither mode for dither engine 2. More...
|
|
uint32_t | quantBitNum: 3 |
| Number of bits quantize down to, the valid value is 1~7. More...
|
|
uint32_t | lutMode: 2 |
| How to use the memory LUT, see _pxp_dither_lut_mode. More...
|
|
uint32_t | idxMatrixSize0: 2 |
| Size of index matrix used for dither for dither engine 0, see _pxp_dither_matrix_size. More...
|
|
uint32_t | idxMatrixSize1: 2 |
| Size of index matrix used for dither for dither engine 1, see _pxp_dither_matrix_size. More...
|
|
uint32_t | idxMatrixSize2: 2 |
| Size of index matrix used for dither for dither engine 2, see _pxp_dither_matrix_size. More...
|
|
uint32_t | enableFinalLut: 1 |
| Enable the final LUT, set 1 to enable, 0 to disable. More...
|
|
uint32_t pxp_dither_config_t::enableDither0 |
uint32_t pxp_dither_config_t::enableDither1 |
uint32_t pxp_dither_config_t::enableDither2 |
uint32_t pxp_dither_config_t::ditherMode0 |
uint32_t pxp_dither_config_t::ditherMode1 |
uint32_t pxp_dither_config_t::ditherMode2 |
uint32_t pxp_dither_config_t::quantBitNum |
uint32_t pxp_dither_config_t::lutMode |
uint32_t pxp_dither_config_t::idxMatrixSize0 |
uint32_t pxp_dither_config_t::idxMatrixSize1 |
uint32_t pxp_dither_config_t::idxMatrixSize2 |
uint32_t pxp_dither_config_t::enableFinalLut |
Enumerator |
---|
kPXP_CommandLoadInterruptEnable |
Interrupt to show that the command set by PXP_SetNextCommand has been loaded.
|
kPXP_CompleteInterruptEnable |
PXP process completed.
|
- Note
- These enumerations are meant to be OR'd together to form a bit mask.
Enumerator |
---|
kPXP_CommandLoadFlag |
The command set by PXP_SetNextCommand has been loaded, could set new command.
|
kPXP_CompleteFlag |
PXP process completed.
|
kPXP_Axi0ReadErrorFlag |
PXP encountered an AXI read error and processing has been terminated.
|
kPXP_Axi0WriteErrorFlag |
PXP encountered an AXI write error and processing has been terminated.
|
Enumerator |
---|
kPXP_FlipDisable |
Flip disable.
|
kPXP_FlipHorizontal |
Horizontal flip.
|
kPXP_FlipVertical |
Vertical flip.
|
kPXP_FlipBoth |
Flip both directions.
|
Enumerator |
---|
kPXP_RotateOutputBuffer |
Rotate the output buffer.
|
kPXP_RotateProcessSurface |
Rotate the process surface.
|
Enumerator |
---|
kPXP_Rotate0 |
Clock wise rotate 0 deg.
|
kPXP_Rotate90 |
Clock wise rotate 90 deg.
|
kPXP_Rotate180 |
Clock wise rotate 180 deg.
|
kPXP_Rotate270 |
Clock wise rotate 270 deg.
|
Enumerator |
---|
kPXP_OutputProgressive |
All data written in progressive format to output buffer 0.
|
kPXP_OutputField0 |
Only write field 0 data to output buffer 0.
|
kPXP_OutputField1 |
Only write field 1 data to output buffer 0.
|
kPXP_OutputInterlaced |
Field 0 write to buffer 0, field 1 write to buffer 1.
|
Enumerator |
---|
kPXP_OutputPixelFormatARGB8888 |
32-bit pixels with alpha.
|
kPXP_OutputPixelFormatRGB888 |
32-bit pixels without alpha (unpacked 24-bit format)
|
kPXP_OutputPixelFormatRGB888P |
24-bit pixels without alpha (packed 24-bit format)
|
kPXP_OutputPixelFormatARGB1555 |
16-bit pixels with alpha.
|
kPXP_OutputPixelFormatARGB4444 |
16-bit pixels with alpha.
|
kPXP_OutputPixelFormatRGB555 |
16-bit pixels without alpha.
|
kPXP_OutputPixelFormatRGB444 |
16-bit pixels without alpha.
|
kPXP_OutputPixelFormatRGB565 |
16-bit pixels without alpha.
|
kPXP_OutputPixelFormatYUV1P444 |
32-bit pixels (1-plane XYUV unpacked).
|
kPXP_OutputPixelFormatUYVY1P422 |
16-bit pixels (1-plane U0,Y0,V0,Y1 interleaved bytes)
|
kPXP_OutputPixelFormatVYUY1P422 |
16-bit pixels (1-plane V0,Y0,U0,Y1 interleaved bytes)
|
kPXP_OutputPixelFormatY8 |
8-bit monochrome pixels (1-plane Y luma output)
|
kPXP_OutputPixelFormatY4 |
4-bit monochrome pixels (1-plane Y luma, 4 bit truncation)
|
kPXP_OutputPixelFormatYUV2P422 |
16-bit pixels (2-plane UV interleaved bytes)
|
kPXP_OutputPixelFormatYUV2P420 |
16-bit pixels (2-plane UV)
|
kPXP_OutputPixelFormatYVU2P422 |
16-bit pixels (2-plane VU interleaved bytes)
|
kPXP_OutputPixelFormatYVU2P420 |
16-bit pixels (2-plane VU)
|
Enumerator |
---|
kPXP_PsPixelFormatRGB888 |
32-bit pixels without alpha (unpacked 24-bit format)
|
kPXP_PsPixelFormatRGB555 |
16-bit pixels without alpha.
|
kPXP_PsPixelFormatRGB444 |
16-bit pixels without alpha.
|
kPXP_PsPixelFormatRGB565 |
16-bit pixels without alpha.
|
kPXP_PsPixelFormatYUV1P444 |
32-bit pixels (1-plane XYUV unpacked).
|
kPXP_PsPixelFormatUYVY1P422 |
16-bit pixels (1-plane U0,Y0,V0,Y1 interleaved bytes)
|
kPXP_PsPixelFormatVYUY1P422 |
16-bit pixels (1-plane V0,Y0,U0,Y1 interleaved bytes)
|
kPXP_PsPixelFormatY8 |
8-bit monochrome pixels (1-plane Y luma output)
|
kPXP_PsPixelFormatY4 |
4-bit monochrome pixels (1-plane Y luma, 4 bit truncation)
|
kPXP_PsPixelFormatYUV2P422 |
16-bit pixels (2-plane UV interleaved bytes)
|
kPXP_PsPixelFormatYUV2P420 |
16-bit pixels (2-plane UV)
|
kPXP_PsPixelFormatYVU2P422 |
16-bit pixels (2-plane VU interleaved bytes)
|
kPXP_PsPixelFormatYVU2P420 |
16-bit pixels (2-plane VU)
|
kPXP_PsPixelFormatYVU422 |
16-bit pixels (3-plane)
|
kPXP_PsPixelFormatYVU420 |
16-bit pixels (3-plane)
|
Enumerator |
---|
kPXP_AsPixelFormatARGB8888 |
32-bit pixels with alpha.
|
kPXP_AsPixelFormatRGB888 |
32-bit pixels without alpha (unpacked 24-bit format)
|
kPXP_AsPixelFormatARGB1555 |
16-bit pixels with alpha.
|
kPXP_AsPixelFormatARGB4444 |
16-bit pixels with alpha.
|
kPXP_AsPixelFormatRGB555 |
16-bit pixels without alpha.
|
kPXP_AsPixelFormatRGB444 |
16-bit pixels without alpha.
|
kPXP_AsPixelFormatRGB565 |
16-bit pixels without alpha.
|
Enumerator |
---|
kPXP_AlphaEmbedded |
The alpha surface pixel alpha value will be used for blend.
|
kPXP_AlphaOverride |
The user defined alpha value will be used for blend directly.
|
kPXP_AlphaMultiply |
The alpha surface pixel alpha value scaled the user defined alpha value will be used for blend, for example, pixel alpha set set to 200, user defined alpha set to 100, then the reault alpha is 200 * 100 / 255.
|
kPXP_AlphaRop |
Raster operation.
|
Explanation:
- AS: Alpha surface
- PS: Process surface
- nAS: Alpha surface NOT value
- nPS: Process surface NOT value
Enumerator |
---|
kPXP_RopMaskAs |
AS AND PS.
|
kPXP_RopMaskNotAs |
nAS AND PS.
|
kPXP_RopMaskAsNot |
AS AND nPS.
|
kPXP_RopMergeAs |
AS OR PS.
|
kPXP_RopMergeNotAs |
nAS OR PS.
|
kPXP_RopMergeAsNot |
AS OR nPS.
|
kPXP_RopNotCopyAs |
nAS.
|
kPXP_RopNot |
nPS.
|
kPXP_RopNotMaskAs |
AS NAND PS.
|
kPXP_RopNotMergeAs |
AS NOR PS.
|
kPXP_RopXorAs |
AS XOR PS.
|
kPXP_RopNotXorAs |
AS XNOR PS.
|
Enumerator |
---|
kPXP_BlockSize8 |
Process 8x8 pixel blocks.
|
kPXP_BlockSize16 |
Process 16x16 pixel blocks.
|
Enumerator |
---|
kPXP_Csc1YUV2RGB |
YUV to RGB.
|
kPXP_Csc1YCbCr2RGB |
YCbCr to RGB.
|
Enumerator |
---|
kPXP_Csc2YUV2RGB |
YUV to RGB.
|
kPXP_Csc2YCbCr2RGB |
YCbCr to RGB.
|
kPXP_Csc2RGB2YUV |
RGB to YUV.
|
kPXP_Csc2RGB2YCbCr |
RGB to YCbCr.
|
Enumerator |
---|
kPXP_RamDither0Lut |
Dither 0 LUT memory.
|
kPXP_RamDither1Lut |
Dither 1 LUT memory.
|
kPXP_RamDither2Lut |
Dither 2 LUT memory.
|
Enumerator |
---|
kPXP_DitherPassThrough |
Pass through, no dither.
|
kPXP_DitherOrdered |
Ordered dither.
|
kPXP_DitherQuantOnly |
No dithering, only quantization.
|
Enumerator |
---|
kPXP_DitherLutOff |
The LUT memory is not used for LUT, could be used as ordered dither index matrix.
|
kPXP_DitherLutPreDither |
Use LUT at the pre-dither stage, The pre-dither LUT could only be used in Floyd mode or Atkinson mode, which are not supported by current PXP module.
|
kPXP_DitherLutPostDither |
Use LUT at the post-dither stage.
|
Enumerator |
---|
kPXP_DitherMatrix8 |
The dither index matrix is 8x8.
|
kPXP_DitherMatrix16 |
The dither index matrix is 16x16.
|
void PXP_Init |
( |
PXP_Type * |
base | ) |
|
This function enables the PXP peripheral clock, and resets the PXP registers to default status.
- Parameters
-
base | PXP peripheral base address. |
void PXP_Deinit |
( |
PXP_Type * |
base | ) |
|
This function disables the PXP peripheral clock.
- Parameters
-
base | PXP peripheral base address. |
void PXP_Reset |
( |
PXP_Type * |
base | ) |
|
This function resets the PXP peripheral registers to default status.
- Parameters
-
base | PXP peripheral base address. |
static void PXP_Start |
( |
PXP_Type * |
base | ) |
|
|
inlinestatic |
Start PXP process using current configuration.
- Parameters
-
base | PXP peripheral base address. |
static void PXP_EnableLcdHandShake |
( |
PXP_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | PXP peripheral base address. |
enable | True to enable, false to disable. |
static void PXP_EnableContinousRun |
( |
PXP_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
If continous run not enabled, PXP_Start starts the PXP process. When completed, PXP enters idle mode and flag kPXP_CompleteFlag asserts.
If continous run enabled, the PXP will repeat based on the current configuration register settings.
- Parameters
-
base | PXP peripheral base address. |
enable | True to enable, false to disable. |
This function chooses the pixel block size that PXP using during process. Larger block size means better performace, but be careful that when PXP is rotating, the output must be divisible by the block size selected.
- Parameters
-
base | PXP peripheral base address. |
size | The pixel block size. |
static uint32_t PXP_GetStatusFlags |
( |
PXP_Type * |
base | ) |
|
|
inlinestatic |
This function gets all PXP status flags. The flags are returned as the logical OR value of the enumerators _pxp_flags. To check a specific status, compare the return value with enumerators in _pxp_flags. For example, to check whether the PXP has completed process, use like this:
- Parameters
-
base | PXP peripheral base address. |
- Returns
- PXP status flags which are OR'ed by the enumerators in the _pxp_flags.
static void PXP_ClearStatusFlags |
( |
PXP_Type * |
base, |
|
|
uint32_t |
statusMask |
|
) |
| |
|
inlinestatic |
This function clears PXP status flags with a provided mask.
- Parameters
-
base | PXP peripheral base address. |
statusMask | The status flags to be cleared; it is logical OR value of _pxp_flags. |
static uint8_t PXP_GetAxiErrorId |
( |
PXP_Type * |
base, |
|
|
uint8_t |
axiIndex |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | PXP peripheral base address. |
axiIndex | Whitch AXI to get
|
- Returns
- The AXI ID of the failing bus operation.
static void PXP_EnableInterrupts |
( |
PXP_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This function enables the PXP interrupts according to the provided mask. The mask is a logical OR of enumeration members. See _pxp_interrupt_enable. For example, to enable PXP process complete interrupt and command loaded interrupt, do the following.
- Parameters
-
static void PXP_DisableInterrupts |
( |
PXP_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
This function disables the PXP interrupts according to the provided mask. The mask is a logical OR of enumeration members. See _pxp_interrupt_enable.
- Parameters
-
- Parameters
-
base | PXP peripheral base address. |
config | Pointer to the configuration. |
- Parameters
-
base | PXP peripheral base address. |
config | Pointer to the configuration structure. |
void PXP_SetAlphaSurfaceOverlayColorKey |
( |
PXP_Type * |
base, |
|
|
uint32_t |
colorKeyLow, |
|
|
uint32_t |
colorKeyHigh |
|
) |
| |
If a pixel in the current overlay image with a color that falls in the range from the colorKeyLow
to colorKeyHigh
range, it will use the process surface pixel value for that location. If no PS image is present or if the PS image also matches its colorkey range, the PS background color is used.
- Parameters
-
base | PXP peripheral base address. |
colorKeyLow | Color key low range. |
colorKeyHigh | Color key high range. |
- Note
- Colorkey operations are higher priority than alpha or ROP operations
static void PXP_EnableAlphaSurfaceOverlayColorKey |
( |
PXP_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | PXP peripheral base address. |
enable | True to enable, false to disable. |
void PXP_SetAlphaSurfacePosition |
( |
PXP_Type * |
base, |
|
|
uint16_t |
upperLeftX, |
|
|
uint16_t |
upperLeftY, |
|
|
uint16_t |
lowerRightX, |
|
|
uint16_t |
lowerRightY |
|
) |
| |
- Parameters
-
base | PXP peripheral base address. |
upperLeftX | X of the upper left corner. |
upperLeftY | Y of the upper left corner. |
lowerRightX | X of the lower right corner. |
lowerRightY | Y of the lower right corner. |
static void PXP_SetProcessSurfaceBackGroundColor |
( |
PXP_Type * |
base, |
|
|
uint32_t |
backGroundColor |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | PXP peripheral base address. |
backGroundColor | Pixel value of the background color. |
- Parameters
-
base | PXP peripheral base address. |
config | Pointer to the configuration. |
void PXP_SetProcessSurfaceScaler |
( |
PXP_Type * |
base, |
|
|
uint16_t |
inputWidth, |
|
|
uint16_t |
inputHeight, |
|
|
uint16_t |
outputWidth, |
|
|
uint16_t |
outputHeight |
|
) |
| |
The valid down scale fact is 1/(2^12) ~ 16.
- Parameters
-
base | PXP peripheral base address. |
inputWidth | Input image width. |
inputHeight | Input image height. |
outputWidth | Output image width. |
outputHeight | Output image height. |
void PXP_SetProcessSurfacePosition |
( |
PXP_Type * |
base, |
|
|
uint16_t |
upperLeftX, |
|
|
uint16_t |
upperLeftY, |
|
|
uint16_t |
lowerRightX, |
|
|
uint16_t |
lowerRightY |
|
) |
| |
- Parameters
-
base | PXP peripheral base address. |
upperLeftX | X of the upper left corner. |
upperLeftY | Y of the upper left corner. |
lowerRightX | X of the lower right corner. |
lowerRightY | Y of the lower right corner. |
void PXP_SetProcessSurfaceColorKey |
( |
PXP_Type * |
base, |
|
|
uint32_t |
colorKeyLow, |
|
|
uint32_t |
colorKeyHigh |
|
) |
| |
If the PS image matches colorkey range, the PS background color is output. Set colorKeyLow
to 0xFFFFFFFF and colorKeyHigh
to 0 will disable the colorkeying.
- Parameters
-
base | PXP peripheral base address. |
colorKeyLow | Color key low range. |
colorKeyHigh | Color key high range. |
- Parameters
-
base | PXP peripheral base address. |
config | Pointer to the configuration. |
static void PXP_SetOverwrittenAlphaValue |
( |
PXP_Type * |
base, |
|
|
uint8_t |
alpha |
|
) |
| |
|
inlinestatic |
If global overwritten alpha is enabled, the alpha component in output buffer pixels will be overwritten, otherwise the computed alpha value is used.
- Parameters
-
base | PXP peripheral base address. |
alpha | The alpha value. |
static void PXP_EnableOverWrittenAlpha |
( |
PXP_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
If global overwritten alpha is enabled, the alpha component in output buffer pixels will be overwritten, otherwise the computed alpha value is used.
- Parameters
-
base | PXP peripheral base address. |
enable | True to enable, false to disable. |
The PXP could rotate the process surface or the output buffer. There are two PXP versions:
- Version 1: Only has one rotate sub module, the output buffer and process surface share the same rotate sub module, which means the process surface and output buffer could not be rotate at the same time. When pass in kPXP_RotateOutputBuffer, the process surface could not use the rotate, Also when pass in kPXP_RotateProcessSurface, output buffer could not use the rotate.
- Version 2: Has two seperate rotate sub modules, the output buffer and process surface could configure the rotation independently.
Upper layer could use the macro PXP_SHARE_ROTATE to check which version is. PXP_SHARE_ROTATE=1 means version 1.
- Parameters
-
base | PXP peripheral base address. |
position | Rotate process surface or output buffer. |
degree | Rotate degree. |
flipMode | Flip mode. |
- Note
- This function is different depends on the macro PXP_SHARE_ROTATE.
static void PXP_SetNextCommand |
( |
PXP_Type * |
base, |
|
|
void * |
commandAddr |
|
) |
| |
|
inlinestatic |
The PXP supports a primitive ability to queue up one operation while the current operation is running. Workflow:
- Prepare the PXP register values except STAT, CSCCOEFn, NEXT in the memory in the order they appear in the register map.
- Call this function sets the new operation to PXP.
- There are two methods to check whether the PXP has loaded the new operation. The first method is using PXP_IsNextCommandPending. If there is new operation not loaded by the PXP, this function returns true. The second method is checking the flag kPXP_CommandLoadFlag, if command loaded, this flag asserts. User could enable interrupt kPXP_CommandLoadInterruptEnable to get the loaded signal in interrupt way.
- When command loaded by PXP, a new command could be set using this function.
uint32_t pxp_command1[48];
uint32_t pxp_command2[48];
pxp_command1[0] = ...;
pxp_command1[1] = ...;
pxp_command2[0] = ...;
pxp_command2[1] = ...;
{
}
{
}
- Parameters
-
base | PXP peripheral base address. |
commandAddr | Address of the new command. |
static bool PXP_IsNextCommandPending |
( |
PXP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | UART peripheral base address. |
- Returns
- True is pending, false is not.
static void PXP_CancelNextCommand |
( |
PXP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | UART peripheral base address. |
The CSC1 module receives scaled YUV/YCbCr444 pixels from the scale engine and converts the pixels to the RGB888 color space. It could only be used by process surface.
- Parameters
-
base | PXP peripheral base address. |
mode | The conversion mode. |
static void PXP_EnableCsc1 |
( |
PXP_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | PXP peripheral base address. |
enable | True to enable, false to disable. |