MCUXpresso SDK API Reference Manual
Rev. 1
NXP Semiconductors
|
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.
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.
ISI employs two 256-bytes ping pong buffers between ISI and output memory. There are three level overflow interrupt for the ping pong buffer:
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... | |
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... | |
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... | |
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
(b) YUV (or YCbCr) to RGB conversion
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... | |
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... | |
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... | |
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... | |
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 |
#define FSL_ISI_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) |
Version 2.0.1.
enum _isi_interrupt |
enum isi_output_format_t |
enum isi_chain_mode_t |
enum isi_deint_mode_t |
enum isi_threshold_t |
enum isi_csc_mode_t |
enum isi_flip_mode_t |
void ISI_Init | ( | ISI_Type * | base | ) |
This function ungates the ISI clock, it should be called before any other ISI functions.
base | ISI peripheral base address. |
void ISI_Deinit | ( | ISI_Type * | base | ) |
This function gates the ISI clock.
base | ISI 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.
base | ISI peripheral base address. |
|
inlinestatic |
base | ISI peripheral base address |
mask | Interrupt source, OR'ed value of _isi_interrupt. |
|
inlinestatic |
base | ISI peripheral base address |
mask | Interrupt source, OR'ed value of _isi_interrupt. |
|
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:
base | ISI peripheral base address |
|
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:
base | ISI peripheral base address |
mask | The flags to clear, it is OR'ed value of _isi_interrupt. |
|
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.
base | ISI peripheral base address |
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.
base | ISI peripheral base address |
config | Pointer to the configuration structure. |
void ISI_GetDefaultConfig | ( | isi_config_t * | config | ) |
The default value is:
config | Pointer 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.
base | ISI peripheral base address |
inputWidth | Input image width. |
inputHeight | Input image height. |
outputWidth | Output image width. |
outputHeight | Output image height. |
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.
base | ISI peripheral base address |
config | Pointer to the configuration structure. |
void ISI_ColorSpaceConversionGetDefaultConfig | ( | isi_csc_config_t * | config | ) |
The default value is:
config | Pointer to the configuration structure. |
|
inlinestatic |
If the ISI channel is bypassed, then the color space conversion feature could not be used even enable using this function.
base | ISI peripheral base address |
enable | True to enable, false to disable. |
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.
base | ISI peripheral base address |
config | Pointer to the configuration structure. |
void ISI_CropGetDefaultConfig | ( | isi_crop_config_t * | config | ) |
The default value is:
config | Pointer to the configuration structure. |
|
inlinestatic |
If the ISI channel is bypassed, the cropping still works.
base | ISI peripheral base address |
enable | True to enable, false to disable. |
|
inlinestatic |
base | ISI peripheral base address |
alpha | The global alpha value. |
|
inlinestatic |
Alpha still works when channel bypassed.
base | ISI peripheral base address |
enable | True 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.
base | ISI peripheral base address |
index | Index of the region of interest, Could be 0, 1, 2, and 3. |
config | Pointer to the configuration structure. |
void ISI_RegionAlphaGetDefaultConfig | ( | isi_region_alpha_config_t * | config | ) |
The default configuration is:
config | Pointer to the configuration structure. |
void ISI_EnableRegionAlpha | ( | ISI_Type * | base, |
uint8_t | index, | ||
bool | enable | ||
) |
Alpha insertion still works when channel bypassed.
base | ISI peripheral base address |
index | Index of the region of interest, Could be 0, 1, 2, and 3. |
enable | True to enable, false to disable. |
void ISI_SetInputMemConfig | ( | ISI_Type * | base, |
const isi_input_mem_config_t * | config | ||
) |
base | ISI peripheral base address |
config | Pointer to the configuration structure. |
void ISI_InputMemGetDefaultConfig | ( | isi_input_mem_config_t * | config | ) |
The default configuration is:
config | Pointer to the configuration structure. |
|
inlinestatic |
This function only sets the input memory address, it is used for fast run-time setting.
base | ISI peripheral base address |
addr | Input memory address. |
void ISI_TriggerInputMemRead | ( | ISI_Type * | base | ) |
base | ISI peripheral base address |
|
inlinestatic |
base | ISI peripheral base address |
mode | Flipping 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.
base | ISI peripheral base address |
index | Index of output buffer, could be 0 and 1. |
addrY | RGB or Luma (Y) output buffer address. |
addrU | Chroma (U/Cb/UV/CbCr) output buffer address. |
addrV | Chroma (V/Cr) output buffer address. |
|
inlinestatic |
Start the ISI channel to work, this function should be called after all channel configuration finished.
base | ISI peripheral base address |
|
inlinestatic |
base | ISI peripheral base address |