MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
PXP: Pixel Pipeline

Overview

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

Data Structures

struct  pxp_output_buffer_config_t
 PXP output buffer configuration. More...
 
struct  pxp_ps_buffer_config_t
 PXP process surface buffer configuration. More...
 
struct  pxp_as_buffer_config_t
 PXP alphs surface buffer configuration. More...
 
struct  pxp_as_blend_config_t
 PXP alpha surface blending configuration. More...
 
struct  pxp_csc2_config_t
 PXP CSC2 configuration. More...
 
struct  pxp_dither_final_lut_data_t
 PXP dither final LUT data. More...
 
struct  pxp_dither_config_t
 PXP dither configuration. More...
 

Enumerations

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...
 

Driver version

#define FSL_PXP_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 Version 2.0.0.
 

Initialization and deinitialization

void PXP_Init (PXP_Type *base)
 Initialize the PXP. More...
 
void PXP_Deinit (PXP_Type *base)
 De-initialize the PXP. More...
 
void PXP_Reset (PXP_Type *base)
 Reset the PXP. More...
 

Global operations

static void PXP_Start (PXP_Type *base)
 Start process. More...
 
static void PXP_EnableLcdHandShake (PXP_Type *base, bool enable)
 Enable or disable LCD hand shake. More...
 
static void PXP_EnableContinousRun (PXP_Type *base, bool enable)
 Enable or disable continous run. More...
 
static void PXP_SetProcessBlockSize (PXP_Type *base, pxp_block_size_t size)
 Set the PXP processing block size. More...
 

Status

static uint32_t PXP_GetStatusFlags (PXP_Type *base)
 Gets PXP status flags. More...
 
static void PXP_ClearStatusFlags (PXP_Type *base, uint32_t statusMask)
 Clears status flags with the provided mask. More...
 
static uint8_t PXP_GetAxiErrorId (PXP_Type *base, uint8_t axiIndex)
 Gets the AXI ID of the failing bus operation. More...
 

Interrupts

static void PXP_EnableInterrupts (PXP_Type *base, uint32_t mask)
 Enables PXP interrupts according to the provided mask. More...
 
static void PXP_DisableInterrupts (PXP_Type *base, uint32_t mask)
 Disables PXP interrupts according to the provided mask. More...
 

Alpha surface

void PXP_SetAlphaSurfaceBufferConfig (PXP_Type *base, const pxp_as_buffer_config_t *config)
 Set the alpha surface input buffer configuration. More...
 
void PXP_SetAlphaSurfaceBlendConfig (PXP_Type *base, const pxp_as_blend_config_t *config)
 Set the alpha surface blending configuration. More...
 
void PXP_SetAlphaSurfaceOverlayColorKey (PXP_Type *base, uint32_t colorKeyLow, uint32_t colorKeyHigh)
 Set the alpha surface overlay color key. More...
 
static void PXP_EnableAlphaSurfaceOverlayColorKey (PXP_Type *base, bool enable)
 Enable or disable the alpha surface color key. More...
 
void PXP_SetAlphaSurfacePosition (PXP_Type *base, uint16_t upperLeftX, uint16_t upperLeftY, uint16_t lowerRightX, uint16_t lowerRightY)
 Set the alpha surface position in output buffer. More...
 

Process surface

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...
 

Output buffer

void PXP_SetOutputBufferConfig (PXP_Type *base, const pxp_output_buffer_config_t *config)
 Set the PXP outpt buffer configuration. More...
 
static void PXP_SetOverwrittenAlphaValue (PXP_Type *base, uint8_t alpha)
 Set the global overwritten alpha value. More...
 
static void PXP_EnableOverWrittenAlpha (PXP_Type *base, bool enable)
 Enable or disable the global overwritten alpha value. More...
 
static void PXP_SetRotateConfig (PXP_Type *base, pxp_rotate_position_t position, pxp_rotate_degree_t degree, pxp_flip_mode_t flipMode)
 Set the rotation configuration. More...
 

Command queue

static void PXP_SetNextCommand (PXP_Type *base, void *commandAddr)
 Set the next command. More...
 
static bool PXP_IsNextCommandPending (PXP_Type *base)
 Check whether the next command is pending. More...
 
static void PXP_CancelNextCommand (PXP_Type *base)
 Cancel command set by PXP_SetNextCommand. More...
 

Color space conversion

void PXP_SetCsc1Mode (PXP_Type *base, pxp_csc1_mode_t mode)
 Set the CSC1 mode. More...
 
static void PXP_EnableCsc1 (PXP_Type *base, bool enable)
 Enable or disable the CSC1. More...
 

Data Structure Documentation

struct pxp_output_buffer_config_t

Data Fields

pxp_output_pixel_format_t pixelFormat
 Output buffer pixel format. More...
 
pxp_interlaced_output_mode_t interlacedMode
 Interlaced output mode. More...
 
uint32_t buffer0Addr
 Output buffer 0 address. More...
 
uint32_t buffer1Addr
 Output buffer 1 address, used for UV data in YUV 2-plane mode, or field 1 in output interlaced mode. More...
 
uint16_t pitchBytes
 Number of bytes between two vertically adjacent pixels. More...
 
uint16_t width
 Pixels per line. More...
 
uint16_t height
 How many lines in output buffer. More...
 

Field Documentation

pxp_output_pixel_format_t pxp_output_buffer_config_t::pixelFormat
pxp_interlaced_output_mode_t pxp_output_buffer_config_t::interlacedMode
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

Data Fields

pxp_ps_pixel_format_t pixelFormat
 PS buffer pixel format. More...
 
bool swapByte
 For each 16 bit word, set true to swap the two bytes. More...
 
uint32_t bufferAddr
 Input buffer address for the first panel. More...
 
uint32_t bufferAddrU
 Input buffer address for the second panel. More...
 
uint32_t bufferAddrV
 Input buffer address for the third panel. More...
 
uint16_t pitchBytes
 Number of bytes between two vertically adjacent pixels. More...
 

Field Documentation

pxp_ps_pixel_format_t pxp_ps_buffer_config_t::pixelFormat
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

Data Fields

pxp_as_pixel_format_t pixelFormat
 AS buffer pixel format. More...
 
uint32_t bufferAddr
 Input buffer address. More...
 
uint16_t pitchBytes
 Number of bytes between two vertically adjacent pixels. More...
 

Field Documentation

pxp_as_pixel_format_t pxp_as_buffer_config_t::pixelFormat
uint32_t pxp_as_buffer_config_t::bufferAddr
uint16_t pxp_as_buffer_config_t::pitchBytes
struct pxp_as_blend_config_t

Data Fields

uint8_t alpha
 User defined alpha value, only used when alphaMode is kPXP_AlphaOverride or kPXP_AlphaRop. More...
 
bool invertAlpha
 Set true to invert the alpha. More...
 
pxp_alpha_mode_t alphaMode
 Alpha mode. More...
 
pxp_rop_mode_t ropMode
 ROP mode, only valid when alphaMode is kPXP_AlphaRop. More...
 

Field Documentation

uint8_t pxp_as_blend_config_t::alpha
bool pxp_as_blend_config_t::invertAlpha
pxp_alpha_mode_t pxp_as_blend_config_t::alphaMode
pxp_rop_mode_t pxp_as_blend_config_t::ropMode
struct pxp_csc2_config_t

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

Data Fields

pxp_csc2_mode_t mode
 Convertion mode. More...
 
float A1
 A1. More...
 
float A2
 A2. More...
 
float A3
 A3. More...
 
float B1
 B1. More...
 
float B2
 B2. More...
 
float B3
 B3. More...
 
float C1
 C1. More...
 
float C2
 C2. More...
 
float C3
 C3. More...
 
int16_t D1
 D1. More...
 
int16_t D2
 D2. More...
 
int16_t D3
 D3. More...
 

Field Documentation

pxp_csc2_mode_t pxp_csc2_config_t::mode
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

Data Fields

uint32_t data_3_0
 Data 3 to data 0. More...
 
uint32_t data_7_4
 Data 7 to data 4. More...
 
uint32_t data_11_8
 Data 11 to data 8. More...
 
uint32_t data_15_12
 Data 15 to data 12. More...
 

Field Documentation

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...
 

Field Documentation

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

This must be set to kPXP_DitherLutOff if any dither engine uses kPXP_DitherOrdered mode.

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

Enumeration Type Documentation

Enumerator
kPXP_CommandLoadInterruptEnable 

Interrupt to show that the command set by PXP_SetNextCommand has been loaded.

kPXP_CompleteInterruptEnable 

PXP process completed.

enum _pxp_flags
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.

enum pxp_ram_t
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.

Function Documentation

void PXP_Init ( PXP_Type *  base)

This function enables the PXP peripheral clock, and resets the PXP registers to default status.

Parameters
basePXP peripheral base address.
void PXP_Deinit ( PXP_Type *  base)

This function disables the PXP peripheral clock.

Parameters
basePXP peripheral base address.
void PXP_Reset ( PXP_Type *  base)

This function resets the PXP peripheral registers to default status.

Parameters
basePXP peripheral base address.
static void PXP_Start ( PXP_Type *  base)
inlinestatic

Start PXP process using current configuration.

Parameters
basePXP peripheral base address.
static void PXP_EnableLcdHandShake ( PXP_Type *  base,
bool  enable 
)
inlinestatic
Parameters
basePXP peripheral base address.
enableTrue 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
basePXP peripheral base address.
enableTrue to enable, false to disable.
static void PXP_SetProcessBlockSize ( PXP_Type *  base,
pxp_block_size_t  size 
)
inlinestatic

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
basePXP peripheral base address.
sizeThe 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
basePXP 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
basePXP peripheral base address.
statusMaskThe 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
basePXP peripheral base address.
axiIndexWhitch AXI to get
  • 0: AXI0
  • 1: AXI1
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
basePXP peripheral base address.
maskThe interrupts to enable. Logical OR of _pxp_interrupt_enable.
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
basePXP peripheral base address.
maskThe interrupts to disable. Logical OR of _pxp_interrupt_enable.
void PXP_SetAlphaSurfaceBufferConfig ( PXP_Type *  base,
const pxp_as_buffer_config_t config 
)
Parameters
basePXP peripheral base address.
configPointer to the configuration.
void PXP_SetAlphaSurfaceBlendConfig ( PXP_Type *  base,
const pxp_as_blend_config_t config 
)
Parameters
basePXP peripheral base address.
configPointer 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
basePXP peripheral base address.
colorKeyLowColor key low range.
colorKeyHighColor 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
basePXP peripheral base address.
enableTrue to enable, false to disable.
void PXP_SetAlphaSurfacePosition ( PXP_Type *  base,
uint16_t  upperLeftX,
uint16_t  upperLeftY,
uint16_t  lowerRightX,
uint16_t  lowerRightY 
)
Parameters
basePXP peripheral base address.
upperLeftXX of the upper left corner.
upperLeftYY of the upper left corner.
lowerRightXX of the lower right corner.
lowerRightYY of the lower right corner.
static void PXP_SetProcessSurfaceBackGroundColor ( PXP_Type *  base,
uint32_t  backGroundColor 
)
inlinestatic
Parameters
basePXP peripheral base address.
backGroundColorPixel value of the background color.
void PXP_SetProcessSurfaceBufferConfig ( PXP_Type *  base,
const pxp_ps_buffer_config_t config 
)
Parameters
basePXP peripheral base address.
configPointer 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
basePXP peripheral base address.
inputWidthInput image width.
inputHeightInput image height.
outputWidthOutput image width.
outputHeightOutput image height.
void PXP_SetProcessSurfacePosition ( PXP_Type *  base,
uint16_t  upperLeftX,
uint16_t  upperLeftY,
uint16_t  lowerRightX,
uint16_t  lowerRightY 
)
Parameters
basePXP peripheral base address.
upperLeftXX of the upper left corner.
upperLeftYY of the upper left corner.
lowerRightXX of the lower right corner.
lowerRightYY 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
basePXP peripheral base address.
colorKeyLowColor key low range.
colorKeyHighColor key high range.
void PXP_SetOutputBufferConfig ( PXP_Type *  base,
const pxp_output_buffer_config_t config 
)
Parameters
basePXP peripheral base address.
configPointer 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
basePXP peripheral base address.
alphaThe 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
basePXP peripheral base address.
enableTrue to enable, false to disable.
static void PXP_SetRotateConfig ( PXP_Type *  base,
pxp_rotate_position_t  position,
pxp_rotate_degree_t  degree,
pxp_flip_mode_t  flipMode 
)
inlinestatic

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
basePXP peripheral base address.
positionRotate process surface or output buffer.
degreeRotate degree.
flipModeFlip 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:

  1. Prepare the PXP register values except STAT, CSCCOEFn, NEXT in the memory in the order they appear in the register map.
  2. Call this function sets the new operation to PXP.
  3. 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.
  4. When command loaded by PXP, a new command could be set using this function.
uint32_t pxp_command1[48];
uint32_t pxp_command2[48];
// Prepare the register values.
pxp_command1[0] = ...;
pxp_command1[1] = ...;
// ...
pxp_command2[0] = ...;
pxp_command2[1] = ...;
// ...
// Make sure no new command pending.
{
}
// Set new operation.
PXP_SetNextCommand(PXP, pxp_command1);
// Wait for new command loaded. Here could check @ref kPXP_CommandLoadFlag too.
{
}
PXP_SetNextCommand(PXP, pxp_command2);
Parameters
basePXP peripheral base address.
commandAddrAddress of the new command.
static bool PXP_IsNextCommandPending ( PXP_Type *  base)
inlinestatic
Parameters
baseUART peripheral base address.
Returns
True is pending, false is not.
static void PXP_CancelNextCommand ( PXP_Type *  base)
inlinestatic
Parameters
baseUART peripheral base address.
void PXP_SetCsc1Mode ( PXP_Type *  base,
pxp_csc1_mode_t  mode 
)

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
basePXP peripheral base address.
modeThe conversion mode.
static void PXP_EnableCsc1 ( PXP_Type *  base,
bool  enable 
)
inlinestatic
Parameters
basePXP peripheral base address.
enableTrue to enable, false to disable.