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

📄 gpio.h.svn-base

📁 realtek的8186芯片ADSL路由AP源代码
💻 SVN-BASE
字号:
/*
 * Copyright c                Realtek Semiconductor Corporation, 2002
 * All rights reserved.                                                    
 * 
 * Abstract:
 *
 *   GPIO driver header file for export include.
 *
 * History:
 *  2007/06/26  SH  Modified CONFIG_RE8305 to CONFIG_EXTPHY
 *  2007/10/22  SH  Merge for Kevin's Patch for TR068 and GPIO Setting
 */

#ifndef _GPIO_H_
#define _GPIO_H_


/*port A pin*/
#define GPIO_PA7	0x8000
#define GPIO_PA6	0x4000
#define GPIO_PA5	0x2000
#define GPIO_PA4	0x1000
#define GPIO_PA3	0x0800
#define GPIO_PA2	0x0400
#define GPIO_PA1	0x0200
#define GPIO_PA0	0x0100

/*port B pin*/
#define GPIO_PB7	0x0080
#define GPIO_PB6	0x0040
#define GPIO_PB5	0x0020
#define GPIO_PB4	0x0010
#define GPIO_PB3	0x0008
#define GPIO_PB2	0x0004
#define GPIO_PB1	0x0002
#define GPIO_PB0	0x0001

#undef	GPIO_RESET_BUTTON
//#define	GPIO_LED_ADSL_HS	1
#undef	GPIO_LED_ADSL_HS
//#define	GPIO_LED_ADSL_ACT	1
#undef	GPIO_LED_ADSL_ACT
//#define	GPIO_LED_ADSL_ALARM	1
#undef	GPIO_LED_ADSL_ALARM
#undef	GPIO_LED_PPP		1

/*real use of GPIO pin
Pin #   0   1 ...   7   8 ...  15
GPIO  PB0 PB1 ... PB7 PA0 ... PA7
*/
#ifdef CONFIG_EXTPHY
// GPIO to simulate MDC/MDIO
// Note: the MDC and MDIO must use the same GPIO port (A or B) in current
// 	software design
#if 1
#define GPIO_MDC	3	// PB3
#define GPIO_MDIO	4	// PB4
#else
#define GPIO_MDC	12	// PA4
#define GPIO_MDIO	11	// PA3
#endif
#endif

#if defined(CONFIG_RTL8670)
#define ADSL_LED	0

// Added by Mason Yu for PPP LED
#elif defined(CONFIG_STD_LED)
/* bitmap of GPIO pin as gpio function
Bit #   0   1 ...   7   8 ...  15
GPIO  PB0 PB1 ... PB7 PA0 ... PA7
*/
#define GPIO_FUNC	0x7820

#define RESET_BUTTON    14
#define ADSL_LED	13
#define ADSL_ACT_LED	11
#define ALARM_LED	12
#define PPP_LED		5

#else // 8671
#define GPIO_FUNC	0xe000

#define ADSL_LED	15
#define ADSL_ACT_LED	14
#define ALARM_LED	13
#ifdef CONFIG_TR068
// addition TR-068 LED behavior by Kevin Chung 2007/09/19 
#define POWER_LED_G		6
#define POWER_LED_R		7
#endif //CONFIG_TR068
#endif

// Added by Mason Yu for PPP LED



/*port function definition*/
#define GPIO_FUNC_INPUT 	0x0001  /*data input*/
#define GPIO_FUNC_OUTPUT 	0x0002	/*data output*/
#define GPIO_FUNC_IRQ_FALL 	0x0003	/*falling edge IRQ*/
#define GPIO_FUNC_IRQ_RISE 	0x0004	/*rising edge IRQ*/
#define GPIO_FUNC_IRQ_LEVEL 	0x0005	/*level trigger IRQ*/

extern void gpioConfig (int gpio_num, int gpio_func);
extern void gpioSet(int gpio_num);
extern void gpioClear(int gpio_num);
//extern void gpioHandshaking(int flag);
//extern void gpioACT(int flag);
//extern void gpioAlarm(int flag);
//extern void gpio_LED_PPP(int flag);

#endif  /* _GPIO_H_ */

⌨️ 快捷键说明

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