📄 52xx_board.h
字号:
//***********************************************************************************
#if USE_CABLE_DETECTION_FEATURE
#define IsVgaCableConnected() ((gm_ReadRegByte(GPINPUT2) & BIT6)==0) //GPIO14, LOW
#define IsDviCableConnected() ((gm_ReadRegByte(GPINPUT2) & BIT7)!=0) //GPIO15, HIGH
#endif
//***********************************************************************************
// Note: The board should be rewired to support software power on/off for the flash.
// GPIO2 is used as an example to control power on the flash. "LOW": power off,
// "HIGH": power on. This feature is disabled, until we finalize the power GPIO pin.
//***********************************************************************************
#if USE_POWERDOWN_ROM_CE
// #define DisableXROMPower() gm_ClearRegBitsByte(GPOUTPUT1, BIT2) // GPIO2, LOW
// #define EnableXROMPower() gm_SetRegBitsByte(GPOUTPUT1, BIT2) // GPIO2, HIGH
#define DisableXROMPower()
#define EnableXROMPower()
#endif
#define VideoDecoderResetLow() gm_ClearRegBitsByte(GPOUTPUT1, BIT6)
#define VideoDecoderResetHigh() gm_SetRegBitsByte(GPOUTPUT1, BIT6)
#define NVRAM_32KBIT 0 // 1-use 32kbit NVRAM EEPROM driver
// 0-standard 16kbit and less driver
// 32kbit EEPROMS have an additional
// address byte.
// defines to control some of the default flavors. For instance when
// compiling a 5321 project you don't want VPORT support and you likely
// don't want GSEL driver support (initializing external video decoders etc.)
#define USE_VPORT 1 // include code to address VPORT.
#define USE_GSEL_DRVR_MODEL 1 // include code to support GSEL drivers
#define USE_VIDEO_FEATURES 1 // vcr ff/rew adjust etc.
#define USE_ACC_ACM 1 // support for ACC/ACM
#define USE_GETKEY_TIMER_ISR 1 // 0-disable use of Timer ISR, 1- use Timer ISR
//******************************************************************
// RD5 BOARD, no GPIO keypad support
//******************************************************************
#elif ( BOARD == RD5 )
#define CPU_CLK_KHZ 100000UL // in KHz
#define CPU_SPEED 1
#define T_CLK_KHZ 14318
#define LCLK_MHZ 170UL // Set to 10% above maximum input frequency.
#define FLASH_SPEED_NS 90 // 90ns.
#define I2C_SPEED 400 // 100KHz or 400KHz.
#define OCM_CLK_PWRDOWN_KHZ T_CLK_KHZ
#define LED_POL NEG_POL
#define KEY_PAD KEYPAD_GPIO
// KEYPAD ***************************
// GPIO Keypad settings, No GPIO keypad support
#if FIRMWARE==V10Rel
#define PORT_ADC_1_USED // Define for LBADC Keypad...
// #define PORT_ADC_2_USED
// #define PORT_ADC_3_USED
// #define PORT_IR_USED // IR Keypad
// #define PORT_GPIO_1_USED
// #define GPIOKEYPAD_ALLOWED 1
#else
#define GPIOKEYPAD_ALLOWED 0
#endif
#define KeyPolarity 0 // polarity for GPIO keypad.
// LBADC Keypad settings.
#define AdcPolarity 0 // polarity for LBADC keypad.
// Brightness control
#define PWM0_BRIGHTNESS 1 // Use PWM for brightness control
#define BRIGHTNESS_PWM_PORT PWM0_PULSE // address of PWM to use (see register.h)
#define LED_ORANGE BIT1
#define LED_GREEN BIT2
//** MASK For LED and KEYPAD **************************************
#define GPIO1_MASK (LED_GREEN | LED_ORANGE)
#define GPIO1_ODEN 0
//***********************************************************************************
//Note: The board should make corresponding changes to make cable detection work!!!
// Temporarily Map VGA_CABLE connected signal on GPIO14, Low(0) indicating connection;
// Temporarily Map DVI_CABLE connected signal on GPIO15, High(1) ndicating connection;
// This will need direction settion to input for GPIO_DIRCTRL2
//***********************************************************************************
#if USE_CABLE_DETECTION_FEATURE
#define IsVgaCableConnected() ((gm_ReadRegByte(GPINPUT2) & BIT6)==0) //GPIO14, LOW
#define IsDviCableConnected() ((gm_ReadRegByte(GPINPUT2) & BIT7)!=0) //GPIO15, HIGH
#endif
//***********************************************************************************
// Note: The board should be rewired to support software power on/off for the flash.
// GPIO2 is used as an example to control power on the flash. "LOW": power off,
// "HIGH": power on. This feature is disabled, until we finalize the power GPIO pin.
//***********************************************************************************
#if USE_POWERDOWN_ROM_CE
// #define DisableXROMPower() gm_ClearRegBitsByte(GPOUTPUT1, BIT2) // GPIO2, LOW
// #define EnableXROMPower() gm_SetRegBitsByte(GPOUTPUT1, BIT2) // GPIO2, HIGH
#define DisableXROMPower()
#define EnableXROMPower()
#endif
#define VideoDecoderResetLow()
#define VideoDecoderResetHigh()
#define NVRAM_32KBIT 0 // 1-use 32kbit NVRAM EEPROM driver
// 0-standard 16kbit and less driver
// 32kbit EEPROMS have an additional
// address byte.
// defines to control some of the default flavors. For instance when
// compiling a 5321 project you don't want VPORT support and you likely
// don't want GSEL driver support (initializing external video decoders etc.)
#define USE_VPORT 0 // include code to address VPORT.
#define USE_GSEL_DRVR_MODEL 0 // include code to support GSEL drivers
#define USE_VIDEO_FEATURES 0 // vcr ff/rew adjust etc.
#define USE_ACC_ACM 0 // support for ACC/ACM
#define USE_GETKEY_TIMER_ISR 1 // 0-disable use of Timer ISR, 1- use Timer ISR
//******************************************************************
// FPGA BOARD
//******************************************************************
#elif (BOARD == FPGA_BOARD)
#define CPU_CLK_KHZ 14318UL // in KHz
#define CPU_SPEED 1
#define T_CLK_KHZ 14318
#define LCLK_MHZ 170UL // Set to 10% above maximum input frequency.
#define FLASH_SPEED_NS 90 // 90ns.
#define I2C_SPEED 400 // 100KHz or 400KHz.
#define OCM_CLK_PWRDOWN_KHZ T_CLK_KHZ
// KEYPAD ***************************
// GPIO Keypad settings
#define GPIOKEYPAD_ALLOWED 1
#define USE_LONG_DEMO_KEYPAD 0 //for different GPIO mapping to LED1
#define KeyPolarity 0 // polarity for GPIO keypad.
// LBADC Keypad settings.
#define AdcPolarity 0 // polarity for LBADC keypad.
// Brightness control
#define PWM0_BRIGHTNESS 1 // Use PWM for brightness control
#define BRIGHTNESS_PWM_PORT PWM0_PULSE // address of PWM to use (see register.h)
#define NVRAM_32KBIT 0 // 1-use 32kbit NVRAM EEPROM driver
// 0-standard 16kbit and less driver
// 32kbit EEPROMS have an additional
// address byte.
// defines to control some of the default flavors. For instance when
// compiling a 5321 project you don't want VPORT support and you likely
// don't want GSEL driver support (initializing external video decoders etc.)
#define USE_VPORT 1 // include code to address VPORT.
#define USE_GSEL_DRVR_MODEL 1 // include code to support GSEL drivers
#define USE_VIDEO_FEATURES 1 // vcr ff/rew adjust etc.
#define USE_ACC_ACM 1 // support for ACC/ACM
#define USE_GETKEY_TIMER_ISR 1 // 0-disable use of Timer ISR, 1- use Timer ISR
#endif
//******************************************************************
// END BOARD SPECIFIC DEFINES
//******************************************************************
#define CPU_CLK_MHZ (CPU_CLK_KHZ / 1000)
#ifndef T_CLK_KHZ
#error must define T_CLK_KHZ
#endif
#define T_CLK_MHZ (T_CLK_KHZ / 1000)
// SPI clock selection in normal mode (default).
#define SPI_DEFAULT_CLOCK_SEL 2
#if (T_CLK_MHZ <= 14)
// 0x20 is 256 tclk and good for from 14318/(2*128) = 55.93KHz to 27.97KHz
#define INTERLACED_VSYNC_WINDOW 0x20
#elif (T_CLK_MHZ < 25)
// 0x30 is 384TClk and good for from 52.08KHz to 26Khz for 20 MHz
// and 62.5Khz to 31.25Khz for 24MKz
#define INTERLACED_VSYNC_WINDOW 0x31
#else // (T_CLK_MHZ > 25MHz)
#define INTERLACED_VSYNC_WINDOW 0x41
#endif
/*************************************************************************
Table of acceptable buad rates:
Full Pwr | TCLK | TCLK/14
BAUD | 100.0Mhz | 14.318Mhz | 1.023Mhz
115200| Yes | No** | No
57600 | Yes | No** | No
56000 | Yes | Yes | No
38400 | Yes | Yes | No
19200 | Yes | Yes | No
14400 | Yes | Yes | No
9600 | Yes | Yes | No
4800 | Yes | Yes | No**
1200 | Yes | Yes | Yes
**means you may be able to see debug output depending on how
tolorant your PC is, but you're likely not going to be able to
receive any debug commands.
**************************************************************************/
#if CPU_CLK_KHZ > 50000
#define SERIAL_BAUD_RATE 115200UL
#else
#define SERIAL_BAUD_RATE 19200UL
#endif
#define SBAUD_IN_LOW_POWER 4800UL // Baud rate in low power mode
#ifndef NVRAM_32KBIT
#define NVRAM_32KBIT 0
#endif
// define IsCableConnected for compatibility with single port systems.
#define IsCableConnected() IsVgaCableConnected
#endif // __52XX_BOARD_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -