Firmware SDK
twr_gpio.h
1 #ifndef _TWR_GPIO_H
2 #define _TWR_GPIO_H
3 
4 #include <twr_common.h>
5 
9 
11 
12 typedef enum
13 {
16 
19 
22 
25 
28 
31 
34 
37 
40 
43 
46 
49 
52 
55 
58 
61 
64 
67 
70 
73 
76 
79 
82 
84 
86 
87 typedef enum
88 {
91 
94 
97 
99 
101 
102 typedef enum
103 {
106 
109 
112 
115 
118 
121 
124 
127 
130 
133 
136 
139 
142 
144 
147 
148 void twr_gpio_init(twr_gpio_channel_t channel);
149 
153 
155 
159 
161 
165 
167 
171 
173 
177 
179 
183 
184 void twr_gpio_set_output(twr_gpio_channel_t channel, int state);
185 
189 
191 
194 
196 
198 
199 #endif // _TWR_GPIO_H
void twr_gpio_set_mode(twr_gpio_channel_t channel, twr_gpio_mode_t mode)
Set mode of operation for GPIO channel.
Definition: twr_gpio.c:367
GPIO channel operates in alternate mode AF6.
Definition: twr_gpio.h:138
int twr_gpio_get_output(twr_gpio_channel_t channel)
Get output state for GPIO channel.
Definition: twr_gpio.c:477
GPIO channel P0, A0, TXD0.
Definition: twr_gpio.h:15
GPIO channel P17, SDA1.
Definition: twr_gpio.h:66
int twr_gpio_get_input(twr_gpio_channel_t channel)
Get input state for GPIO channel.
Definition: twr_gpio.c:465
GPIO channel operates as output.
Definition: twr_gpio.h:108
GPIO channel BUTTON.
Definition: twr_gpio.h:72
GPIO channel P3, A3, RXD1.
Definition: twr_gpio.h:24
GPIO channel P7, A6.
Definition: twr_gpio.h:36
void twr_gpio_set_pull(twr_gpio_channel_t channel, twr_gpio_pull_t pull)
Set pull-up/pull-down configuration for GPIO channel.
Definition: twr_gpio.c:340
GPIO channel P14, SCLK.
Definition: twr_gpio.h:57
GPIO channel P9.
Definition: twr_gpio.h:42
GPIO channel operates in alternate mode AF5.
Definition: twr_gpio.h:135
GPIO channel operates in analog mode.
Definition: twr_gpio.h:114
GPIO channel operates in alternate mode AF7.
Definition: twr_gpio.h:141
GPIO channel operates in alternate mode AF0.
Definition: twr_gpio.h:120
GPIO channel P8.
Definition: twr_gpio.h:39
GPIO channel SCL0.
Definition: twr_gpio.h:78
GPIO channel has no pull-up/pull-down.
Definition: twr_gpio.h:90
GPIO channel SDA0.
Definition: twr_gpio.h:81
GPIO channel INT.
Definition: twr_gpio.h:75
GPIO channel operates in alternate mode AF3.
Definition: twr_gpio.h:129
void twr_gpio_toggle_output(twr_gpio_channel_t channel)
Toggle output state for GPIO channel.
Definition: twr_gpio.c:483
GPIO channel has pull-up.
Definition: twr_gpio.h:93
GPIO channel P13, MOSI.
Definition: twr_gpio.h:54
GPIO channel P6.
Definition: twr_gpio.h:33
GPIO channel P16, SCL1.
Definition: twr_gpio.h:63
void twr_gpio_init(twr_gpio_channel_t channel)
Initialize GPIO channel.
Definition: twr_gpio.c:325
GPIO channel operates in alternate mode AF1.
Definition: twr_gpio.h:123
GPIO channel operates in alternate mode.
Definition: twr_gpio.h:111
GPIO channel operates in alternate mode AF4.
Definition: twr_gpio.h:132
GPIO channel P10, RXD2.
Definition: twr_gpio.h:45
twr_gpio_channel_t
GPIO channels.
Definition: twr_gpio.h:12
twr_gpio_pull_t
GPIO pull-up/pull-down setting.
Definition: twr_gpio.h:87
twr_gpio_mode_t
GPIO mode of operation.
Definition: twr_gpio.h:102
GPIO channel P2, A2, TXD1.
Definition: twr_gpio.h:21
twr_gpio_mode_t twr_gpio_get_mode(twr_gpio_channel_t channel)
Get mode of operation for GPIO channel.
Definition: twr_gpio.c:428
GPIO channel operates in alternate mode AF2.
Definition: twr_gpio.h:126
GPIO channel P4, A4, DAC0.
Definition: twr_gpio.h:27
GPIO channel P15, CS.
Definition: twr_gpio.h:60
void twr_gpio_set_output(twr_gpio_channel_t channel, int state)
Set output state for GPIO channel.
Definition: twr_gpio.c:471
GPIO channel P1, A1, RXD0.
Definition: twr_gpio.h:18
GPIO channel P12, MISO.
Definition: twr_gpio.h:51
GPIO channel operates as input.
Definition: twr_gpio.h:105
twr_gpio_pull_t twr_gpio_get_pull(twr_gpio_channel_t channel)
Get pull-up/pull-down configuration for GPIO channel.
Definition: twr_gpio.c:361
GPIO channel has pull-down.
Definition: twr_gpio.h:96
GPIO channel operates as open-drain output.
Definition: twr_gpio.h:117
GPIO channel P5, A5, DAC1.
Definition: twr_gpio.h:30
GPIO channel LED.
Definition: twr_gpio.h:69
GPIO channel P11, TXD2.
Definition: twr_gpio.h:48