1 #pragma once
2 
3 /* helper defines for Stellaris platforms */
4 
5 /* flag to gpio_configure */
6 #define GPIO_STELLARIS_OD (0x1 << 12)
7 #define GPIO_STELLARIS_AF_ENABLE (0x2 << 12)
8 
9 #define GPIO_STELLARIS_AF(x) (((x) & 0xf) << 8)
10 
11 /* gpio port/pin is packed into a single unsigned int in 20x:4alternatefunc:4port:4pin format */
12 #define GPIO(port, pin) ((unsigned int)(((port) << 4) | (pin)))
13 
14 #define GPIO_PORT(gpio) (((gpio) >> 4) & 0xf)
15 #define GPIO_PIN(gpio) ((gpio) & 0xf)
16 
17 #define GPIO_PORT_A 0
18 #define GPIO_PORT_B 1
19 #define GPIO_PORT_C 2
20 #define GPIO_PORT_D 3
21 #define GPIO_PORT_E 4
22 #define GPIO_PORT_F 5
23 #define GPIO_PORT_G 6
24 #define GPIO_PORT_H 7
25 /* discontinuity */
26 #define GPIO_PORT_J 8
27 #define GPIO_PORT_K 9
28 #define GPIO_PORT_L 10
29 #define GPIO_PORT_M 11
30 #define GPIO_PORT_N 12
31 /* discontinuity */
32 #define GPIO_PORT_P 13
33 #define GPIO_PORT_Q 14
34 
35