AN2676 Freescale Semiconductor / Motorola, AN2676 Datasheet - Page 13

no-image

AN2676

Manufacturer Part Number
AN2676
Description
Image Capture with i.MX21
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
//Module init
*(uint32_t *)CRM_PCCR0 |= 0x8008000;//Clock enable for PRP
*(uint32_t *)EMMA_PRP_CNTL |= 0x10000;//PRP reset
//common control
*(uint32_t *)EMMA_PRP_CNTL = 0x0008F24E;//LOOP mode
matrix B0 (RGB2YUV)
//RGB565 => RGB565 (ch1), YUV420 (ch2)
*(uint32_t *)EMMA_PRP_CNTL |= 0x8000000;//bug fix
*(uint32_t *)EMMA_PRP_RSIZE_CTRL = 0x40;//MAIN resize = 2:1, CSC
resize = 1:1
*(uint32_t *)EMMA_PRP_INTRCTRL = 0x00000000;//disable interrupt
//source control
//*(uint32_t *)EMMA_PRP_SY_PTR;//source ptr : NOT used with CSI
*(uint32_t *)EMMA_PRP_SPIX_FMT = 0x2CA00565;//RGB565 input
*(uint32_t *)EMMA_PRP_SFRM_SIZE = 0x028001E0;//source = 640 x 480
//*(uint32_t *)EMMA_PRP_SLIN_STRID;//source line stride : NOT
used with CSI
//ch1 (RGB) dest control
*(uint32_t *)EMMA_PRP_DRGB1_PTR = rgb;//output buf1
*(uint32_t *)EMMA_PRP_DRGB2_PTR = rgb;//output buf2
*(uint32_t *)EMMA_PRP_DISIZE_CH1 = 0x00F000F0;//dest size = 240 x 240
*(uint32_t *)EMMA_PRP_DPIX_FMT = 0x2CA00565;//RGB565 output
*(uint32_t *)EMMA_PRP_DLST_CH1 = 0x000001E0;//dest line stride = 240
//ch2 (YUV) dest control
*(uint32_t *)EMMA_PRP_DY_PTR = y;//output buf1
*(uint32_t *)EMMA_PRP_DCB_PTR = u;
*(uint32_t *)EMMA_PRP_DCR_PTR = v;
*(uint32_t *)EMMA_PRP_SY_PTR = y;//output buf2 (re-used in
LOOP mode)
*(uint32_t *)EMMA_PRP_SCB_PTR = u;
*(uint32_t *)EMMA_PRP_SCR_PTR = v;
*(uint32_t *)EMMA_PRP_DISIZE_CH2 = 0x000000F0;//dest image height = 240
*(uint32_t *)EMMA_PRP_CNTL |= 0x1;//PRP enable
Table 7 shows VGA output in YUV422 format.
MOTOROLA
CSI Output / PRP Input
PRP Ch1 Output
PRP Ch2 Output
CSI Input
Signal
Freescale Semiconductor, Inc.
For More Information On This Product,
Table 7. VGA Output in YUV422 Format
MC9328MX21 Application Note
Code Example 2. PRP Init
Go to: www.freescale.com
QVGA (Stride to 240
Resolution
CCIR VGA
QVGA
VGA
//matrix B0 (YUV2RGB),
//CSI i/f enable
//ch1, ch2 enable
×
240)
Color Space
RGB565
YUV422
YUV422
YUV420
Software Design
13

Related parts for AN2676