pxa255_gpio.h

来自「老外的一个开源项目」· C头文件 代码 · 共 497 行 · 第 1/2 页

H
497
字号
// Copyright (c) David Vescovi.  All rights reserved.
// Part of Project DrumStix
// Windows Embedded Developers Interest Group (WE-DIG) community project.
// http://www.we-dig.org
// Copyright (c) Microsoft Corporation.  All rights reserved.
//------------------------------------------------------------------------------
//
//  Header: pxa255_gpio.h
//
//  Defines the general-purpose I/O (GPIO) register layout and associated types 
//  and constants.
//
//------------------------------------------------------------------------------
#ifndef _PXA255_GPIO_H_
#define _PXA255_GPIO_H_

#if __cplusplus
extern "C" {
#endif

//------------------------------------------------------------------------------
//
//  Type:  GPIO_REG_T
//
//  Defines the GPIO control register layout.
//
//------------------------------------------------------------------------------

//
//  GPIO Register Definitions
//
typedef struct 
{
	VUINT32_T GPLR0;			/* Level Detect Reg. Bank 0 */
	VUINT32_T GPLR1;			/* Level Detect Reg. Bank 1 */
	VUINT32_T GPLR2;			/* Level Detect Reg. Bank 2 */
	VUINT32_T GPDR0;			/* Data Direction Reg. Bank 0 */
	VUINT32_T GPDR1;			/* Data Direction Reg. Bank 1 */
	VUINT32_T GPDR2;			/* Data Direction Reg. Bank 2 */
	VUINT32_T GPSR0;			/* Pin Output Set Reg. Bank 0 */
	VUINT32_T GPSR1;			/* Pin Output Set Reg. Bank 1 */
	VUINT32_T GPSR2;			/* Pin Output Set Reg. Bank 2 */
	VUINT32_T GPCR0;			/* Pin Output Clr Reg. Bank 0 */
	VUINT32_T GPCR1;			/* Pin Output Clr Reg. Bank 1 */
	VUINT32_T GPCR2;			/* Pin Output Clr Reg. Bank 2 */
	VUINT32_T GRER0;			/* Ris. Edge Detect Enable Reg. Bank 0 */
	VUINT32_T GRER1;			/* Ris. Edge Detect Enable Reg. Bank 1 */
	VUINT32_T GRER2;			/* Ris. Edge Detect Enable Reg. Bank 2 */
	VUINT32_T GFER0;			/* Fal. Edge Detect Enable Reg. Bank 0 */
	VUINT32_T GFER1;			/* Fal. Edge Detect Enable Reg. Bank 1 */
	VUINT32_T GFER2;			/* Fal. Edge Detect Enable Reg. Bank 2 */
	VUINT32_T GEDR0;			/* Edge Detect Status Reg. Bank 0 */
	VUINT32_T GEDR1;			/* Edge Detect Status Reg. Bank 1 */
	VUINT32_T GEDR2;			/* Edge Detect Status Reg. Bank 2 */
	VUINT32_T GAFR0_L;			/* Alt. Function Select Reg.[  0:15 ] */
	VUINT32_T GAFR0_U;			/* Alt. Function Select Reg.[ 16:31 ] */
	VUINT32_T GAFR1_L;			/* Alt. Function Select Reg.[ 32:47 ] */
	VUINT32_T GAFR1_U;			/* Alt. Function Select Reg.[ 48:63 ] */
	VUINT32_T GAFR2_L;			/* Alt. Function Select Reg.[ 64:79 ] */
	VUINT32_T GAFR2_U;			/* Alt. Function Select Reg.[ 80:84 ] */

} GPIO_REG_T, *PGPIO_REG_T;


//
// For use with GPIO registers GPLR0, GPSR0, GPCR0, GPDR0, GRER0, GFER0, GEDR0
//
#define GPIO_0      0x00000001
#define GPIO_1      0x00000002
#define GPIO_2      0x00000004
#define GPIO_3      0x00000008
#define GPIO_4      0x00000010
#define GPIO_5      0x00000020
#define GPIO_6      0x00000040
#define GPIO_7      0x00000080
#define GPIO_8      0x00000100
#define GPIO_9      0x00000200
#define GPIO_10     0x00000400
#define GPIO_11     0x00000800
#define GPIO_12     0x00001000
#define GPIO_13     0x00002000
#define GPIO_14     0x00004000
#define GPIO_15     0x00008000
#define GPIO_16     0x00010000
#define GPIO_17     0x00020000
#define GPIO_18     0x00040000
#define GPIO_19     0x00080000
#define GPIO_20     0x00100000
#define GPIO_21     0x00200000
#define GPIO_22     0x00400000
#define GPIO_23     0x00800000
#define GPIO_24     0x01000000
#define GPIO_25     0x02000000
#define GPIO_26     0x04000000
#define GPIO_27     0x08000000
#define GPIO_28     0x10000000
#define GPIO_29     0x20000000
#define GPIO_30     0x40000000
#define GPIO_31     0x80000000

//
// For use with GPIO registers GPLR1, GPSR1, GPCR1, GPDR1, GRER1, GFER1, GEDR1
//
#define GPIO_32     0x00000001
#define GPIO_33     0x00000002
#define GPIO_34     0x00000004
#define GPIO_35     0x00000008
#define GPIO_36     0x00000010
#define GPIO_37     0x00000020
#define GPIO_38     0x00000040
#define GPIO_39     0x00000080
#define GPIO_40     0x00000100
#define GPIO_41     0x00000200
#define GPIO_42     0x00000400
#define GPIO_43     0x00000800
#define GPIO_44     0x00001000
#define GPIO_45     0x00002000
#define GPIO_46     0x00004000
#define GPIO_47     0x00008000
#define GPIO_48     0x00010000
#define GPIO_49     0x00020000
#define GPIO_50     0x00040000
#define GPIO_51     0x00080000
#define GPIO_52     0x00100000
#define GPIO_53     0x00200000
#define GPIO_54     0x00400000
#define GPIO_55     0x00800000
#define GPIO_56     0x01000000
#define GPIO_57     0x02000000
#define GPIO_58     0x04000000
#define GPIO_59     0x08000000
#define GPIO_60     0x10000000
#define GPIO_61     0x20000000
#define GPIO_62     0x40000000
#define GPIO_63     0x80000000

//
// For use with GPIO registers GPLR2, GPSR2, GPCR2, GPDR2, GRER2, GFER2, GEDR2
//
#define GPIO_64     0x00000001
#define GPIO_65     0x00000002
#define GPIO_66     0x00000004
#define GPIO_67     0x00000008
#define GPIO_68     0x00000010
#define GPIO_69     0x00000020
#define GPIO_70     0x00000040
#define GPIO_71     0x00000080
#define GPIO_72     0x00000100
#define GPIO_73     0x00000200
#define GPIO_74     0x00000400
#define GPIO_75     0x00000800
#define GPIO_76     0x00001000
#define GPIO_77     0x00002000
#define GPIO_78     0x00004000
#define GPIO_79     0x00008000
#define GPIO_80     0x00010000
#define GPIO_81     0x00020000
#define GPIO_82     0x00040000
#define GPIO_83     0x00080000
#define GPIO_84     0x00100000

//
// For use with GPIO register GAFR0_L
//
#define GPIO_0_AF1              0x00000001
#define GPIO_1_AF1_GP_RST       0x00000004
#define GPIO_2_AF1              0x00000010
#define GPIO_3_AF1              0x00000040
#define GPIO_4_AF1              0x00000100
#define GPIO_5_AF1              0x00000400
#define GPIO_6_AF1_MMCLK        0x00001000
#define GPIO_7_AF1_48MHzClock   0x00004000
#define GPIO_8_AF1_MMCCS0       0x00010000
#define GPIO_9_AF1_MMCCS1       0x00040000
#define GPIO_10_AF1_RTCCLK      0x00100000
#define GPIO_11_AF1_3P6MHz      0x00400000
#define GPIO_12_AF1_32KHz       0x01000000
#define GPIO_13_AF1             0x04000000
#define GPIO_14_AF1_MBREQ       0x10000000
#define GPIO_15_AF1             0x40000000

//
// For use with GPIO register GAFR0_U
//
#define GPIO_16_AF1             0x00000001
#define GPIO_17_AF1             0x00000004
#define GPIO_18_AF1_RDY         0x00000010
#define GPIO_19_AF1_DREQ1       0x00000040
#define GPIO_20_AF1_DREQ0       0x00000100
#define GPIO_21_AF1             0x00000400
#define GPIO_22_AF1             0x00001000
#define GPIO_23_AF1             0x00004000
#define GPIO_24_AF1             0x00010000
#define GPIO_25_AF1             0x00040000
#define GPIO_26_AF1_RXD         0x00100000
#define GPIO_27_AF1_EXTCLK      0x00400000
#define GPIO_28_AF1_BITCLK      0x01000000
#define GPIO_29_AF1_SDATA_IN0   0x04000000
#define GPIO_30_AF1_SDATA_OUT   0x10000000
#define GPIO_31_AF1_SYNC        0x40000000

//
// For use with GPIO register GAFR1_L
//
#define GPIO_32_AF1_SDATA_IN1   0x00000001
#define GPIO_32_AF1_SYSCLK      0x00000001
#define GPIO_33_AF1             0x00000004
#define GPIO_34_AF1_FFRXD       0x00000010
#define GPIO_35_AF1_CTS         0x00000040
#define GPIO_36_AF1_DCD         0x00000100
#define GPIO_37_AF1_DSR         0x00000400
#define GPIO_38_AF1_RI          0x00001000
#define GPIO_39_AF1_MMCCS1      0x00004000
#define GPIO_40_AF1             0x00010000
#define GPIO_41_AF1             0x00040000
#define GPIO_42_AF1_BTRXD       0x00100000
#define GPIO_43_AF1             0x00400000
#define GPIO_44_AF1_BTCTS       0x01000000
#define GPIO_45_AF1             0x04000000
#define GPIO_46_AF1_ICP_RXD     0x10000000
#define GPIO_47_AF1_TXD         0x40000000

//
// For use with GPIO register GAFR1_U
//
#define GPIO_48_AF1_HWTXD       0x00000001
#define GPIO_49_AF1_HWRXD       0x00000004
#define GPIO_50_AF1_HWCTS       0x00000010
#define GPIO_51_AF1_HWRTS       0x00000040
#define GPIO_52_AF1             0x00000100
#define GPIO_53_AF1_MMCCLK      0x00000400
#define GPIO_54_AF1_MMCCLK      0x00001000
#define GPIO_55_AF1             0x00004000
#define GPIO_56_AF1_nPWAIT      0x00010000
#define GPIO_57_AF1_nIOIS16     0x00040000
#define GPIO_58_AF1             0x00100000
#define GPIO_59_AF1             0x00400000
#define GPIO_60_AF1             0x01000000
#define GPIO_61_AF1             0x04000000
#define GPIO_62_AF1             0x10000000
#define GPIO_63_AF1             0x40000000

//
// For use with GPIO register GAFR2_L
//
#define GPIO_64_AF1             0x00000001
#define GPIO_65_AF1             0x00000004
#define GPIO_66_AF1_MBREQ       0x00000010
#define GPIO_67_AF1_MMCCS0      0x00000040

⌨️ 快捷键说明

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