⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hal_config.c

📁 是一个手机功能的模拟程序
💻 C
📖 第 1 页 / 共 5 页
字号:
	HAL_LCD_PARAM   + 0xea,     
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0xf0, 
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0xf5,     
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0xf9,     
	HAL_LCD_PARAM   + 0x00, 
	//////////////////////
	HAL_LCD_PARAM   + 0xfe,     
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0x02,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x05,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x09,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x0c,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x0f, 
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x12,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x15,     
	HAL_LCD_PARAM   + 0x01, 
	//////////////////////
	HAL_LCD_PARAM   + 0x18,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x1b,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x1d,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x1f,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x21,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x23, 
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x25,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x27,     
	HAL_LCD_PARAM   + 0x01,         
	//////////////////////   
	HAL_LCD_PARAM   + 0x29,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x2b,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x2c,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x2e,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x2f,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x31, 
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x32,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x34,     
	HAL_LCD_PARAM   + 0x01,         
	//////////////////////         
	HAL_LCD_PARAM   + 0x35,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x36,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x38,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x39,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x3a,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x3b, 
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x3c,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x3d,     
	HAL_LCD_PARAM   + 0x01,         
	//////////////////////         
	HAL_LCD_PARAM   + 0x3e,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x3f,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x40,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x41,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x42,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x43, 
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x44,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x45,     
	HAL_LCD_PARAM   + 0x01,         
	//////////////////////         
	HAL_LCD_PARAM   + 0x46,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x47,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x48,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x49,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x4a,     
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0x4b, 
	HAL_LCD_PARAM   + 0x01,     
	HAL_LCD_PARAM   + 0xf4,     
	HAL_LCD_PARAM   + 0x01,     
	//Gray set end
	//Display control set start
	HAL_LCD_COMMAND + 0xCA,     
	HAL_LCD_PARAM   + 0x4C,     
	HAL_LCD_PARAM   + 0x01, 
	HAL_LCD_PARAM   + 0x66,     
	HAL_LCD_PARAM   + 0x00,  
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0xB4,  
	HAL_LCD_PARAM   + 0x9F,     
	HAL_LCD_PARAM   + 0x0A,  
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0x00,
	HAL_LCD_PARAM   + 0x00,  
	//Display control set end
	//Data control set strat
	HAL_LCD_COMMAND + 0xBC,     
	HAL_LCD_PARAM   + 0x22,     
	HAL_LCD_PARAM   + 0x00, 
	//Data control set end
	//page address set start
	HAL_LCD_COMMAND + 0x75,     
	HAL_LCD_PARAM   + 0x00,     
	HAL_LCD_PARAM   + 0x9F,
	//page address set end
	//column address set 
	HAL_LCD_COMMAND + 0x15,     
	HAL_LCD_PARAM   + 0x8C,     
	HAL_LCD_PARAM   + 0x00, 
	HAL_LCD_PARAM   + 0x0B,     
	HAL_LCD_PARAM   + 0x01,  
	// Sleep out set start
	HAL_LCD_COMMAND + 0x94,     
	HAL_LCD_DELAY   + 500, 
	//Sleep out set end
	//Display on
	HAL_LCD_COMMAND + 0xAF,
	HAL_LCD_DELAY   + 100,  
	//Power ic control for evr
	HAL_LCD_COMMAND + 0xC6,
	HAL_LCD_PARAM   + 0x80,
	HAL_LCD_DELAY   + 200, 
	HAL_LCD_COMMAND + 0xC6, 
	HAL_LCD_PARAM   + 0x47,//47,
	//contranst up set start 

	HAL_LCD_DELAY   + 200,
	HAL_LCD_COMMAND + 0xC6,// 1
	HAL_LCD_PARAM   + 0x9D, 
	HAL_LCD_DELAY   + 100, 

	HAL_LCD_COMMAND + 0xC6,// 2
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100,  
	HAL_LCD_COMMAND + 0xC6,// 3    
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100,  
	HAL_LCD_COMMAND + 0xC6,// 4     
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100, 
	HAL_LCD_COMMAND + 0xC6,// 5     
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100, 
	HAL_LCD_COMMAND + 0xC6,// 6     
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100, 
	HAL_LCD_COMMAND + 0xC6,//7     
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100, 
	HAL_LCD_COMMAND + 0xC6,// 8     
	HAL_LCD_PARAM   + 0x9D,     
	HAL_LCD_DELAY   + 100, 

	//contranstup set end
	// read for write
	HAL_LCD_COMMAND + 0x5C,     
	HAL_LCD_ENDOFTABLE
    },
    {                       // LCD3 init sequence
        HAL_LCD_ENDOFTABLE
    },

    {                       // S1D13716 init registers
	{ REG0018_POWERSAVE,			0x01 },
	{ REG0014_CLKSRC,				0x00 },
	{ REG0010_PLL0,					0xDD },//this setting is 40M,50M is 0xDD
	{ REG0011_PLL1,					0x1C },//this setting is 40M,50M is 0x1C
	{ REG0012_PLL2,					0x20 },
	{ REG0015_SERLCDCLK,			0x41 },//I2C Clock=sysclock/16
	{ REG0014_CLKSRC,				0x51 },//LCDPCLK=sysclock/24
	{ REG0016_LCDPCLKDIV,			0x00 },
	{ REG0018_POWERSAVE,			0x04 },
 	{ REGFLAG_DELAY,				0xFF },        
	//{ REG0070_PWMCTRL0,				0x05 }, //Trun on back light     
	//{ REG007F_PWMWHITECYCLE,		0x3F },      
	//{ REG0072_PWMCTRL1,				0x01 }, 
	{ REGFLAG_DELAY,				0x50 },
	{ REG0108_CMCONTROL,			0x01 },//software reset camera mode
	{ REG0108_CMCONTROL,			0x00 },
	{ REG0202_RESIZE,				0x81 },//Reset resizer
	{ REG0202_RESIZE,				0x01 },//Reset resizer
	{ REG0040_LCD1SETTING,			0x05 },//Data bus width 16 bits format 565
	{ REG0044_LCD2SETTING,			0x05 },//Data bus width 16 bits format 565
	{ REG0048_LCD3SETTING,			0x00 },//Not set
	{ REG004E_SCALEUP,				0x00 },//Encode Scale Overlay Disable
	{ REG004C_DISPSETTING,			0x62 },//Overlay with Main  and Overlay is 8 bits and select lcd2
	{ REG0036_LCDTRIG,				0x00 },
	{ REG003C_LCDXFER,				0x00 },//lcd auto transfer disable
	{ REG0248_OIMAGE,				0x10 },//The host output image to overlay 00 to main
	{ REG0216_RYC,					0x05 },//Ryc format is 565
	{ REG0220_YUVRGBXLATE0,			0x05 },//Default value
	{ REG0222_YUVRGBXLATE1,			0x00 },
	//{ REG0202_RESIZE,				0x03 },//Reset and enable resizer
	{ REG0204_RESIZESX0,			0x00 },
	{ REG0205_RESIZESX1,			0x00 },
	{ REG0206_RESIZESY0,				0x00 },
	{ REG0207_RESIZESY1,				0x00 },
	{ REG0208_RESIZEEX0,				0x7F },//127
	{ REG0209_RESIZEEX1,				0x00 },
	{ REG020A_RESIZEEY0,				0x9F },//160
	{ REG020B_RESIZEEY1,				0x00 },
	{ REG020C_RESIZEHSCALE,			0x01 },//H-scale
	{ REG020E_RESIZEVSCALE,			0x01 },//V-scale
	{ REG0210_RESIZEOP,				0x00 },//Scale mode is no scale
	{ REG024A_SWIVELVIEW,			0x00 },//Not swivel
	{ REG0224_YUVWRSTART0,			0x00 },//Main window adress
	{ REG0225_YUVWRSTART1,			0x20 },//0x2000 8K
	{ REG0226_YUVWRSTART2,			0x00 },//
	{ REG0240_OSADDR0,				0x00 },//Overlay adress
	{ REG0241_OSADDR1,				0xC0 },//0xc000 so the main window size is 0xc000-0x2000
	{ REG0242_OSADDR2,				0x00 },
	{ REG0244_OHRES,				0x7F },//Overlay width
	{ REG0246_OVRES,				0x9F },//Overlay height
	{ REG0212_MEMHORZRES,			0x7F },//Actual Horizontal Resolution in Pixels -1. jpeg encode use
	{ REG0214_MEMVERTRES,			0x9F },//159
	{ REG0228_XOFFSET0,				0x00 },//Main window's position in overlay
	{ REG0229_XOFFSET1,				0x00 },
	{ REG022A_YOFFSET0,				0x00 },
	{ REG022B_YOFFSET1,				0x00 },
	{ REG0100_CMCLK,				0x02 },//camera clock setting.1 is 1/4 sysclock
	{ REG0102_CMSIGNAL,				0x02 },
    { REG0104_CMMODE0,				0x08 },
    { REG0106_CMMODE1,				0x00 },
	{ REG0110_CMSTROBECTRL,			0x80 },
	{ REGFLAG_ENDOFTABLE,			0x00 }
    },
    {
	// VGA MODE FOR OV7645FB
	{ 0x12, 0x80 },
	{ 0x03, 0xa4 },			//0x04----black & white//0xa4----normal
	{ 0x04, 0x30 },
	{ 0x05, 0x88 },
	{ 0x06, 0x60 },
	{ 0x11, 0x00 },			//{ 0x11, 0x00 }, //;value 01 for 15 fps
	{ 0x12, 0x15 },
	{ 0x13, 0x0B3 },			//{ 0x13, 0x0A3 },
	{ 0x14, 0x14 },
	{ 0x15, 0x14 },
	{ 0x1f, 0x41 },
	{ 0x20, 0xd0 },
	{ 0x23, 0xde },
	{ 0x24, 0xa0 },
	{ 0x25, 0x80 },
	{ 0x26, 0xb2 },
	{ 0x27, 0xe2 },			//0xe2----black & white//0xe0----normal
	{ 0x28, 0x20 },
	{ 0x2a, 0x01 },
	{ 0x2b, 0x00 },
	{ 0x2d, 0x05 },
	{ 0x2f, 0x9d },
	{ 0x30, 0x00 },
	{ 0x31, 0xc4 },
	{ 0x60, 0x86 },
	{ 0x61, 0xe0 },
	{ 0x62, 0x88 },
	{ 0x63, 0x11 },
	{ 0x64, 0x89 },
	{ 0x65, 0x00 },
	{ 0x67, 0x94 },
	{ 0x68, 0x7a },
	{ 0x69, 0x08 },
	{ 0x6c, 0x11 },			//0xFF----black & white//0x11----normal
	{ 0x6d, 0x33 },			//0xFF----black & white//0x33----normal
	{ 0x6e, 0x22 },			//0xFF----black & white//0x22----normal
	{ 0x6f, 0x00 },			
	{ 0x74, 0x20 },			//{ 0x74, 0x60 },  low light use 0x60
	{ 0x75, 0x0e },			//{ 0x75, 0x06 },
	{ 0x77, 0xc4 },			//{ 0x77, 0xb5 },
	//{ 0x79, 0x80 },			//set----black & white//remove----normal
	//{ 0x7a, 0x80 },			//set----black & white//remove----normal
	{ REGFLAG_ENDOFTABLE,0xFFFF}	//for end
   }
};
#endif

#ifdef S1D10251
HAL_STRUCT HAL_STRUCT_NAME =
{
    HALCHIPID" HAL EXE",    // HAL ID string
    "\x00",				// Configuration description
    "\x01" "6 SLPIN 95\x00\x02" "2 DISOFF AE\x00\x03" "DISCTL\x00\x0F" "13 DATCTL BC\x00\x12" "8 PSET 75\x00\x15" "9 CSET 15\x00\x1A" "7 SLPOUT\x00\x1BPAUSE\x00\x1C" "1 DISON AF\x00\x1DPAUSE\x00\x1E" "14 RAMWR 5C\x00",  // Parallel LCD1 strings pool
    "\x01" "6 SLPIN 95\x00\x02" "2 DISOFF AE\x00\x03" "DISCTL\x00\x0F" "13 DATCTL BC\x00\x12" "8 PSET 75\x00\x15" "9 CSET 15\x00\x1A" "7 SLPOUT\x00\x1BPAUSE\x00\x1C" "1 DISON AF\x00\x1DPAUSE\x00\x1E" "14 RAMWR 5C\x00",  // Parallel LCD2 strings pool
    "\x01" "disctl\x00\x05" "com scan\x00\abug fix\x00\bpageset\x00\vcolset\x00\x0E" "dactl\x00\x12" "disinv\x00\x13slpout\x00\x14power\x00\x17volume\x00\x1A" "dison\x00\x1Bramwr\x00",  // Serial LCD3 strings pool
    sizeof(HAL_STRUCT),	// Sizeof this structure
    0x0000,			// CRC of the rest of structure

    HALCHIPID,		// Chip ID
    0x1234,			// Endian detect (LE=0x1234)
    0,					// Reserved for alignment

    32768L,			// CLKI frequency (in Hz)
    32768L,			// Internal OSC frequency (in Hz)

    0x01000000,             // Physical base memory address
    0x00000000,             // Physical register address offset
    0x00000000,             // Physical memory address offset

    640, 480,			// Camera1 expected image size

    81920L,			// Required VRAM (in bytes)
    0,					// Hal Information flags//fNO_INIT_I2C

    {                       // LCD1 init sequence
        HAL_LCD_ENDOFTABLE
    },
    {                       // LCD2 init sequence//NEW
	//Soft reset
	HAL_LCD_PARAM   + 0x100,
	HAL_LCD_COMMAND + 0x01,  
	HAL_LCD_PARAM   + 0x100,
	//Soft reset end

	//Contrast
	HAL_LCD_COMMAND + 0x25, 
	HAL_LCD_PARAM   + 0x3D, 
	
	//column address set
	HAL_LCD_COMMAND + 0x2A, 
	HAL_LCD_PARAM   + 0x02, 
	HAL_LCD_PARAM   + 0x81,
	
	//page address set
	HAL_LCD_COMMAND + 0x2B, 
	HAL_LCD_PARAM   + 0x02, 
	HAL_LCD_PARAM   + 0x81,	

	//memory access control
	HAL_LCD_COMMAND + 0x36, 
	HAL_LCD_PARAM   + 0x48, 

	//interface pixel format
	HAL_LCD_COMMAND + 0x3A, 
	HAL_LCD_PARAM   + 0x05,

	//gray scale position set(GCPSET0)
	HAL_LCD_COMMAND + 0xB3, 
	HAL_LCD_PARAM   + 0x03,     
	HAL_LCD_PARAM   + 0x05,     
	HAL_LCD_PARAM   + 0x09,     
	HAL_LCD_PARAM   + 0x0D,     
	HAL_LCD_PARAM   + 0x12,     
	HAL_LCD_PARAM   + 0x14,     
	HAL_LCD_PARAM   + 0x17,     
	HAL_LCD_PARAM   + 0x1C,     
	HAL_LCD_PARAM   + 0x20,     
	HAL_LCD_PARAM   + 0x23,     
	HAL_LCD_PARAM   + 0x26, 
	HAL_LCD_PARAM   + 0x2A,     
	HAL_LCD_PARAM   + 0x2D,     
	HAL_LCD_PARAM   + 0x30,     
	HAL_LCD_PARAM   + 0x32,     
	HAL_LCD_PARAM   + 0x35, 
	//////////////////////
	HAL_LCD_PARAM   + 0x37,     
	HAL_LCD_PARAM   + 0x39,     

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -