00001
00002
00003
00004
00005
00006
00007 #ifndef GPIO_H_
00008 #define GPIO_H_
00009
00010
00011 #include "LPC11xx.h"
00012
00013
00014
00015
00016 static LPC_GPIO_TypeDef (* const LPC_GPIO[4]) = { LPC_GPIO0, LPC_GPIO1, LPC_GPIO2, LPC_GPIO3 };
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #define C17 (100)
00035 #define C18 (101)
00036 #define C21 (102)
00037 #define C22 (103)
00038 #define C23 (104)
00039 #define C24 (105)
00040 #define C25 (106)
00041 #define C26 (107)
00042 #define C27 (108)
00043 #define C28 (109)
00044 #define C31 (110)
00045 #define C32 (111)
00046 #define C33 (112)
00047 #define C34 (113)
00048 #define C35 (114)
00049 #define C36 (115)
00050 #define C37 (116)
00051 #define C38 (117)
00052 #define C41 (118)
00053 #define C42 (119)
00054 #define C43 (120)
00055 #define C44 (121)
00056 #define C45 (122)
00057 #define C46 (123)
00058 #define C47 (124)
00059 #define GLED (125)
00060 #define BLED (126)
00061 #define RLED (127)
00062
00063 #define _BIT0 (1U << 0)
00064 #define _BIT1 (1U << 1)
00065 #define _BIT2 (1U << 2)
00066 #define _BIT3 (1U << 3)
00067 #define _BIT4 (1U << 4)
00068 #define _BIT5 (1U << 5)
00069 #define _BIT6 (1U << 6)
00070 #define _BIT7 (1U << 7)
00071 #define _BIT8 (1U << 8)
00072 #define _BIT9 (1U << 9)
00073 #define _BIT10 (1U << 10)
00074 #define _BIT11 (1U << 11)
00075
00076 const unsigned int mary_pinAssign[] =
00077 {
00078 1, _BIT2,
00079 1, _BIT1,
00080
00081 1, _BIT4,
00082 1, _BIT11,
00083 1, _BIT7,
00084 1, _BIT5,
00085 3, _BIT2,
00086 2, _BIT0,
00087 1, _BIT6,
00088 0, _BIT1,
00089
00090 1, _BIT8,
00091 0, _BIT3,
00092 0, _BIT2,
00093 3, _BIT4,
00094 0, _BIT4,
00095 3, _BIT5,
00096 0, _BIT5,
00097 1, _BIT7,
00098
00099 1, _BIT9,
00100 1, _BIT10,
00101 0, _BIT6,
00102 0, _BIT11,
00103 0, _BIT8,
00104 1, _BIT0,
00105 0, _BIT9,
00106 0, _BIT7,
00107 1, _BIT5,
00108 2, _BIT0
00109 };
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 typedef enum {INPUT, OUTPUT}pinModeState;
00120 typedef enum {LOW, HIGH}digitalWriteState;
00121
00122 void pinMode(int pin,pinModeState state);
00123 void digitalWrite(int pin,digitalWriteState state);
00124 int digitalRead(int pin);
00125
00126
00127
00128
00129 #endif