📄 lcdc_init_plane_g.c
字号:
/*
* File: LCDC_init_plane_g.c
* Purpose: Graphic Window Configuration
*
* Notes:
*
*/
/*************************** Includes **************************/
#include "src/common/common.h"
#include "LCDC_init_plane.h"
/**************************************************
* Function name: LCDCGW_Display_Image(uint8 *)
* returns : return none
* arg1 : pointer to image
* arg2 : none
* Description : detailed description
* Notes : restrictions, odd modes
**************************************************/
void LCDCGW_Display_Image(uint8 *img)
{
lcdc_file lcd_file = *(lcdc_file*)img;
uint32 gw_words_per_row, i;
vuint32 *LUT_GW;
printf("\ngw_width= %x", lcd_file.header.width);
printf("\ngw_height= %x", lcd_file.header.height);
printf("\ngw_bpp= %x", lcd_file.header.bpp);
printf("\ngw_color_depth= %x", lcd_file.header.color_depth);
printf("\ngw_color_table_entries= %x", lcd_file.header.color_table_entries);
printf("\ngw_color_table_offset= %x", lcd_file.header.color_table_offset);
printf("\ngw_image_size= %x", lcd_file.header.image_size);
printf("\ngw_image_offset= %x", lcd_file.header.image_offset);
gw_words_per_row = lcd_file.header.width >> 2;
switch(lcd_file.header.bpp)
{ case 1: gw_words_per_row >>= 3; break;
case 2: gw_words_per_row >>= 2; break;
case 4: gw_words_per_row >>= 1; break;
case 8: break;
case 12: gw_words_per_row <<= 1; break;
case 16: gw_words_per_row <<= 1; break;
case 18: gw_words_per_row <<= 2; break;
}
MCF_LCDC_LGWSAR = (vuint32)img + lcd_file.header.image_offset;
MCF_LCDC_LGWSR = lcd_file.header.width << 16 | lcd_file.header.height;
MCF_LCDC_LGWVPWR = gw_words_per_row;
MCF_LCDC_LGWPR = 0x00000000; // arbitrary (x,y) GW position
MCF_LCDC_LGWDCR = ( 0
| MCF_LCDC_LGWDCR_GWHM(4)
|MCF_LCDC_LGWDCR_GWTM(8) );
if(lcd_file.header.color_table_entries)
{ //printf("\nFilling Graphic Window Lookup Table....");
for(i=0; i < (lcd_file.header.color_table_entries); i++)
{
LUT_GW = (uint32*)0xFC0ACC00 +i;
*LUT_GW = *(uint32*)(img + lcd_file.header.color_table_offset+ i*4);
}
//printf("\nGraphic Window Lookup Table Filled....");
}
//MCF_LCDC_LPCR |= MCF_LCDC_LPCR_PCD(PixClkDiv); // Pixel CLK Divider, actual divider is PCD value + 1
MCF_LCDC_LGWCR |= (0
//|MCF_LCDC_LGWCR_GWCKB(x)
//|MCF_LCDC_LGWCR_GWCKG(x)
//|MCF_LCDC_LGWCR_GWCKR(x)
//|MCF_LCDC_LGWCR_GW_RVS
|MCF_LCDC_LGWCR_GWE
//|MCF_LCDC_LGWCR_GWCKE
|MCF_LCDC_LGWCR_GWAV(0)
);
printf("\nLCDC_LGWSR= 0x%08x", MCF_LCDC_LGWSR);
printf("\nLCDC_LGWVPWR= 0x%08x", MCF_LCDC_LGWVPWR);
printf("\nLCDC_LGWCR= 0x%08x", MCF_LCDC_LGWCR);
printf("\nLCDC_LGWPR 0x%08x", MCF_LCDC_LGWPR);
printf("\nLCDC_LGWSAR= 0x%08x", MCF_LCDC_LGWSAR);
}/*end Display_Image*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -