📄 hal_private.h
字号:
//===========================================================================
// HAL_PRIVATE.H
// (Tabs set to every 4)
//---------------------------------------------------------------------------
// Copyright (c) 2002, 2003 Epson Research and Development, Inc.
// All Rights Reserved.
//===========================================================================
#include "hal.h"
// Use two levels of macro indirection to force/trick the compiler
// to stringize PRODUCTCODE into HALCHIPID.
#define HALSTRINGIZE1(x) #x
#define HALSTRINGIZE2(x) HALSTRINGIZE1(x)
#define HALCHIPID HALSTRINGIZE2(PRODUCTCODE)
#define HAL_PCI_VRAM_OFFSET 0x00200000UL // Default offset of VRAM in PCI virtual memory block
#define HAL_REG0014_DEFAULT 0x0011 // Default value of register 14h on powerup
#define offsetof(s,m) (int)&(((s *)0)->m)
#define HAL_DELAY1_PLL 244 // Delay (in microseconds)
#define HAL_DELAY2_PLL 100 // Delay (in microseconds)
#if HAL_REGBYTES == 1 // 8-bit registers
#define HAL_WRITE_REG(i,v) halWriteReg8(i,v)
#define HAL_READ_REG(i) halReadReg8(i)
#define HAL_MODIFY_REG(i,a,o) halModifyReg8(i,a,o)
#define HAL_WRITE_LUT(i,v) halWriteReg8(i+0,(UInt8)v); \
halWriteReg8(i+1,(UInt8)(v>>8)); \
halWriteReg8(i+1,(UInt8)(v>>16)); \
halWriteReg8(i+1,(UInt8)(v>>24))
#elif HAL_REGBYTES == 2 // 16-bit registers
#define HAL_WRITE_REG(i,v) halWriteReg16(i,v)
#define HAL_READ_REG(i) halReadReg16(i)
#define HAL_MODIFY_REG(i,a,o) halModifyReg16(i,a,o)
#define HAL_WRITE_LUT(i,v) halWriteReg16(i+0,(UInt16)v); \
halWriteReg16(i+2,(UInt16)(v>>16))
#elif HAL_REGBYTES == 4 // 32-bit registers
#define HAL_WRITE_REG(i,v) halWriteReg32(i,v)
#define HAL_READ_REG(i) halReadReg32(i)
#define HAL_MODIFY_REG(i,a,o) halModifyReg32(i,a,o)
#define HAL_WRITE_LUT(i,v) halWriteReg32(i,(UInt32)v)
#else // HAL_REGBYTES != 1,2,4
#error Definition of HAL_REGBYTES not one of 1, 2, or 4!
typedef UInt16 UIntReg;
#define HAL_WRITE_REG(i,v) ((void)0)
#define HAL_READ_REG(i) ((void)0)
#define HAL_MODIFY_REG(i,a,o) ((void)0)
#define HAL_WRITE_LUT(i,v) ((void)0)
#endif
typedef union tagRGBUnion // LUT entries RGB structure, used by halInitLUT()
{
struct
{
UInt8 Red; // Red primary
UInt8 Green; // Green primary
UInt8 Blue; // Blue primary
UInt8 Reserved; // n/a
} rgb;
UInt32 Value32; // RGB 32-bit composite value
} RGB_UNION, *PRGB_UNION;
#ifndef HAL_STRUCT_NAME
#endif
HAL_STRUCT HAL_STRUCT_NAME =
{
HALCHIPID" HAL EXE", // HAL ID string
"\x00", // Configuration description
"\x01" "disoff\x00\x03slpin\x00\x05" "dispctl1\x00\vdispctl2\x00\x12gcpset\x00" "4slpout\x00" "6display on\x00", // Parallel LCD1 strings pool
"\x00", // Parallel LCD2 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)
0x00c00000, // Physical base memory address CS3 :0xc00000
0x00000000, // Physical register address offset
0x00080000, // Physical memory address offset
1200, // LCD power off time (in ms)
300,// old 50-->300 // LCD power on time (in ms)
0x00000000, // GPIO LCD power pin mask bit
640, 480, // Camera1 expected image size
640, 480, // Camera2 expected image size
76800L, // Required VRAM (in bytes)
fINDIRECT_INTERFACE, // Hal Information flags,if direct this should be 0.if indirect should be fINDIRECT_INTERFACE
{ // LCD1 init sequence
0x00 + 0x0000, /*Start Oscillation*/
0x00 + 0x0001,
// HAL_LCD_DELAY + 500,
0x00 + 0x0001, /*Driver Output Control*/
0x00 + 0x091b, /*wandy to test old 0x191b*///peiyq 0x191b->0x091b
0x00 + 0x0002,
0x00 + 0x0500, /*0700*/
0x00 + 0x0003,
0x00 + 0x7230, /*7030*/
0x00 + 0x0007,
0x00 + 0x0000, /*0000*/
0x00 + 0x0008,
0x00 + 0x0505, /*0a03*/ //--->0x0207
0x00 + 0x0009,
0x00 + 0x0000, /*0000*/
0x00 + 0x000b,
0x00 + 0x0400,
0x00 + 0x000c,
0x00 + 0x0000, /**/
0x00 + 0x0040,
0x00 + 0x0000,
0x00 + 0x0041,
0x00 + 0x0000,
0x00 + 0x0042,
0x00 + 0xdb00,
0x00 + 0x0043,
0x00 + 0xdb00,
0x00 + 0x0044,
0x00 + 0xaf00,
0x00 + 0x0045,
0x00 + 0xdb00, //old 0xdb00 --->0xef00
0x00 + 0x007,
0x00 + 0x0000,
0x00 + 0x0012,
0x00 + 0x0000,
// HAL_LCD_DELAY + 50, //0x100
/*adjust contrast */
0x00 + 0x0013,
0x00 + 0x0000,
// HAL_LCD_DELAY + 50,
0x00 + 0x0011,
0x00 + 0x0000, //debug contrast 0x0040
// HAL_LCD_DELAY + 50,
0x00 + 0x0010,
0x00 + 0x0000, //
// HAL_LCD_DELAY + 50,
0x00 + 0x0010,
0x00 + 0x0044, //debug contrast 0x0040
// HAL_LCD_DELAY + 100,
0x00 + 0x0012,
0x00 + 0x001e, //
// HAL_LCD_DELAY + 400,
0x00 + 0x0013,
0x00 + 0x2d18, //debug contrast 0x2d2e
// HAL_LCD_DELAY + 300,
0x00 + 0x0010,
0x00 + 0x0040, // debug contrast 0x4040
// HAL_LCD_DELAY + 100,
0x00 + 0x0010,
0x00 + 0x6060, //
// HAL_LCD_DELAY + 200,
0x00 + 0x0030,
0x00 + 0x0303,
0x00 + 0x0031,
0x00 + 0x0303,
0x00 + 0x0032,
0x00 + 0x0303,
0x00 + 0x0033,
0x00 + 0x0303,
0x00 + 0x0034,
0x00 + 0x0303,
0x00 + 0x0035,
0x00 + 0x0303,
0x00 + 0x0036,
0x00 + 0x0303,
0x00 + 0x0037,
0x00 + 0x0303,
0x00 + 0x0038,
0x00 + 0x0303,
0x00 + 0x0039,
0x00 + 0x0303,
//Display setting
0x00 + 0x0007,
0x00 + 0x0005, /*0x0105*///--->0x0005
// HAL_LCD_DELAY + 50, //0x100
0x00 + 0x0007,
0x00 + 0x0025, /*0x0125*///--->0x0025
// HAL_LCD_DELAY + 50,
0x00 + 0x0007,
0x00 + 0x0027, /*0x0127*/
// HAL_LCD_DELAY + 50,
0x00 + 0x0007,
0x00 + 0x0037, /*0x0137*/
// HAL_LCD_DELAY + 50,
0x00 + 0x000c,
0x00 + 0x0110, /*0x0110*/
0x00 + 0x0022,
// HAL_LCD_ENDOFTABLE
},
{ // LCD2 init sequence
// HAL_LCD_DELAY + 50,
0x00 + 0xf8, /* EXTERNSION REGISTER1 */
0x00 + 0xf4,
0x00 + 0x02, /* OSCILLATOR MODE */
0x00 + 0x01,
// HAL_LCD_DELAY + 200,
0x00 + 0x2e, /* STANDBY_OFF */
// HAL_LCD_DELAY + 100,
0x00 + 0x10, /* SET OUTPUT DRIVER MODE */
0x00 + 0x11,
0x00 + 0x20, /* DC-DC MODE */
0x00 + 0x77,
0x00 + 0x22, /* DRIVER CURRENT&BIAS MODE */
0x00 + 0xe3, //old ox61
0x00 + 0x24, /* PCK GENERATION MODE */
0x00 + 0x00, //old ox02
0x00 + 0x30, /* ADDRESSING MODE */
0x00 + 0x1f,
0x00 + 0x32, /* ROW VECTOR MODE */
0x00 + 0x04,
0x00 + 0x34, /* N-LINE INVERSION */
0x00 + 0xc1,
0x00 + 0x53, /* SPECIFY DISPLAY PATTERN */
0x00 + 0x00,
0x00 + 0x55, /* PARTIAL DISPLAY MODE */
0x00 + 0x00,
0x00 + 0x26, /* DC-DC AND AMP ON/OFF */
0x00 + 0x0f,
0x00 + 0x2a, /* CONTRAST CONTROL 1 */
0x00 + 0x27, //old ox4a
0x00 + 0x51,
0x00 + 0x40, /* DIPSPLAY ON */
0x00 + 0x18, //old ox00
0x00 + 0x42, /* Y-ADDRESS AREA */
0x00 + 0x00,
0x00 + 0x5f,
0x00 + 0x43, /* X-ADDRESS AREA */
0x00 + 0x00,
0x00 + 0x5f,
0x00 + 0x59, /* CONTRAST CONTROL 2 */
0x00 + 0x01,
0x00 + 0x5f, /* PARTIAL DISPLAY START LINE */
0x00 + 0x5a, /* SCROLL START LINE */
0x00 + 0x00,
// HAL_LCD_ENDOFTABLE
},
{ // S1D13715 init registers
// { REGFLAG_PREPARECLKS, 0x0000 },
{ REG000E_PLL0, 0X1D18 },// 55M 0X1D18 },//f194 40M
{ REG0010_PLL1, 0x0000 },//
// { REGFLAG_PLLDELAY, 0x0000 },//
{ REG0018_SYSCLK, 0x0000 },//00
// { REGFLAG_CONFIGURECLKS, 0x0000 },//
{ REG8000_BLTCTRL0, 0x0000 },//
{ REG0300_GPIOSTATUS0, 0xffff },//ffff
{ REG0302_GPIOSTATUS1, 0xffff },//ffff
{ REG0304_GPIOSTATUS2, 0x0000 },//ffff
{ REG0306_GPIOSTATUS3, 0x0000 },//00
{ REG0308_GPIOPULLDOWN0, 0xFFFF },//00
{ REG030A_GPIOPULLDOWN1, 0xffff },//00
{ REG030C_GPIOSTATUS4, 0x0001 },
{ REG030E_GPIOSTATUS5, 0x0000 },
{ REG0022_IMEMADDR1, 0x0000 },
{ REG0024_IMEMADDR2, 0x0000 },
{ REG0026_IAUTOINC, 0x0000 },//wandy 0x0000--->0x0001 262k:address auto increment.
{ REG0030_LCDINTCLOCK, 0x0405 },// 0x0405--->0x0404 wandy to test lcd dither
{ REG0032_LCDMODCLOCK, 0x00b1 }, //0x0031
{ REG0034_LCDINTCMD, 0x0000 },
{ REG0036_LCDINTPARAM, 0x0000 },
{ REG003A_LCDINTFRAMEXFER, 0x0000 },
{ REG003C_LCDINTXFER, 0x0000 },
{ REG0040_LCD1HT, 0x0018 },//0x0017
{ REG0042_LCD1HDP, 0x0057 },
{ REG0044_LCD1HDPS, 0x0003 },//0x000e
{ REG0046_LCD1FPLINE, 0x0005 },//0x0009
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -