MCUXpresso SDK API Reference Manual  Rev. 1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
ISI: Image Sensing Interface

Overview

The MCUXpresso SDK provides a peripheral driver for the Image Sensing Interface(ISI) of I.MX devices.

The ISI module supports:

The ISI driver provides separate functions for these features so these features can be enabled according to the use case.

To use an ISI channel, the function ISI_Init should be called first to enable the clock and set ISI to a defined status. After initialization, use the ISI_SetConfig to set the basic configuration. The ISI can work with the basic configurations, to enable the additional features and call the feature configuration functions such as ISI_SetCropConfig to set the configuration for specific feature. When the configuration is finished, call ISI_Start to start the ISI to work.

Typical use case

Output buffer

Every ISI channel has two output buffers, every buffer has three panels, used by Y, U, and V accordingly. When a frame transfer is finished, the next frame is saved to the other buffer automatically.
In this example, the output format is RGBA8888, so only the outputBufferAddrY is used. To show that how to update the output buffer address, this example uses 5 memory blocks as the output buffer. The output frame is saved to these 5 memory blocks one by one. This means the first frame is saved to outputBufs[0] by ISI output buffer 0, the second frame is saved to outputBufs[1] by the ISI output buffer 1, the third frame is saved to outputBufs[2] by the ISI output buffer 0, the forth frame is saved to outputBufs[3] by the ISI output buffer 1, and so on.

#define ISI_BASE ISI0
#define MEM_BLK_CNT 5
#define IMG_HEIGHT 320
#define IMG_WIDTH 480
/* Memory blocks used as output buffer. */
uint32_t outputBufs[MEM_BLK_CNT][IMG_HEIGHT][IMG_WIDTH];
/* Index of outputBufs to save ISI output frame next. This value could be 0 to (MEM_BLK_CNT - 1). */
uint8_t outputBufIdx;
/* ISI output buffer that currently used. */
uint8_t isiBufIdx;
void ISI_Configure(ISI_Type * base)
{
isi_config_t isiConfig;
ISI_GetDefaultConfig(&isiConfig);
isiConfig->inputHeight = IMG_HEIGHT;
isiConfig->inputWidth = IMG_WIDTH;
ISI_SetConfig(base, &isiConfig);
/* Because color space conversion is enabled by default, so disable it. */
/* Set the address for output buffer. */
ISI_SetOutputBufferAddr(base, 0U, (uint32_t)(outputBufs[0]), 0U, 0U);
ISI_SetOutputBufferAddr(base, 1U, (uint32_t)(outputBufs[1]), 0U, 0U);
/* outputBufs[2] will be used to save output frame next. */
outputBufIdx = 2U;
/* At the begining, ISI uses the output buffer 0. */
isiBufIdx = 0U;
}
void ISI_IRQHandler(void)
{
{
/* Frame output completed, set the output buffer address. */
ISI_SetOutputBufferAddr(base, isiBufIdx, (uint32_t)(outputBufs[outputBufIdx]), 0U, 0U);
/* There are 2 ISI output buffers, so the output buffer index is 0 -> 1 -> 0 -> 1 -> ... */
isiBufIdx ^= 1;
/* Update the buffer memory block index. */
outputBufIdx++;
if (outputBufIdx >= MEM_BLK_CNT)
{
outputBufIdx = 0U;
}
}
}
void main(void)
{
ISI_Init(ISI_BASE);
ISI_Configure(ISI_BASE);
/* Enable the ISI interrupt in SOC level, NVIC and IRQSTEER. */
/* Enable the frame complete interrupt. */
/* Start working. */
ISI_Start(ISI_BASE);
while (1)
{
}
}

Output panic and overflow

ISI employs two 256-bytes ping pong buffers between ISI and output memory. There are three level overflow interrupt for the ping pong buffer:

  1. Ping pong buffer nearly full. The nearly full threshold is set by isi_threshold_t. The alert interrupt such as kISI_OverflowAlertYInterrupt occurs if the threshold is reached. When this kind of interrupt occurs, the application should request higher AXI write channel priority to make sure the ping pong buffer is read out in time.
  2. Ping buffer overflow less than 256 Bytes. In this case, the overflow interrupt such as kISI_OverflowYInterrupt occurs. The number of overflow bytes could be gotten by ISI_GetOverflowBytes. ISI can insert a blank pixel for each lost pixel.
  3. Ping buffer overflow more than 256 Bytes. This is monitored by excess overflow interrupt such as kISI_ExcessOverflowYInterrupt. In this case, application should reset the ISI.
void ISI_IRQHandler(void)
{
uint32_t interrupts = ISI_GetInterruptStatus(ISI_BASE);
ISI_ClearInterruptStatus(ISI_BASE, interrupts);
{
// Reset the ISI;
}
if (kISI_OverflowYInterrupt & interrupts)
{
uint8_t overflowBytes = ISI_GetOverflowBytes(ISI_BASE);
}
if (kISI_OverflowAlertYInterrupt & interrupts)
{
// Request higher AXI write channel priority;
}
}

Data Structures

struct  isi_config_t
 ISI basic configuration. More...
 
struct  isi_csc_config_t
 ISI color space conversion configurations. More...
 
struct  isi_crop_config_t
 ISI cropping configurations. More...
 
struct  isi_region_alpha_config_t
 ISI regional region alpha configurations. More...
 
struct  isi_input_mem_config_t
 ISI input memory configurations. More...
 

Enumerations

enum  _isi_interrupt {
  kISI_MemReadCompletedInterrupt = ISI_CHNL_IER_MEM_RD_DONE_EN_MASK,
  kISI_LineReceivedInterrupt = ISI_CHNL_IER_LINE_RCVD_EN_MASK,
  kISI_FrameReceivedInterrupt = ISI_CHNL_IER_FRM_RCVD_EN_MASK,
  kISI_AxiWriteErrorVInterrupt,
  kISI_AxiWriteErrorUInterrupt,
  kISI_AxiWriteErrorYInterrupt,
  kISI_AxiReadErrorInterrupt = ISI_CHNL_IER_AXI_RD_ERR_EN_MASK,
  kISI_OverflowAlertVInterrupt,
  kISI_ExcessOverflowVInterrupt,
  kISI_OverflowVInterrupt = ISI_CHNL_IER_OFLW_V_BUF_EN_MASK,
  kISI_OverflowAlertUInterrupt,
  kISI_ExcessOverflowUInterrupt,
  kISI_OverflowUInterrupt = ISI_CHNL_IER_OFLW_U_BUF_EN_MASK,
  kISI_OverflowAlertYInterrupt,
  kISI_ExcessOverflowYInterrupt,
  kISI_OverflowYInterrupt = ISI_CHNL_IER_OFLW_Y_BUF_EN_MASK
}
 ISI interrupts. More...
 
enum  isi_output_format_t {
  kISI_OutputRGBA8888 = 0U,
  kISI_OutputABGR8888 = 1U,
  kISI_OutputARGB8888 = 2U,
  kISI_OutputRGBX8888 = 3U,
  kISI_OutputXBGR8888 = 4U,
  kISI_OutputXRGB8888 = 5U,
  kISI_OutputRGB888 = 6U,
  kISI_OutputBGR888 = 7U,
  kISI_OutputA2BGR10 = 8U,
  kISI_OutputA2RGB10 = 9U,
  kISI_OutputRGB565 = 10U,
  kISI_OutputRaw8 = 11U,
  kISI_OutputRaw10 = 12U,
  kISI_OutputRaw10P = 13U,
  kISI_OutputRaw12P = 14U,
  kISI_OutputRaw16P = 15U,
  kISI_OutputYUV444_1P8P = 16U,
  kISI_OutputYUV444_2P8P = 17U,
  kISI_OutputYUV444_3P8P = 18U,
  kISI_OutputYUV444_1P8 = 19U,
  kISI_OutputYUV444_1P10 = 20U,
  kISI_OutputYUV444_2P10 = 21U,
  kISI_OutputYUV444_3P10 = 22U,
  kISI_OutputYUV444_1P10P = 24U,
  kISI_OutputYUV444_2P10P = 25U,
  kISI_OutputYUV444_3P10P = 26U,
  kISI_OutputYUV444_1P12 = 28U,
  kISI_OutputYUV444_2P12 = 29U,
  kISI_OutputYUV444_3P12 = 30U,
  kISI_OutputYUV422_1P8P = 32U,
  kISI_OutputYUV422_2P8P = 33U,
  kISI_OutputYUV422_3P8P = 34U,
  kISI_OutputYUV422_1P10 = 36U,
  kISI_OutputYUV422_2P10 = 37U,
  kISI_OutputYUV422_3P10 = 38U,
  kISI_OutputYUV422_1P10P = 40U,
  kISI_OutputYUV422_2P10P = 41U,
  kISI_OutputYUV422_3P10P = 42U,
  kISI_OutputYUV422_1P12 = 44U,
  kISI_OutputYUV422_2P12 = 45U,
  kISI_OutputYUV422_3P12 = 46U,
  kISI_OutputYUV420_2P8P = 49U,
  kISI_OutputYUV420_3P8P = 50U,
  kISI_OutputYUV420_2P10 = 53U,
  kISI_OutputYUV420_3P10 = 54U,
  kISI_OutputYUV420_2P10P = 57U,
  kISI_OutputYUV420_3P10P = 58U,
  kISI_OutputYUV420_2P12 = 61U,
  kISI_OutputYUV420_3P12 = 62U
}
 ISI output image format. More...
 
enum  isi_chain_mode_t {
  kISI_ChainDisable = 0U,
  kISI_ChainTwo = 1U
}
 ISI line buffer chain mode. More...
 
enum  isi_deint_mode_t {
  kISI_DeintDisable = 0U,
  kISI_DeintWeaveOddOnTop = 2U,
  kISI_DeintWeaveEvenOnTop = 3U,
  kISI_DeintBlendingOddFirst = 4U,
  kISI_DeintBlendingEvenFirst = 5U,
  kISI_DeintDoublingOdd = 6U,
  kISI_DeintDoublingEven = 7U
}
 ISI de-interlacing mode. More...
 
enum  isi_threshold_t {
  kISI_ThresholdDisable = 0U,
  kISI_Threshold25Percent = 1U,
  kISI_Threshold50Percent = 2U,
  kISI_Threshold75Percent = 3U
}
 ISI overflow panic alert threshold. More...
 
enum  isi_csc_mode_t {
  kISI_CscYUV2RGB,
  kISI_CscYCbCr2RGB,
  kISI_CscRGB2YUV,
  kISI_CscRGB2YCbCr
}
 ISI color space conversion mode. More...
 
enum  isi_flip_mode_t {
  kISI_FlipDisable = 0U,
  kISI_FlipHorizontal = ISI_CHNL_IMG_CTRL_HFLIP_EN_MASK,
  kISI_FlipVertical = ISI_CHNL_IMG_CTRL_VFLIP_EN_MASK,
  kISI_FlipBoth = ISI_CHNL_IMG_CTRL_VFLIP_EN_MASK | ISI_CHNL_IMG_CTRL_HFLIP_EN_MASK
}
 ISI flipping mode. More...
 
enum  isi_input_mem_format_t {
  kISI_InputMemBGR888 = 0U,
  kISI_InputMemRGB888 = 1U,
  kISI_InputMemXRGB8888 = 2U,
  kISI_InputMemRGBX8888 = 3U,
  kISI_InputMemXBGR8888 = 4U,
  kISI_InputMemRGB565 = 5U,
  kISI_InputMemA2BGR10 = 6U,
  kISI_InputMemA2RGB10 = 7U,
  kISI_InputMemYUV444_1P8P = 8U,
  kISI_InputMemYUV444_1P10 = 9U,
  kISI_InputMemYUV444_1P10P = 10U,
  kISI_InputMemYUV444_1P12 = 11U,
  kISI_InputMemYUV444_1P8 = 12U,
  kISI_InputMemYUV422_1P8P = 13U,
  kISI_InputMemYUV422_1P10 = 14U,
  kISI_InputMemYUV422_1P12 = 15U
}
 ISI image format of the input memory. More...
 

Functions

static uint8_t ISI_GetOverflowBytes (ISI_Type *base)
 Gets the number of valid pixel bytes lost due to overflow. More...
 
void ISI_SetConfig (ISI_Type *base, const isi_config_t *config)
 Set the ISI channel basic configurations. More...
 
void ISI_GetDefaultConfig (isi_config_t *config)
 Get the ISI channel default basic configurations. More...
 

Driver version

#define FSL_ISI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 ISI driver version. More...
 

ISI initialization and de-initialization

void ISI_Init (ISI_Type *base)
 Initializes the ISI peripheral. More...
 
void ISI_Deinit (ISI_Type *base)
 Deinitializes the ISI peripheral. More...
 
void ISI_Reset (ISI_Type *base)
 Reset the ISI peripheral. More...
 

ISI interrupts

static uint32_t ISI_EnableInterrupts (ISI_Type *base, uint32_t mask)
 Enables ISI interrupts. More...
 
static uint32_t ISI_DisableInterrupts (ISI_Type *base, uint32_t mask)
 Disables ISI interrupts. More...
 
static uint32_t ISI_GetInterruptStatus (ISI_Type *base)
 Get the ISI interrupt pending flags. More...
 
static void ISI_ClearInterruptStatus (ISI_Type *base, uint32_t mask)
 Clear ISI interrupt pending flags. More...
 

ISI scaler

void ISI_SetScalerConfig (ISI_Type *base, uint16_t inputWidth, uint16_t inputHeight, uint16_t outputWidth, uint16_t outputHeight)
 Set the ISI channel scaler configurations. More...
 

ISI color space conversion

void ISI_SetColorSpaceConversionConfig (ISI_Type *base, const isi_csc_config_t *config)
 Set the ISI color space conversion configurations. More...
 
void ISI_ColorSpaceConversionGetDefaultConfig (isi_csc_config_t *config)
 Get the ISI color space conversion default configurations. More...
 
static void ISI_EnableColorSpaceConversion (ISI_Type *base, bool enable)
 Enable or disable the ISI color space conversion. More...
 

ISI cropping

void ISI_SetCropConfig (ISI_Type *base, const isi_crop_config_t *config)
 Set the ISI cropping configurations. More...
 
void ISI_CropGetDefaultConfig (isi_crop_config_t *config)
 Get the ISI cropping default configurations. More...
 
static void ISI_EnableCrop (ISI_Type *base, bool enable)
 Enable or disable the ISI cropping. More...
 

ISI alpha

static void ISI_SetGlobalAlpha (ISI_Type *base, uint8_t alpha)
 Set the global alpha value. More...
 
static void ISI_EnableGlobalAlpha (ISI_Type *base, bool enable)
 Enable the global alpha insertion. More...
 
void ISI_SetRegionAlphaConfig (ISI_Type *base, uint8_t index, const isi_region_alpha_config_t *config)
 Set the alpha value for region of interest. More...
 
void ISI_RegionAlphaGetDefaultConfig (isi_region_alpha_config_t *config)
 Get the regional alpha insertion default configurations. More...
 
void ISI_EnableRegionAlpha (ISI_Type *base, uint8_t index, bool enable)
 Enable or disable the alpha value insertion for region of interest. More...
 

ISI input memory.

void ISI_SetInputMemConfig (ISI_Type *base, const isi_input_mem_config_t *config)
 Set the input memory configuration. More...
 
void ISI_InputMemGetDefaultConfig (isi_input_mem_config_t *config)
 Get the input memory default configurations. More...
 
static void ISI_SetInputMemAddr (ISI_Type *base, uint32_t addr)
 Set the input memory address. More...
 
void ISI_TriggerInputMemRead (ISI_Type *base)
 Trigger the ISI pipeline to read the input memory. More...
 

ISI misc control.

static void ISI_SetFlipMode (ISI_Type *base, isi_flip_mode_t mode)
 Set the ISI channel flipping mode. More...
 
void ISI_SetOutputBufferAddr (ISI_Type *base, uint8_t index, uint32_t addrY, uint32_t addrU, uint32_t addrV)
 Set the ISI output buffer address. More...
 
static void ISI_Start (ISI_Type *base)
 Start the ISI channel. More...
 
static void ISI_Stop (ISI_Type *base)
 Stop the ISI channel. More...
 

Data Structure Documentation

struct isi_config_t

Data Fields

bool isChannelBypassed
 Bypass the channel, if bypassed, the scaling and color space conversion could not work. More...
 
bool isSourceMemory
 Whether the input source is memory or not. More...
 
bool isYCbCr
 Whether the input source is YCbCr mode or not. More...
 
isi_chain_mode_t chainMode
 The line buffer chain mode. More...
 
isi_deint_mode_t deintMode
 The de-interlacing mode. More...
 
uint8_t blankPixel
 The pixel to insert into image when overflow occors. More...
 
uint8_t sourcePort
 Input source port selection. More...
 
uint8_t mipiChannel
 MIPI virtual channel, ignored if input source is not MIPI CSI. More...
 
uint16_t inputHeight
 Input image height(lines). More...
 
uint16_t inputWidth
 Input image width(pixels). More...
 
isi_output_format_t outputFormat
 Output image format. More...
 
isi_threshold_t thresholdY
 Panic alert threshold for RGB or Luma (Y) buffer. More...
 
isi_threshold_t thresholdU
 Panic alert threshold for Chroma (U/Cb/UV/CbCr) buffer. More...
 
isi_threshold_t thresholdV
 Panic alert threshold for Chroma (V/Cr) buffer. More...
 

Field Documentation

bool isi_config_t::isChannelBypassed
bool isi_config_t::isSourceMemory
bool isi_config_t::isYCbCr
isi_chain_mode_t isi_config_t::chainMode
isi_deint_mode_t isi_config_t::deintMode
uint8_t isi_config_t::blankPixel
uint8_t isi_config_t::sourcePort
uint8_t isi_config_t::mipiChannel
uint16_t isi_config_t::inputHeight
uint16_t isi_config_t::inputWidth
isi_output_format_t isi_config_t::outputFormat
isi_threshold_t isi_config_t::thresholdY
isi_threshold_t isi_config_t::thresholdU
isi_threshold_t isi_config_t::thresholdV
struct isi_csc_config_t

(a) RGB to YUV (or YCbCr) conversion

  • Y = (A1 x R) + (A2 x G) + (A3 x B) + D1
  • U = (B1 x R) + (B2 x G) + (B3 x B) + D2
  • V = (C1 x R) + (C2 x G) + (C3 x B) + D3

(b) YUV (or YCbCr) to RGB conversion

  • R = (A1 x (Y + D1)) + (A2 x (U + D2)) + (A3 x (V + D3))
  • G = (B1 x (Y + D1)) + (B2 x (U + D2)) + (B3 x (V + D3))
  • B = (C1 x (Y + D1)) + (C2 x (U + D2)) + (C3 x (V + D3))

Overflow for the three channels are saturated at 0x255 and underflow is saturated at 0x00.

Data Fields

isi_csc_mode_t mode
 Convertion mode. More...
 
float A1
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float A2
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float A3
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float B1
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float B2
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float B3
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float C1
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float C2
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
float C3
 Must be in the range of [-3.99609375, 3.99609375]. More...
 
int16_t D1
 Must be in the range of [-256, 255]. More...
 
int16_t D2
 Must be in the range of [-256, 255]. More...
 
int16_t D3
 Must be in the range of [-256, 255]. More...
 

Field Documentation

isi_csc_mode_t isi_csc_config_t::mode
float isi_csc_config_t::A1
float isi_csc_config_t::A2
float isi_csc_config_t::A3
float isi_csc_config_t::B1
float isi_csc_config_t::B2
float isi_csc_config_t::B3
float isi_csc_config_t::C1
float isi_csc_config_t::C2
float isi_csc_config_t::C3
int16_t isi_csc_config_t::D1
int16_t isi_csc_config_t::D2
int16_t isi_csc_config_t::D3
struct isi_crop_config_t

Data Fields

uint16_t upperLeftX
 X of upper left corner. More...
 
uint16_t upperLeftY
 Y of upper left corner. More...
 
uint16_t lowerRightX
 X of lower right corner. More...
 
uint16_t lowerRightY
 Y of lower right corner. More...
 

Field Documentation

uint16_t isi_crop_config_t::upperLeftX
uint16_t isi_crop_config_t::upperLeftY
uint16_t isi_crop_config_t::lowerRightX
uint16_t isi_crop_config_t::lowerRightY
struct isi_region_alpha_config_t

Data Fields

uint16_t upperLeftX
 X of upper left corner. More...
 
uint16_t upperLeftY
 Y of upper left corner. More...
 
uint16_t lowerRightX
 X of lower right corner. More...
 
uint16_t lowerRightY
 Y of lower right corner. More...
 
uint8_t alpha
 Alpha value. More...
 

Field Documentation

uint16_t isi_region_alpha_config_t::upperLeftX
uint16_t isi_region_alpha_config_t::upperLeftY
uint16_t isi_region_alpha_config_t::lowerRightX
uint16_t isi_region_alpha_config_t::lowerRightY
uint8_t isi_region_alpha_config_t::alpha
struct isi_input_mem_config_t

Data Fields

uint32_t adddr
 Address of the input memory. More...
 
uint16_t linePitchBytes
 Line phtch in bytes. More...
 
uint16_t framePitchBytes
 Frame phtch in bytes. More...
 
isi_input_mem_format_t format
 Image format of the input memory. More...
 

Field Documentation

uint32_t isi_input_mem_config_t::adddr
uint16_t isi_input_mem_config_t::linePitchBytes
uint16_t isi_input_mem_config_t::framePitchBytes
isi_input_mem_format_t isi_input_mem_config_t::format

Macro Definition Documentation

#define FSL_ISI_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))

Version 2.0.1.

Enumeration Type Documentation

Enumerator
kISI_MemReadCompletedInterrupt 

Input memory read completed.

kISI_LineReceivedInterrupt 

Line received.

kISI_FrameReceivedInterrupt 

Frame received.

kISI_AxiWriteErrorVInterrupt 

AXI Bus write error when storing V data to memory.

kISI_AxiWriteErrorUInterrupt 

AXI Bus write error when storing U data to memory.

kISI_AxiWriteErrorYInterrupt 

AXI Bus write error when storing Y data to memory.

kISI_AxiReadErrorInterrupt 

AXI Bus error when reading the input memory.

kISI_OverflowAlertVInterrupt 

V output buffer overflow threshold accrossed.

kISI_ExcessOverflowVInterrupt 

V output buffer excess overflow interrupt.

kISI_OverflowVInterrupt 

V output buffer overflow interrupt.

kISI_OverflowAlertUInterrupt 

U output buffer overflow threshold accrossed.

kISI_ExcessOverflowUInterrupt 

U output buffer excess overflow interrupt.

kISI_OverflowUInterrupt 

U output buffer overflow interrupt.

kISI_OverflowAlertYInterrupt 

V output buffer overflow threshold accrossed.

kISI_ExcessOverflowYInterrupt 

V output buffer excess overflow interrupt.

kISI_OverflowYInterrupt 

V output buffer overflow interrupt.

Enumerator
kISI_OutputRGBA8888 

RGBA8888.

kISI_OutputABGR8888 

ABGR8888.

kISI_OutputARGB8888 

ARGB8888.

kISI_OutputRGBX8888 

RGBX8888 unpacked and MSB aligned in 32-bit.

kISI_OutputXBGR8888 

XBGR8888 unpacked and LSB aligned in 32-bit.

kISI_OutputXRGB8888 

XRGB8888 unpacked and LSB aligned in 32-bit.

kISI_OutputRGB888 

RGB888 packed into 32-bit.

kISI_OutputBGR888 

BGR888 packed into 32-bit.

kISI_OutputA2BGR10 

BGR format with 2-bits alpha in MSB; 10-bits per color component.

kISI_OutputA2RGB10 

RGB format with 2-bits alpha in MSB; 10-bits per color component.

kISI_OutputRGB565 

RGB565 packed into 32-bit.

kISI_OutputRaw8 

8-bit raw data packed into 32-bit.

kISI_OutputRaw10 

10-bit raw data packed into 16-bit with 6 LSBs wasted.

kISI_OutputRaw10P 

10-bit raw data packed into 32-bit.

kISI_OutputRaw12P 

16-bit raw data packed into 16-bit with 4 LSBs wasted.

kISI_OutputRaw16P 

16-bit raw data packed into 32-bit.

kISI_OutputYUV444_1P8P 

8-bits per color component; 1-plane, YUV interleaved packed bytes.

kISI_OutputYUV444_2P8P 

8-bits per color component; 2-plane, UV interleaved packed bytes.

kISI_OutputYUV444_3P8P 

8-bits per color component; 3-plane, non-interleaved packed bytes.

kISI_OutputYUV444_1P8 

8-bits per color component; 1-plane YUV interleaved unpacked bytes (8 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV444_1P10 

10-bits per color component; 1-plane, YUV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV444_2P10 

10-bits per color component; 2-plane, UV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV444_3P10 

10-bits per color component; 3-plane, non-interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV444_1P10P 

10-bits per color component; 1-plane, YUV interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV444_2P10P 

10-bits per color component; 2-plane, UV interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV444_3P10P 

10-bits per color component; 3-plane, non-interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV444_1P12 

12-bits per color component; 1-plane, YUV interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV444_2P12 

12-bits per color component; 2-plane, UV interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV444_3P12 

12-bits per color component; 3-plane, non-interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV422_1P8P 

8-bits per color component; 1-plane, YUV interleaved packed bytes.

kISI_OutputYUV422_2P8P 

8-bits per color component; 2-plane, UV interleaved packed bytes.

kISI_OutputYUV422_3P8P 

8-bits per color component; 3-plane, non-interleaved packed bytes.

kISI_OutputYUV422_1P10 

10-bits per color component; 1-plane, YUV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV422_2P10 

10-bits per color component; 2-plane, UV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV422_3P10 

10-bits per color component; 3-plane, non-interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV422_1P10P 

10-bits per color component; 1-plane, YUV interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV422_2P10P 

10-bits per color component; 2-plane, UV interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV422_3P10P 

10-bits per color component; 3-plane, non-interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV422_1P12 

12-bits per color component; 1-plane, YUV interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV422_2P12 

12-bits per color component; 2-plane, UV interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV422_3P12 

12-bits per color component; 3-plane, non-interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV420_2P8P 

8-bits per color component; 2-plane, UV interleaved packed bytes.

kISI_OutputYUV420_3P8P 

8-bits per color component; 3-plane, non-interleaved packed bytes.

kISI_OutputYUV420_2P10 

10-bits per color component; 2-plane, UV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV420_3P10 

10-bits per color component; 3-plane, non-interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV420_2P10P 

10-bits per color component; 2-plane, UV interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV420_3P10P 

10-bits per color component; 3-plane, non-interleaved packed bytes (2 MSBs waste bits in 32-bit DWORD).

kISI_OutputYUV420_2P12 

12-bits per color component; 2-plane, UV interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_OutputYUV420_3P12 

12-bits per color component; 3-plane, non-interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

Enumerator
kISI_ChainDisable 

No line buffers chained, for 2048 or less horizontal resolution.

kISI_ChainTwo 

Line buffers of channel n and n+1 chained, for 4096 horizontal resolution.

Enumerator
kISI_DeintDisable 

No de-interlacing.

kISI_DeintWeaveOddOnTop 

Weave de-interlacing (Odd, Even) method used.

kISI_DeintWeaveEvenOnTop 

Weave de-interlacing (Even, Odd) method used.

kISI_DeintBlendingOddFirst 

Blending or linear interpolation (Odd + Even).

kISI_DeintBlendingEvenFirst 

Blending or linear interpolation (Even + Odd).

kISI_DeintDoublingOdd 

Doubling odd frame and discard even frame.

kISI_DeintDoublingEven 

Doubling even frame and discard odd frame.

Enumerator
kISI_ThresholdDisable 

No panic alert will be asserted.

kISI_Threshold25Percent 

Panic will assert when the buffers are 25% full.

kISI_Threshold50Percent 

Panic will assert when the buffers are 50% full.

kISI_Threshold75Percent 

Panic will assert when the buffers are 75% full.

Enumerator
kISI_CscYUV2RGB 

Convert YUV to RGB.

kISI_CscYCbCr2RGB 

Convert YCbCr to RGB.

kISI_CscRGB2YUV 

Convert RGB to YUV.

kISI_CscRGB2YCbCr 

Convert RGB to YCbCr.

Enumerator
kISI_FlipDisable 

Flip disabled.

kISI_FlipHorizontal 

Horizontal flip.

kISI_FlipVertical 

Vertical flip.

kISI_FlipBoth 

Flip both direction.

Enumerator
kISI_InputMemBGR888 

BGR format with 8-bits per color component, packed into 32-bit, 24 bits per pixel.

kISI_InputMemRGB888 

RGB format with 8-bits per color component, packed into 32-bit, 24 bits per pixel.

kISI_InputMemXRGB8888 

RGB format with 8-bits per color component, unpacked and LSB aligned in 32-bit, 32 bits per pixel.

kISI_InputMemRGBX8888 

RGB format with 8-bits per color component, unpacked and MSB alinged in 32-bit, 32 bits per pixel.

kISI_InputMemXBGR8888 

BGR format with 8-bits per color component, unpacked and LSB aligned in 32-bit, 32 bits per pixel.

kISI_InputMemRGB565 

RGB format with 5-bits of R, B; 6-bits of G (packed into 32-bit)

kISI_InputMemA2BGR10 

BGR format with 2-bits alpha in MSB; 10-bits per color component.

kISI_InputMemA2RGB10 

RGB format with 2-bits alpha in MSB; 10-bits per color component.

kISI_InputMemYUV444_1P8P 

8-bits per color component; 1-plane, YUV interleaved packed bytes.

kISI_InputMemYUV444_1P10 

10-bits per color component; 1-plane, YUV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_InputMemYUV444_1P10P 

10-bits per color component; 1-plane, YUV interleaved packed bytes (2 MSBs waste bits in 32-bit WORD).

kISI_InputMemYUV444_1P12 

12-bits per color component; 1-plane, YUV interleaved unpacked bytes (4 LSBs waste bits in 16-bit WORD).

kISI_InputMemYUV444_1P8 

8-bits per color component; 1-plane YUV interleaved unpacked bytes (8 MSBs waste bits in 32-bit DWORD).

kISI_InputMemYUV422_1P8P 

8-bits per color component; 1-plane YUV interleaved packed bytes.

kISI_InputMemYUV422_1P10 

10-bits per color component; 1-plane, YUV interleaved unpacked bytes (6 LSBs waste bits in 16-bit WORD).

kISI_InputMemYUV422_1P12 

12-bits per color component; 1-plane, YUV interleaved packed bytes (4 MSBs waste bits in 16-bit WORD).

Function Documentation

void ISI_Init ( ISI_Type *  base)

This function ungates the ISI clock, it should be called before any other ISI functions.

Parameters
baseISI peripheral base address.
void ISI_Deinit ( ISI_Type *  base)

This function gates the ISI clock.

Parameters
baseISI peripheral base address.
void ISI_Reset ( ISI_Type *  base)

This function resets the ISI channel processing pipeline similar to a hardware reset. The channel will need to be reconfigured after reset before it can be used.

Parameters
baseISI peripheral base address.
static uint32_t ISI_EnableInterrupts ( ISI_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseISI peripheral base address
maskInterrupt source, OR'ed value of _isi_interrupt.
Returns
OR'ed value of the enabled interrupts before calling this function.
static uint32_t ISI_DisableInterrupts ( ISI_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseISI peripheral base address
maskInterrupt source, OR'ed value of _isi_interrupt.
Returns
OR'ed value of the enabled interrupts before calling this function.
static uint32_t ISI_GetInterruptStatus ( ISI_Type *  base)
inlinestatic

All interrupt pending flags are returned, upper layer could compare with the OR'ed value of _isi_interrupt. For example, to check whether memory read completed, use like this:

uint32_t mask = ISI_GetInterruptStatus(ISI);
{
// memory read completed
}
Parameters
baseISI peripheral base address
Returns
The OR'ed value of the pending interrupt flags. of _isi_interrupt.
static void ISI_ClearInterruptStatus ( ISI_Type *  base,
uint32_t  mask 
)
inlinestatic

This function could clear one or more flags at one time, the flags to clear are passed in as an OR'ed value of _isi_interrupt. For example, to clear both line received interrupt flag and frame received flag, use like this:

Parameters
baseISI peripheral base address
maskThe flags to clear, it is OR'ed value of _isi_interrupt.
static uint8_t ISI_GetOverflowBytes ( ISI_Type *  base)
inlinestatic

If multiple output buffers overflow, then this function only returns the status of the buffer with highest priority. The buffer priority is: Y output buffer > U output buffer > V output buffer.

Parameters
baseISI peripheral base address
Returns
The number of valid pixel bytes lost due to overflow.
void ISI_SetConfig ( ISI_Type *  base,
const isi_config_t config 
)

This function sets the basic configurations, generally the channel could be started to work after this function. To enable other features such as croping, flipping, please call the functions accordingly.

Parameters
baseISI peripheral base address
configPointer to the configuration structure.
void ISI_GetDefaultConfig ( isi_config_t config)

The default value is:

config->isChannelBypassed = false;
config->isSourceMemory = false;
config->isYCbCr = false;
config->chainMode = kISI_ChainDisable;
config->deintMode = kISI_DeintDisable;
config->blankPixel = 0xFFU;
config->sourcePort = 0U;
config->mipiChannel = 0U;
config->inputHeight = 1080U;
config->inputWidth = 1920U;
config->outputFormat = kISI_OutputRGBA8888;
config->outputLinePitchBytes = 0U;
config->thresholdY = kISI_ThresholdDisable;
config->thresholdU = kISI_ThresholdDisable;
config->thresholdV = kISI_ThresholdDisable;
Parameters
configPointer to the configuration structure.
void ISI_SetScalerConfig ( ISI_Type *  base,
uint16_t  inputWidth,
uint16_t  inputHeight,
uint16_t  outputWidth,
uint16_t  outputHeight 
)

This function sets the scaling configurations. If the ISI channel is bypassed, then the scaling feature could not be used.

ISI only supports down scaling but not up scaling.

Parameters
baseISI peripheral base address
inputWidthInput image width.
inputHeightInput image height.
outputWidthOutput image width.
outputHeightOutput image height.
Note
Total bytes in one line after down scaling must be more than 256 bytes.
void ISI_SetColorSpaceConversionConfig ( ISI_Type *  base,
const isi_csc_config_t config 
)

This function sets the color space conversion configurations. After setting the configuration, use the function ISI_EnableColorSpaceConversion to enable this feature. If the ISI channel is bypassed, then the color space conversion feature could not be used.

Parameters
baseISI peripheral base address
configPointer to the configuration structure.
void ISI_ColorSpaceConversionGetDefaultConfig ( isi_csc_config_t config)

The default value is:

config->mode = kISI_CscYUV2RGB;
config->A1 = 0.0;
config->A2 = 0.0;
config->A3 = 0.0;
config->B1 = 0.0;
config->B2 = 0.0;
config->B3 = 0.0;
config->C1 = 0.0;
config->C2 = 0.0;
config->C3 = 0.0;
config->D1 = 0;
config->D2 = 0;
config->D3 = 0;
Parameters
configPointer to the configuration structure.
static void ISI_EnableColorSpaceConversion ( ISI_Type *  base,
bool  enable 
)
inlinestatic

If the ISI channel is bypassed, then the color space conversion feature could not be used even enable using this function.

Parameters
baseISI peripheral base address
enableTrue to enable, false to disable.
Note
The CSC is enabled by default. Disable it if it is not required.
void ISI_SetCropConfig ( ISI_Type *  base,
const isi_crop_config_t config 
)

This function sets the cropping configurations. After setting the configuration, use the function ISI_EnableCrop to enable the feature. Cropping still works when the ISI channel is bypassed.

Parameters
baseISI peripheral base address
configPointer to the configuration structure.
Note
The upper left corner and lower right corner should be configured base on the image resolution output from the scaler.
void ISI_CropGetDefaultConfig ( isi_crop_config_t config)

The default value is:

config->upperLeftX = 0U;
config->upperLeftY = 0U;
config->lowerRightX = 0U;
config->lowerRightY = 0U;
Parameters
configPointer to the configuration structure.
static void ISI_EnableCrop ( ISI_Type *  base,
bool  enable 
)
inlinestatic

If the ISI channel is bypassed, the cropping still works.

Parameters
baseISI peripheral base address
enableTrue to enable, false to disable.
static void ISI_SetGlobalAlpha ( ISI_Type *  base,
uint8_t  alpha 
)
inlinestatic
Parameters
baseISI peripheral base address
alphaThe global alpha value.
static void ISI_EnableGlobalAlpha ( ISI_Type *  base,
bool  enable 
)
inlinestatic

Alpha still works when channel bypassed.

Parameters
baseISI peripheral base address
enableTrue to enable, false to disable.
void ISI_SetRegionAlphaConfig ( ISI_Type *  base,
uint8_t  index,
const isi_region_alpha_config_t config 
)

Set the alpha insertion configuration for specific region of interest. The function ISI_EnableRegionAlpha could be used to enable the alpha insertion. Alpha insertion still works when channel bypassed.

Parameters
baseISI peripheral base address
indexIndex of the region of interest, Could be 0, 1, 2, and 3.
configPointer to the configuration structure.
Note
The upper left corner and lower right corner should be configured base on the image resolution output from the scaler.
void ISI_RegionAlphaGetDefaultConfig ( isi_region_alpha_config_t config)

The default configuration is:

config->upperLeftX = 0U;
config->upperLeftY = 0U;
config->lowerRightX = 0U;
config->lowerRightY = 0U;
config->alpha = 0U;
Parameters
configPointer to the configuration structure.
void ISI_EnableRegionAlpha ( ISI_Type *  base,
uint8_t  index,
bool  enable 
)

Alpha insertion still works when channel bypassed.

Parameters
baseISI peripheral base address
indexIndex of the region of interest, Could be 0, 1, 2, and 3.
enableTrue to enable, false to disable.
void ISI_SetInputMemConfig ( ISI_Type *  base,
const isi_input_mem_config_t config 
)
Parameters
baseISI peripheral base address
configPointer to the configuration structure.
void ISI_InputMemGetDefaultConfig ( isi_input_mem_config_t config)

The default configuration is:

config->adddr = 0U;
config->linePitchBytes = 0U;
config->framePitchBytes = 0U;
config->format = kISI_InputMemBGR8P;
Parameters
configPointer to the configuration structure.
static void ISI_SetInputMemAddr ( ISI_Type *  base,
uint32_t  addr 
)
inlinestatic

This function only sets the input memory address, it is used for fast run-time setting.

Parameters
baseISI peripheral base address
addrInput memory address.
void ISI_TriggerInputMemRead ( ISI_Type *  base)
Parameters
baseISI peripheral base address
static void ISI_SetFlipMode ( ISI_Type *  base,
isi_flip_mode_t  mode 
)
inlinestatic
Parameters
baseISI peripheral base address
modeFlipping mode.
void ISI_SetOutputBufferAddr ( ISI_Type *  base,
uint8_t  index,
uint32_t  addrY,
uint32_t  addrU,
uint32_t  addrV 
)

This function sets the output buffer address and trigger the ISI to shadow the address, it is used for fast run-time setting.

Parameters
baseISI peripheral base address
indexIndex of output buffer, could be 0 and 1.
addrYRGB or Luma (Y) output buffer address.
addrUChroma (U/Cb/UV/CbCr) output buffer address.
addrVChroma (V/Cr) output buffer address.
static void ISI_Start ( ISI_Type *  base)
inlinestatic

Start the ISI channel to work, this function should be called after all channel configuration finished.

Parameters
baseISI peripheral base address
static void ISI_Stop ( ISI_Type *  base)
inlinestatic
Parameters
baseISI peripheral base address