34#define GPIO_PIN_MAX 16
40#define GPIO_MODE_INPUT 0x0UL
41#define GPIO_MODE_OUTPUT 0x1UL
42#define GPIO_MODE_OPEN_DRAIN 0x2UL
43#define GPIO_MODE_QUASI 0x3UL
49#define GPIO_INT_RISING 0x00010000UL
50#define GPIO_INT_FALLING 0x00000001UL
51#define GPIO_INT_BOTH_EDGE 0x00010001UL
52#define GPIO_INT_HIGH 0x01010000UL
53#define GPIO_INT_LOW 0x01000001UL
59#define GPIO_INTTYPE_EDGE 0UL
60#define GPIO_INTTYPE_LEVEL 1UL
66#define GPIO_DBCTL_ICLK_ON 0x00000020UL
67#define GPIO_DBCTL_ICLK_OFF 0x00000000UL
69#define GPIO_DBCTL_DBCLKSRC_LIRC 0x00000010UL
70#define GPIO_DBCTL_DBCLKSRC_HCLK 0x00000000UL
72#define GPIO_DBCTL_DBCLKSEL_1 0x00000000UL
73#define GPIO_DBCTL_DBCLKSEL_2 0x00000001UL
74#define GPIO_DBCTL_DBCLKSEL_4 0x00000002UL
75#define GPIO_DBCTL_DBCLKSEL_8 0x00000003UL
76#define GPIO_DBCTL_DBCLKSEL_16 0x00000004UL
77#define GPIO_DBCTL_DBCLKSEL_32 0x00000005UL
78#define GPIO_DBCTL_DBCLKSEL_64 0x00000006UL
79#define GPIO_DBCTL_DBCLKSEL_128 0x00000007UL
80#define GPIO_DBCTL_DBCLKSEL_256 0x00000008UL
81#define GPIO_DBCTL_DBCLKSEL_512 0x00000009UL
82#define GPIO_DBCTL_DBCLKSEL_1024 0x0000000AUL
83#define GPIO_DBCTL_DBCLKSEL_2048 0x0000000BUL
84#define GPIO_DBCTL_DBCLKSEL_4096 0x0000000CUL
85#define GPIO_DBCTL_DBCLKSEL_8192 0x0000000DUL
86#define GPIO_DBCTL_DBCLKSEL_16384 0x0000000EUL
87#define GPIO_DBCTL_DBCLKSEL_32768 0x0000000FUL
104#define GPIO_PIN_DATA(port, pin) (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2))))
105#define PA0 GPIO_PIN_DATA(0, 0 )
106#define PA1 GPIO_PIN_DATA(0, 1 )
107#define PA2 GPIO_PIN_DATA(0, 2 )
108#define PA3 GPIO_PIN_DATA(0, 3 )
109#define PB0 GPIO_PIN_DATA(1, 0 )
110#define PB1 GPIO_PIN_DATA(1, 1 )
111#define PB2 GPIO_PIN_DATA(1, 2 )
112#define PB3 GPIO_PIN_DATA(1, 3 )
113#define PB4 GPIO_PIN_DATA(1, 4 )
114#define PB5 GPIO_PIN_DATA(1, 5 )
115#define PB6 GPIO_PIN_DATA(1, 6 )
116#define PB7 GPIO_PIN_DATA(1, 7 )
117#define PB8 GPIO_PIN_DATA(1, 8 )
118#define PB11 GPIO_PIN_DATA(1, 11)
119#define PB12 GPIO_PIN_DATA(1, 12)
120#define PB15 GPIO_PIN_DATA(1, 15)
121#define PC0 GPIO_PIN_DATA(2, 0 )
122#define PC1 GPIO_PIN_DATA(2, 1 )
123#define PC2 GPIO_PIN_DATA(2, 2 )
124#define PC3 GPIO_PIN_DATA(2, 3 )
125#define PC4 GPIO_PIN_DATA(2, 4 )
126#define PC5 GPIO_PIN_DATA(2, 5 )
127#define PC6 GPIO_PIN_DATA(2, 6 )
128#define PC7 GPIO_PIN_DATA(2, 7 )
129#define PD0 GPIO_PIN_DATA(3, 0 )
130#define PD1 GPIO_PIN_DATA(3, 1 )
131#define PD2 GPIO_PIN_DATA(3, 2 )
132#define PD3 GPIO_PIN_DATA(3, 3 )
133#define PD7 GPIO_PIN_DATA(3, 7 )
134#define PD8 GPIO_PIN_DATA(3, 8 )
135#define PD9 GPIO_PIN_DATA(3, 9 )
136#define PD12 GPIO_PIN_DATA(3, 12)
137#define PD13 GPIO_PIN_DATA(3, 13)
138#define PD14 GPIO_PIN_DATA(3, 14)
139#define PD15 GPIO_PIN_DATA(3, 15)
140#define PE0 GPIO_PIN_DATA(4, 0 )
141#define PE8 GPIO_PIN_DATA(4, 8 )
142#define PE9 GPIO_PIN_DATA(4, 9 )
143#define PE10 GPIO_PIN_DATA(4, 10)
144#define PE11 GPIO_PIN_DATA(4, 11)
145#define PE12 GPIO_PIN_DATA(4, 12)
146#define PE13 GPIO_PIN_DATA(4, 13)
147#define PF0 GPIO_PIN_DATA(5, 0 )
148#define PF1 GPIO_PIN_DATA(5, 1 )
149#define PF2 GPIO_PIN_DATA(5, 2 )
150#define PF3 GPIO_PIN_DATA(5, 3 )
151#define PF4 GPIO_PIN_DATA(5, 4 )
152#define PF5 GPIO_PIN_DATA(5, 5 )
153#define PF6 GPIO_PIN_DATA(5, 6 )
154#define PF7 GPIO_PIN_DATA(5, 7 )
177#define GPIO_CLR_INT_FLAG(port, u32PinMask) ((port)->INTSRC = (u32PinMask))
192#define GPIO_DISABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN &= ~(u32PinMask))
206#define GPIO_ENABLE_DEBOUNCE(port, u32PinMask) ((port)->DBEN |= (u32PinMask))
221#define GPIO_DISABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF |= ((u32PinMask)<<16))
236#define GPIO_ENABLE_DIGITAL_PATH(port, u32PinMask) ((port)->DINOFF &= ~((u32PinMask)<<16))
251#define GPIO_DISABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK &= ~(u32PinMask))
266#define GPIO_ENABLE_DOUT_MASK(port, u32PinMask) ((port)->DATMSK |= (u32PinMask))
282#define GPIO_GET_INT_FLAG(port, u32PinMask) ((port)->INTSRC & (u32PinMask))
314#define GPIO_SET_DEBOUNCE_TIME(u32ClkSrc, u32ClkSel) (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | (u32ClkSrc) | (u32ClkSel)))
325#define GPIO_GET_IN_DATA(port) ((port)->PIN)
337#define GPIO_SET_OUT_DATA(port, u32Data) ((port)->DOUT = (u32Data))
348#define GPIO_TOGGLE(u32Pin) ((u32Pin) ^= 1)
366#define GPIO_EnableEINT GPIO_EnableInt
381#define GPIO_DisableEINT GPIO_DisableInt
void GPIO_EnableInt(GPIO_T *port, uint32_t u32Pin, uint32_t u32IntAttribs)
Enable GPIO interrupt.
void GPIO_DisableInt(GPIO_T *port, uint32_t u32Pin)
Disable GPIO interrupt.
void GPIO_SetMode(GPIO_T *port, uint32_t u32PinMask, uint32_t u32Mode)
Set GPIO operation mode.