17 #ifndef LIBBSP_ARM_LM3S69XX_IO_H 18 #define LIBBSP_ARM_LM3S69XX_IO_H 31 LM3S69XX_GPIO_DIRECTION_INPUT,
32 LM3S69XX_GPIO_DIRECTION_OUTPUT
33 } lm3s69xx_gpio_direction;
36 LM3S69XX_GPIO_OTYPE_PUSH_PULL,
37 LM3S69XX_GPIO_OTYPE_OPEN_DRAIN
38 } lm3s69xx_gpio_otype;
41 LM3S69XX_GPIO_DRIVE_2MA,
42 LM3S69XX_GPIO_DRIVE_4MA,
43 LM3S69XX_GPIO_DRIVE_8MA
44 } lm3s69xx_gpio_drive;
47 LM3S69XX_GPIO_NO_PULL,
48 LM3S69XX_GPIO_PULL_UP,
49 LM3S69XX_GPIO_PULL_DOWN
53 LM3S69XX_GPIO_DIGITAL_DISABLE,
54 LM3S69XX_GPIO_DIGITAL_ENABLE,
55 } lm3s69xx_gpio_digital;
58 LM3S69XX_GPIO_AF_DISABLE,
59 LM3S69XX_GPIO_AF_ENABLE
63 LM3S69XX_GPIO_ANALOG_DISABLE,
64 LM3S69XX_GPIO_ANALOG_ENABLE
65 } lm3s69xx_gpio_analog;
68 LM3S69XX_GPIO_NO_SLEW_RATE_CONTROL,
69 LM3S69XX_GPIO_SLEW_RATE_CONTROL
70 } lm3s69xx_gpio_slew_rate_control;
73 unsigned int pin_first : 8;
74 unsigned int pin_last : 8;
75 unsigned int digital : 1;
76 unsigned int alternate : 1;
77 unsigned int analog : 1;
79 unsigned int otype : 1;
80 unsigned int drive : 2;
81 unsigned int pull : 2;
93 #if LM3S69XX_NUM_GPIO_BLOCKS > 7 98 #define LM3S69XX_GPIO_PIN(port, idx) (((port) << 3) | (idx)) 99 #define LM3S69XX_GPIO_PORT_OF_PIN(pin) (((pin) >> 3) & 0xf) 100 #define LM3S69XX_GPIO_INDEX_OF_PIN(pin) ((pin) & 0x7) 102 #define LM3S69XX_PIN_UART_TX(port, idx) \ 104 .pin_first = LM3S69XX_GPIO_PIN(port, idx), \ 105 .pin_last = LM3S69XX_GPIO_PIN(port, idx), \ 106 .digital = LM3S69XX_GPIO_DIGITAL_ENABLE, \ 107 .alternate = LM3S69XX_GPIO_AF_ENABLE, \ 108 .analog = LM3S69XX_GPIO_ANALOG_DISABLE, \ 109 .dir = LM3S69XX_GPIO_DIRECTION_OUTPUT, \ 110 .otype = LM3S69XX_GPIO_OTYPE_PUSH_PULL, \ 111 .drive = LM3S69XX_GPIO_DRIVE_2MA, \ 112 .pull = LM3S69XX_GPIO_NO_PULL, \ 113 .slr = LM3S69XX_GPIO_NO_SLEW_RATE_CONTROL \ 116 #define LM3S69XX_PIN_UART_RX(port, idx) \ 118 .pin_first = LM3S69XX_GPIO_PIN(port, idx), \ 119 .pin_last = LM3S69XX_GPIO_PIN(port, idx), \ 120 .digital = LM3S69XX_GPIO_DIGITAL_ENABLE, \ 121 .alternate = LM3S69XX_GPIO_AF_ENABLE, \ 122 .analog = LM3S69XX_GPIO_ANALOG_DISABLE, \ 123 .dir = LM3S69XX_GPIO_DIRECTION_INPUT, \ 124 .otype = LM3S69XX_GPIO_OTYPE_PUSH_PULL, \ 125 .drive = LM3S69XX_GPIO_DRIVE_2MA, \ 126 .pull = LM3S69XX_GPIO_PULL_UP, \ 127 .slr = LM3S69XX_GPIO_NO_SLEW_RATE_CONTROL \ 130 #define LM3S69XX_PIN_UART_RTS(port, idx) \ 132 .pin_first = LM3S69XX_GPIO_PIN(port, idx), \ 133 .pin_last = LM3S69XX_GPIO_PIN(port, idx), \ 134 .digital = LM3S69XX_GPIO_DIGITAL_ENABLE, \ 135 .alternate = LM3S69XX_GPIO_AF_ENABLE, \ 136 .analog = LM3S69XX_GPIO_ANALOG_DISABLE, \ 137 .dir = LM3S69XX_GPIO_DIRECTION_OUTPUT, \ 138 .otype = LM3S69XX_GPIO_OTYPE_PUSH_PULL, \ 139 .drive = LM3S69XX_GPIO_DRIVE_2MA, \ 140 .pull = LM3S69XX_GPIO_NO_PULL, \ 141 .slr = LM3S69XX_GPIO_NO_SLEW_RATE_CONTROL \ 144 #define LM3S69XX_PIN_UART_CTS(port, idx) \ 146 .pin_first = LM3S69XX_GPIO_PIN(port, idx), \ 147 .pin_last = LM3S69XX_GPIO_PIN(port, idx), \ 148 .digital = LM3S69XX_GPIO_DIGITAL_ENABLE, \ 149 .alternate = LM3S69XX_GPIO_AF_ENABLE, \ 150 .analog = LM3S69XX_GPIO_ANALOG_DISABLE, \ 151 .dir = LM3S69XX_GPIO_DIRECTION_INPUT, \ 152 .otype = LM3S69XX_GPIO_OTYPE_PUSH_PULL, \ 153 .drive = LM3S69XX_GPIO_DRIVE_2MA, \ 154 .pull = LM3S69XX_GPIO_PULL_UP, \ 155 .slr = LM3S69XX_GPIO_NO_SLEW_RATE_CONTROL \ 158 #define LM3S69XX_PIN_LED(port, idx) \ 160 .pin_first = LM3S69XX_GPIO_PIN(port, idx), \ 161 .pin_last = LM3S69XX_GPIO_PIN(port, idx), \ 162 .digital = LM3S69XX_GPIO_DIGITAL_ENABLE, \ 163 .alternate = LM3S69XX_GPIO_AF_DISABLE, \ 164 .analog = LM3S69XX_GPIO_ANALOG_DISABLE, \ 165 .dir = LM3S69XX_GPIO_DIRECTION_OUTPUT, \ 166 .otype = LM3S69XX_GPIO_OTYPE_PUSH_PULL, \ 167 .drive = LM3S69XX_GPIO_DRIVE_8MA, \ 168 .pull = LM3S69XX_GPIO_NO_PULL, \ 169 .slr = LM3S69XX_GPIO_SLEW_RATE_CONTROL \ 172 #define LM3S69XX_PIN_SSI_TX(port, idx) LM3S69XX_PIN_UART_TX(port, idx) 173 #define LM3S69XX_PIN_SSI_RX(port, idx) LM3S69XX_PIN_UART_RX(port, idx) 184 void lm3s69xx_gpio_set_pin(
unsigned int pin,
bool set);
185 bool lm3s69xx_gpio_get_pin(
unsigned int pin);
Definition: deflate.c:115
void lm3s69xx_gpio_digital_enable(unsigned int pin, bool enable)
Definition: io.c:99
void lm3s69xx_gpio_analog_mode_select(unsigned int pin, bool enable)
Definition: io.c:114