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

📄 gpio_xdj.h

📁 此文件夹包含evc环境下编写GPIO应用程序的源代码。与我已上传的GPIOdriver配合使用
💻 H
字号:
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
/******************************************************************************
 *
 * System On Chip(SOC)
 *
 * Copyright (c) 2002 Software Center, Samsung Electronics, Inc.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of Samsung
 * Electronics, Inc("Confidential Information"). You Shall not disclose such
 * Confidential Information and shall use it only in accordance with the terms
 * of the license agreement you entered into Samsung.
 *
 *-----------------------------------------------------------------------------
 *
 *  S3C2410 BSP (Windows CE.NET)
 *
 * pwrbtn2410.h : Power Button Driver
 *
 * @author      : MingYuan Zheng 郑明远(广州致远电子有限公司)
 *
 * @date        2002/04/25
 *
 * Log:
 *  2002/04/25  Start
 *
 ******************************************************************************
 */

#ifndef __GPIO_H__
#define __GPIO_H__

#ifdef __cplusplus
extern "C" {
#endif



#define  GPIO_A	 	0x00
#define  GPIO_B	 	0x01
#define  GPIO_C	 	0x02
#define  GPIO_D	 	0x03
#define  GPIO_E	 	0x04
#define  GPIO_F	 	0x05
#define  GPIO_G	 	0x06
#define  GPIO_H 	0x07



#define	 IOCTL_GPIO_FUN_MASK				0x00000F0
#define	 IOCTL_GPX_MASK						0x000000F

#define  IOCTL_GPIO_SET_PIN_OUT				0x0000010			/* let pin out  */
#define  IOCTL_GPA_SET_PIN_OUT				0x0000010			/* let pin out  */
#define  IOCTL_GPB_SET_PIN_OUT				0x0000011			/* let pin out  */
#define  IOCTL_GPC_SET_PIN_OUT				0x0000012			/* let pin out  */
#define  IOCTL_GPD_SET_PIN_OUT				0x0000013			/* let pin out  */
#define  IOCTL_GPE_SET_PIN_OUT				0x0000014			/* let pin out  */
#define  IOCTL_GPF_SET_PIN_OUT				0x0000015			/* let pin out  */
#define  IOCTL_GPG_SET_PIN_OUT				0x0000016			/* let pin out  */
#define  IOCTL_GPH_SET_PIN_OUT				0x0000017			/* let pin out  */


/* set Px's multi pin's out */
/* one bit is 1, the pin is out */
/* one bit is 0, the pin don't change */
#define  IOCTL_GPIO_SET_MULTI_PIN_OUT		0x0000020
#define  IOCTL_GPA_SET_MULTI_PIN_OUT		0x0000020			
#define  IOCTL_GPB_SET_MULTI_PIN_OUT		0x0000021			
#define  IOCTL_GPC_SET_MULTI_PIN_OUT		0x0000022			
#define  IOCTL_GPD_SET_MULTI_PIN_OUT		0x0000023			
#define  IOCTL_GPE_SET_MULTI_PIN_OUT		0x0000024			
#define  IOCTL_GPF_SET_MULTI_PIN_OUT		0x0000025			
#define  IOCTL_GPG_SET_MULTI_PIN_OUT		0x0000026			
#define  IOCTL_GPH_SET_MULTI_PIN_OUT		0x0000027


/* let pin in   */
#define  IOCTL_GPIO_SET_PIN_IN				0x0000030	
#define  IOCTL_GPA_SET_PIN_IN				0x0000030
#define  IOCTL_GPB_SET_PIN_IN				0x0000031
#define  IOCTL_GPC_SET_PIN_IN				0x0000032
#define  IOCTL_GPD_SET_PIN_IN				0x0000033
#define  IOCTL_GPE_SET_PIN_IN				0x0000034
#define  IOCTL_GPF_SET_PIN_IN				0x0000035
#define  IOCTL_GPG_SET_PIN_IN				0x0000036
#define  IOCTL_GPH_SET_PIN_IN				0x0000037


/* set Px's multi pin's in */
/* one bit is 1, the pin is in */
/* one bit is 0, the pin don't change */
#define  IOCTL_GPIO_SET_MULTI_PIN_IN		0x0000040
#define  IOCTL_GPA_SET_MULTI_PIN_IN			0x0000040	
#define  IOCTL_GPB_SET_MULTI_PIN_IN			0x0000041
#define  IOCTL_GPC_SET_MULTI_PIN_IN			0x0000042
#define  IOCTL_GPD_SET_MULTI_PIN_IN			0x0000043
#define  IOCTL_GPE_SET_MULTI_PIN_IN			0x0000044
#define  IOCTL_GPF_SET_MULTI_PIN_IN			0x0000045
#define  IOCTL_GPG_SET_MULTI_PIN_IN			0x0000046
#define  IOCTL_GPH_SET_MULTI_PIN_IN			0x0000047

/* let pin high */
#define  IOCTL_GPIO_SET_PIN					0x0000050
#define  IOCTL_GPA_SET_PIN					0x0000050
#define  IOCTL_GPB_SET_PIN					0x0000051
#define  IOCTL_GPC_SET_PIN					0x0000052
#define  IOCTL_GPD_SET_PIN					0x0000053
#define  IOCTL_GPE_SET_PIN					0x0000054
#define  IOCTL_GPF_SET_PIN					0x0000055
#define  IOCTL_GPG_SET_PIN					0x0000056
#define  IOCTL_GPH_SET_PIN					0x0000057
	

/* set Px's all pins */
/* one bit is 1, the pin is high */
/* one bit is 0, the pin don't change */
#define  IOCTL_GPIO_SET_ALL_PIN				0x0000060			
#define  IOCTL_GPA_SET_ALL_PIN				0x0000060	
#define  IOCTL_GPB_SET_ALL_PIN				0x0000061		
#define  IOCTL_GPC_SET_ALL_PIN				0x0000062	
#define  IOCTL_GPD_SET_ALL_PIN				0x0000063	
#define  IOCTL_GPE_SET_ALL_PIN				0x0000064	
#define  IOCTL_GPF_SET_ALL_PIN				0x0000065	
#define  IOCTL_GPG_SET_ALL_PIN				0x0000066	
#define  IOCTL_GPH_SET_ALL_PIN				0x0000067	

/* let pin low   */
#define  IOCTL_GPIO_CLR_PIN					0x0000070
#define  IOCTL_GPA_CLR_PIN					0x0000070	
#define  IOCTL_GPB_CLR_PIN					0x0000071
#define  IOCTL_GPC_CLR_PIN					0x0000072
#define  IOCTL_GPD_CLR_PIN					0x0000073
#define  IOCTL_GPE_CLR_PIN					0x0000074
#define  IOCTL_GPF_CLR_PIN					0x0000075
#define  IOCTL_GPG_CLR_PIN					0x0000076
#define  IOCTL_GPH_CLR_PIN					0x0000077


/* clr Px's all pins */
/* one bit is 1, the pin is low */
/* one bit is 0, the pin don't change */
#define  IOCTL_GPIO_CLR_ALL_PIN				0x0000080			
#define  IOCTL_GPA_CLR_ALL_PIN				0x0000080	
#define  IOCTL_GPB_CLR_ALL_PIN				0x0000081	
#define  IOCTL_GPC_CLR_ALL_PIN				0x0000082	
#define  IOCTL_GPD_CLR_ALL_PIN				0x0000083
#define  IOCTL_GPE_CLR_ALL_PIN				0x0000084
#define  IOCTL_GPF_CLR_ALL_PIN				0x0000085	
#define  IOCTL_GPG_CLR_ALL_PIN				0x0000086	
#define  IOCTL_GPH_CLR_ALL_PIN				0x0000087	                                                                
                                                                
/* read pin's voltage level status */
#define  IOCTL_GPIO_READ_PIN				0x0000090	
#define  IOCTL_GPA_READ_PIN					0x0000090
#define  IOCTL_GPB_READ_PIN					0x0000091
#define  IOCTL_GPC_READ_PIN					0x0000092
#define  IOCTL_GPD_READ_PIN					0x0000093
#define  IOCTL_GPE_READ_PIN					0x0000094
#define  IOCTL_GPF_READ_PIN					0x0000095
#define  IOCTL_GPG_READ_PIN					0x0000096
#define  IOCTL_GPH_READ_PIN					0x0000097


/* read Px's all pin's set */				
#define  IOCTL_GPIO_READ_ALL_PIN			0x00000A0			
#define  IOCTL_GPA_READ_ALL_PIN				0x00000A0
#define  IOCTL_GPB_READ_ALL_PIN				0x00000A1
#define  IOCTL_GPC_READ_ALL_PIN				0x00000A2
#define  IOCTL_GPD_READ_ALL_PIN				0x00000A3
#define  IOCTL_GPE_READ_ALL_PIN				0x00000A4
#define  IOCTL_GPF_READ_ALL_PIN				0x00000A5
#define  IOCTL_GPG_READ_ALL_PIN				0x00000A6
#define  IOCTL_GPH_READ_ALL_PIN				0x00000A7


/* read port's setting */
#define  IOCTL_GPIO_READ_PORT				0x00000B0			
#define  IOCTL_GPA_READ_PORT				0x00000B0			
#define  IOCTL_GPB_READ_PORT				0x00000B1			
#define  IOCTL_GPC_READ_PORT				0x00000B2			
#define  IOCTL_GPD_READ_PORT				0x00000B3			
#define  IOCTL_GPE_READ_PORT				0x00000B4			
#define  IOCTL_GPF_READ_PORT				0x00000B5			
#define  IOCTL_GPG_READ_PORT				0x00000B6			
#define  IOCTL_GPH_READ_PORT				0x00000B7			

		
/* read Px's all port's set */
#define  IOCTL_GPIO_READ_ALL_PORT			0x00000C0			
#define  IOCTL_GPA_READ_ALL_PORT			0x00000C0			
#define  IOCTL_GPB_READ_ALL_PORT			0x00000C1			
#define  IOCTL_GPC_READ_ALL_PORT			0x00000C2			
#define  IOCTL_GPD_READ_ALL_PORT			0x00000C3			
#define  IOCTL_GPE_READ_ALL_PORT			0x00000C4			
#define  IOCTL_GPF_READ_ALL_PORT			0x00000C5			
#define  IOCTL_GPG_READ_ALL_PORT			0x00000C6			
#define  IOCTL_GPH_READ_ALL_PORT			0x00000C7			


#ifdef __cplusplus
}
#endif

#endif // __EINT1KEY_H__

⌨️ 快捷键说明

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