gpio_portable.h
资源名称:8202s.rar [点击查看]
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:3k
源码类别:
DVD
开发平台:
C/C++
- /*
- ----->included by gpio.h
- ----->only for portable dvd use.
- ----->did it on 07/25
- */
- //some general IO use define
- #ifdef SUNPLUS_8202P_DEMOBOARD
- #define PDVD_OPCLSW_GPIO 3
- #define MCU_POWER_DET_GPIO 22
- #ifdef EASTWIN
- #define LOWBAT_DET_GPIO 18
- #else
- #define LOWBAT_DET_GPIO 21
- #endif
- #define CTR_GLED_GPIO 55
- #define DSP_RLED_GPIO 54
- #define HOLD_GPIO 23
- #define TFT_SW_GPIO 2
- #define CTR_TFT_GPIO 93
- #else
- #define PDVD_OPCLSW_GPIO 16
- #define MCU_POWER_DET_GPIO 41
- #define LOWBAT_DET_GPIO 42
- #define CTR_GLED_GPIO 39
- #define DSP_RLED_GPIO 40
- #define HOLD_GPIO 37
- #define TFT_SW_GPIO 44
- #define CTR_TFT_GPIO 43
- #endif
- //spi related IO define
- #ifdef SUPPORT_SPI
- #ifdef SPI_IO_NEW
- #define SPI_DATAIN 52
- #define SPI_DATAOUT 50
- #define SPI_CLK 51
- #else
- #define SPI_DATAIN 39
- #define SPI_DATAOUT 37
- #define SPI_CLK 38
- #endif
- #endif
- //need a gpio to control PAL/NTSC in TFT
- #ifdef PNGPIO_CON_TFT
- #ifdef EASTWIN
- #define PALNTSC_CON_GPIO 94 // EASTWIN change to gpio94
- #else
- #define PALNTSC_CON_GPIO 59
- #endif
- #define PALNTSC_GPIO_INIT()
- do {
- regs0->sft_cfg3 &= ~((0x01)<<3);
- GPIO_M_SET(PALNTSC_CON_GPIO, 1);
- GPIO_E_SET(PALNTSC_CON_GPIO, 1);
- } while (0)
- #define NTSC_SET() GPIO_O_SET(PALNTSC_CON_GPIO,1)
- #define PAL_SET() GPIO_O_SET(PALNTSC_CON_GPIO,0)
- #endif //end #ifdef PNGPIO_CON_TFT
- //need a gpio to detect AV in
- #ifdef TFT_VIDEO_INOUT
- #define INT_EXT_VIDEO_GPIO 56
- #define INT_EXT_GPIO_INIT()
- do {
- GPIO_M_SET(INT_EXT_VIDEO_GPIO, 1);
- GPIO_E_SET(INT_EXT_VIDEO_GPIO, 0);
- } while (0)
- #endif //end #ifdef TFT_VIDEO_INOUT
- #ifdef EASTWIN
- #define ENABLE_AMP() GPIO_O_SET(48,0)
- #define DISABLE_AMP() GPIO_O_SET(48,1)
- #define EAR_DETECT() GPIO_I_GET(49)
- #define INVERTER_POWER_ON() GPIO_O_SET(51,0)
- #define INVERTER_POWER_OFF() GPIO_O_SET(51,1)
- #define POWER_LED_ON() GPIO_O_SET(54,0)
- #define POWER_LED_OFF() GPIO_O_SET(54,1)
- #define LCD_VIEW_MODE_NORMAL() GPIO_O_SET(97,0)
- #define LCD_VIEW_MODE_FULL() GPIO_O_SET(97,1)
- #define LCD_POWER_ON() GPIO_O_SET(100,1)
- #define LCD_POWER_OFF() GPIO_O_SET(100,0)
- #define AUDIO_MUTE_ON() GPIO_O_SET(56,1) // Kevin Sep 22,04
- #define AUDIO_MUTE_OFF() GPIO_O_SET(56,0) // Kevin Sep 22,04
- #define AN2526H_ADDR 0x88
- #define AN2546H_ADDR 0x88
- #define VX1818_ADDR 0xD8
- #define data_refresh_mode 0x80
- #define auto_increment_mode 0x00
- /* an2526H operation mode */
- #define NORMAL_MODE 0
- #define FULL_MODE 1
- #define E2PROM_BEEN_USED 0x55
- #define BEEN_USED_ADDR 182 // I2C address
- #define VIEWMODE_ADDR 183 // I2C address
- void init_an2526h_ntsc(void);
- void init_an2526h_pal(void);
- //void vx1818_init(void);
- void an2526h_send_data(void);
- void an2526h_value_change(unsigned char para,unsigned char value);
- void init_lcd_display_mode(void);
- void check_customer_default(void);
- void load_customer_default(void);
- void init_an2526h(void); // Kevin Sep 20,04
- #endif