This driver for Atmel® | SMART ARM®-based SAM Image Sensor Interface (ISI) connects a CMOS-type image sensor to the processor and provides image capture in various formats.
Devices from the following series can use this module:
Data Structures | |
struct | isi_config_t |
ISI configuration structure. More... | |
struct | isi_frame_buffer_descriptors |
Frame buffer descriptors. More... | |
struct | isi_R2Y |
ISI Matrix Color Space Conversion RGB to YCrCb. More... | |
struct | isi_Y2R |
ISI Matrix Color Space Conversion YCrCb to RGB. More... | |
Enumerations | |
enum | isi_input_image_format { ISI_INPUT_YUV = 0, ISI_INPUT_RGB565 = 1, ISI_INPUT_RGB888 = 2, ISI_INPUT_GS_12BIT = 3, ISI_INPUT_GS_8BIT = 4 } |
Enum for the possible image format for the ISI module. More... | |
Functions | |
static void | isi_capture (Isi *p_isi) |
Enable the codec datapath and capture a full resolution frame. More... | |
static void | isi_disable (Isi *p_isi) |
Disable ISI. More... | |
static void | isi_disable_interrupt (Isi *p_isi, uint32_t flag) |
Disable ISI interrupt. More... | |
static void | isi_dma_channel_disable (Isi *p_isi, uint32_t channel) |
Disable ISI Dma channel. More... | |
static void | isi_dma_channel_enable (Isi *p_isi, uint32_t channel) |
Enable ISI Dma channel. More... | |
static void | isi_enable (Isi *p_isi) |
Enable ISI. More... | |
static void | isi_enable_interrupt (Isi *p_isi, uint32_t flag) |
Enable ISI interrupt. More... | |
static uint32_t | isi_get_status (Isi *p_isi) |
Return ISI status register. More... | |
static uint32_t | isi_get_writeprotect_status (Isi *p_isi) |
Indicate write protect status. More... | |
void | isi_gs_configue (Isi *p_isi, uint8_t mode) |
Input image is assumed to be grayscale-coded. More... | |
void | isi_init (Isi *p_isi, struct isi_config_t *isi_cfg) |
Initialize the ISI module. More... | |
static void | isi_reset (Isi *p_isi) |
Reset ISI. More... | |
void | isi_rgb_configue (Isi *p_isi, uint8_t patten, uint8_t swap) |
Configue RGB swap mode and RGB pattern when RGB_MODE is set to 1. More... | |
void | isi_set_dma_codec_path (Isi *p_isi, uint8_t full_mode, uint8_t discr, uint32_t base_buf_desc, uint32_t dma_ctrl, uint32_t frame_buf_start_addr) |
Configure DMA for codec path. More... | |
void | isi_set_dma_preview_path (Isi *p_isi, uint8_t frate, uint32_t base_buf_desc, uint32_t dma_ctrl, uint32_t frame_buf_start_addr) |
Configure DMA for preview path. More... | |
void | isi_set_matrix_rgb2yuv (Isi *p_isi, isi_R2Y *rgb2yuv) |
ISI set matrix for RGB to YUV color space for codec path. More... | |
void | isi_set_matrix_yuv2rgb (Isi *p_isi, isi_Y2R *yuv2rgb) |
ISI set matrix for YUV to RGB color space for preview path. More... | |
static void | isi_set_writeprotect (Isi *p_isi, const bool is_enable) |
Enable or disable write protection of ADC registers. More... | |
void | isi_size_configure (Isi *p_isi, uint32_t image_hsize, uint32_t image_vsize, uint32_t preview_hsize, uint32_t preview_vsize) |
Set image and preview size, then calculate scaler factor automatically. More... | |
void | isi_yuv_configue (Isi *p_isi, uint8_t swap) |
Defines YCrCb swap format. More... | |
Variables | |
uint8_t | isi_R2Y::Boff |
Color Space Conversion Blue Component Offset. More... | |
uint8_t | isi_Y2R::C0 |
Color Space Conversion Matrix Coefficient C0. More... | |
uint8_t | isi_R2Y::C0 |
Color Space Conversion Matrix Coefficient C0. More... | |
uint8_t | isi_Y2R::C1 |
Color Space Conversion Matrix Coefficient C1. More... | |
uint8_t | isi_R2Y::C1 |
Color Space Conversion Matrix Coefficient C1. More... | |
uint8_t | isi_Y2R::C2 |
Color Space Conversion Matrix Coefficient C2. More... | |
uint8_t | isi_R2Y::C2 |
Color Space Conversion Matrix Coefficient C2. More... | |
uint8_t | isi_Y2R::C3 |
Color Space Conversion Matrix Coefficient C3. More... | |
uint8_t | isi_R2Y::C3 |
Color Space Conversion Matrix Coefficient C3. More... | |
uint16_t | isi_Y2R::C4 |
Color Space Conversion Matrix Coefficient C4. More... | |
uint8_t | isi_R2Y::C4 |
Color Space Conversion Matrix Coefficient C4. More... | |
uint8_t | isi_R2Y::C5 |
Color Space Conversion Matrix Coefficient C5. More... | |
uint8_t | isi_R2Y::C6 |
Color Space Conversion Matrix Coefficient C6. More... | |
uint8_t | isi_R2Y::C7 |
Color Space Conversion Matrix Coefficient C7. More... | |
uint8_t | isi_R2Y::C8 |
Color Space Conversion Matrix Coefficient C8. More... | |
uint8_t | isi_Y2R::Cboff |
Color Space Conversion Blue Chrominance Default Offset. More... | |
uint32_t | isi_frame_buffer_descriptors::control |
Address of the Control. More... | |
uint8_t | isi_config_t::crc_sync |
Embedded Synchronization Correction. More... | |
uint8_t | isi_Y2R::Croff |
Color Space Conversion Red Chrominance Default Offset. More... | |
uint32_t | isi_frame_buffer_descriptors::current |
Address of the Current FrameBuffer. More... | |
uint8_t | isi_config_t::emb_sync |
Embedded Synchronization. More... | |
uint8_t | isi_R2Y::Goff |
Color Space Conversion Green Component Offset. More... | |
uint8_t | isi_config_t::hpol |
Horizontal Synchronization Polarity. More... | |
enum isi_input_image_format | isi_config_t::image_fmt |
Input image format. More... | |
uint32_t | isi_config_t::image_hsize |
Input image horizontal size. More... | |
uint32_t | isi_config_t::image_vsize |
Input image vertical size. More... | |
uint32_t | isi_frame_buffer_descriptors::next |
Address of the Next FrameBuffer. More... | |
uint8_t | isi_config_t::pck_plo |
Pixel Clock Polarity. More... | |
uint8_t | isi_R2Y::Roff |
Color Space Conversion Red Component Offset. More... | |
uint8_t | isi_config_t::sfd |
Start of Frame Delay. More... | |
uint8_t | isi_config_t::sld |
Start of Line Delay. More... | |
uint8_t | isi_config_t::thmask |
Threshold Mask. More... | |
uint8_t | isi_config_t::vpol |
Vertical Synchronization Polarity. More... | |
uint8_t | isi_Y2R::Yoff |
Color Space Conversion Luminance Default Offset. More... | |
|
inlinestatic |
Enable the codec datapath and capture a full resolution frame.
p_isi | Pointer to a ISI instance. |
|
inlinestatic |
Disable ISI.
p_isi | Pointer to a ISI instance. |
|
inlinestatic |
Disable ISI interrupt.
p_isi | Pointer to a ISI instance. |
flag | of interrupt to disable |
References flag.
|
inlinestatic |
Disable ISI Dma channel.
p_isi | Pointer to a ISI instance. |
channel | to be disabled |
|
inlinestatic |
Enable ISI Dma channel.
p_isi | Pointer to a ISI instance. |
channel | to be enabled |
|
inlinestatic |
Enable ISI.
p_isi | Pointer to a ISI instance. |
|
inlinestatic |
Enable ISI interrupt.
p_isi | Pointer to a ISI instance. |
flag | of interrupt to enable |
References flag.
|
inlinestatic |
Return ISI status register.
p_isi | Pointer to a ISI instance. |
|
inlinestatic |
Indicate write protect status.
p_isi | Pointer to a ISI instance. |
void isi_gs_configue | ( | Isi * | p_isi, |
uint8_t | mode | ||
) |
Input image is assumed to be grayscale-coded.
p_isi | Pointer to a ISI instance. |
mode | 0: 2 pixels per word, 1: 1 pixel per word. |
References _isi_get_CFG2_workaround().
void isi_init | ( | Isi * | p_isi, |
struct isi_config_t * | isi_cfg | ||
) |
Initialize the ISI module.
p_isi | Pointer to a ISI instance. |
isi_cfg | Configuration for the ISI |
References _isi_get_CFG2_workaround(), isi_config_t::crc_sync, isi_config_t::emb_sync, isi_config_t::hpol, isi_config_t::image_fmt, isi_config_t::image_hsize, isi_config_t::image_vsize, ISI_INPUT_GS_12BIT, ISI_INPUT_GS_8BIT, ISI_INPUT_RGB565, ISI_INPUT_RGB888, ISI_INPUT_YUV, isi_config_t::pck_plo, isi_config_t::sfd, isi_config_t::sld, isi_config_t::thmask, and isi_config_t::vpol.
|
inlinestatic |
Reset ISI.
p_isi | Pointer to a ISI instance. |
void isi_rgb_configue | ( | Isi * | p_isi, |
uint8_t | patten, | ||
uint8_t | swap | ||
) |
Configue RGB swap mode and RGB pattern when RGB_MODE is set to 1.
p_isi | Pointer to a ISI instance. |
patten | RGB pattern |
swap | 0: D7-R7, 1: D0-R7 |
References _isi_get_CFG2_workaround().
void isi_set_dma_codec_path | ( | Isi * | p_isi, |
uint8_t | full_mode, | ||
uint8_t | discr, | ||
uint32_t | base_buf_desc, | ||
uint32_t | dma_ctrl, | ||
uint32_t | frame_buf_start_addr | ||
) |
Configure DMA for codec path.
p_isi | Pointer to a ISI instance. |
full_mode | Full mode is allowed. |
discr | Disable codec request. |
base_buf_desc | Codec descriptor address. |
dma_ctrl | DMA codec Control. |
frame_buf_start_addr | DMA codec base address. |
void isi_set_dma_preview_path | ( | Isi * | p_isi, |
uint8_t | frate, | ||
uint32_t | base_buf_desc, | ||
uint32_t | dma_ctrl, | ||
uint32_t | frame_buf_start_addr | ||
) |
Configure DMA for preview path.
p_isi | Pointer to a ISI instance. |
frate | frame rate capture |
base_buf_desc | Preview descriptor address. |
dma_ctrl | DMA preview control. |
frame_buf_start_addr | DMA preview base address. |
void isi_set_matrix_rgb2yuv | ( | Isi * | p_isi, |
isi_R2Y * | rgb2yuv | ||
) |
ISI set matrix for RGB to YUV color space for codec path.
p_isi | Pointer to a ISI instance. |
rgb2yuv | structure of RGB to YUV parameters. |
References isi_R2Y::Boff, isi_R2Y::C0, isi_R2Y::C1, isi_R2Y::C2, isi_R2Y::C3, isi_R2Y::C4, isi_R2Y::C5, isi_R2Y::C6, isi_R2Y::C7, isi_R2Y::C8, isi_R2Y::Goff, and isi_R2Y::Roff.
void isi_set_matrix_yuv2rgb | ( | Isi * | p_isi, |
isi_Y2R * | yuv2rgb | ||
) |
ISI set matrix for YUV to RGB color space for preview path.
p_isi | Pointer to a ISI instance. |
yuv2rgb | structure of YUV to RBG parameters. |
References isi_Y2R::C0, isi_Y2R::C1, isi_Y2R::C2, isi_Y2R::C3, isi_Y2R::C4, isi_Y2R::Cboff, isi_Y2R::Croff, and isi_Y2R::Yoff.
|
inlinestatic |
Enable or disable write protection of ADC registers.
p_isi | Pointer to a ISI instance. |
is_enable | 1 to enable, 0 to disable. |
void isi_size_configure | ( | Isi * | p_isi, |
uint32_t | image_hsize, | ||
uint32_t | image_vsize, | ||
uint32_t | preview_hsize, | ||
uint32_t | preview_vsize | ||
) |
Set image and preview size, then calculate scaler factor automatically.
p_isi | Pointer to a ISI instance. |
image_hsize | Horizontal image input size (range 1~2048). |
image_vsize | Vertical image input size (range 1~2048). |
preview_hsize | Horizontal Preview size (640 max only in RGB mode). |
preview_vsize | Vertical Preview size (480 max only in RGB mode). |
References _isi_get_CFG2_workaround().
void isi_yuv_configue | ( | Isi * | p_isi, |
uint8_t | swap | ||
) |
Defines YCrCb swap format.
p_isi | Pointer to a ISI instance. |
swap | YUV Swap format |
References _isi_get_CFG2_workaround().
uint8_t isi_R2Y::Boff |
Color Space Conversion Blue Component Offset.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_Y2R::C0 |
Color Space Conversion Matrix Coefficient C0.
Referenced by isi_set_matrix_yuv2rgb().
uint8_t isi_R2Y::C0 |
Color Space Conversion Matrix Coefficient C0.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_Y2R::C1 |
Color Space Conversion Matrix Coefficient C1.
Referenced by isi_set_matrix_yuv2rgb().
uint8_t isi_R2Y::C1 |
Color Space Conversion Matrix Coefficient C1.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_Y2R::C2 |
Color Space Conversion Matrix Coefficient C2.
Referenced by isi_set_matrix_yuv2rgb().
uint8_t isi_R2Y::C2 |
Color Space Conversion Matrix Coefficient C2.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_Y2R::C3 |
Color Space Conversion Matrix Coefficient C3.
Referenced by isi_set_matrix_yuv2rgb().
uint8_t isi_R2Y::C3 |
Color Space Conversion Matrix Coefficient C3.
Referenced by isi_set_matrix_rgb2yuv().
uint16_t isi_Y2R::C4 |
Color Space Conversion Matrix Coefficient C4.
Referenced by isi_set_matrix_yuv2rgb().
uint8_t isi_R2Y::C4 |
Color Space Conversion Matrix Coefficient C4.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_R2Y::C5 |
Color Space Conversion Matrix Coefficient C5.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_R2Y::C6 |
Color Space Conversion Matrix Coefficient C6.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_R2Y::C7 |
Color Space Conversion Matrix Coefficient C7.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_R2Y::C8 |
Color Space Conversion Matrix Coefficient C8.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_Y2R::Cboff |
Color Space Conversion Blue Chrominance Default Offset.
Referenced by isi_set_matrix_yuv2rgb().
uint32_t isi_frame_buffer_descriptors::control |
Address of the Control.
uint8_t isi_config_t::crc_sync |
Embedded Synchronization Correction.
Referenced by isi_init().
uint8_t isi_Y2R::Croff |
Color Space Conversion Red Chrominance Default Offset.
Referenced by isi_set_matrix_yuv2rgb().
uint32_t isi_frame_buffer_descriptors::current |
Address of the Current FrameBuffer.
uint8_t isi_config_t::emb_sync |
Embedded Synchronization.
Referenced by isi_init().
uint8_t isi_R2Y::Goff |
Color Space Conversion Green Component Offset.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_config_t::hpol |
Horizontal Synchronization Polarity.
Referenced by isi_init().
enum isi_input_image_format isi_config_t::image_fmt |
Input image format.
Referenced by isi_init().
uint32_t isi_config_t::image_hsize |
Input image horizontal size.
Referenced by isi_init().
uint32_t isi_config_t::image_vsize |
Input image vertical size.
Referenced by isi_init().
uint32_t isi_frame_buffer_descriptors::next |
Address of the Next FrameBuffer.
uint8_t isi_config_t::pck_plo |
Pixel Clock Polarity.
Referenced by isi_init().
uint8_t isi_R2Y::Roff |
Color Space Conversion Red Component Offset.
Referenced by isi_set_matrix_rgb2yuv().
uint8_t isi_config_t::sfd |
Start of Frame Delay.
Referenced by isi_init().
uint8_t isi_config_t::sld |
Start of Line Delay.
Referenced by isi_init().
uint8_t isi_config_t::thmask |
Threshold Mask.
Referenced by isi_init().
uint8_t isi_config_t::vpol |
Vertical Synchronization Polarity.
Referenced by isi_init().
uint8_t isi_Y2R::Yoff |
Color Space Conversion Luminance Default Offset.
Referenced by isi_set_matrix_yuv2rgb().