Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_gpio.h
1 #ifndef _BC_GPIO_H
2 #define _BC_GPIO_H
3 
4 #include <bc_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 
78 
80 
81 typedef enum
82 {
85 
88 
91 
93 
95 
96 typedef enum
97 {
100 
103 
106 
109 
112 
114  BC_GPIO_MODE_ALTERNATE_0 = (0 << 4) | 2,
115 
117  BC_GPIO_MODE_ALTERNATE_1 = (1 << 4) | 2,
118 
120  BC_GPIO_MODE_ALTERNATE_2 = (2 << 4) | 2,
121 
123  BC_GPIO_MODE_ALTERNATE_3 = (3 << 4) | 2,
124 
126  BC_GPIO_MODE_ALTERNATE_4 = (4 << 4) | 2,
127 
129  BC_GPIO_MODE_ALTERNATE_5 = (5 << 4) | 2,
130 
132  BC_GPIO_MODE_ALTERNATE_6 = (6 << 4) | 2,
133 
136 
138 
141 
142 void bc_gpio_init(bc_gpio_channel_t channel);
143 
147 
149 
153 
155 
159 
161 
165 
167 
171 
173 
177 
178 void bc_gpio_set_output(bc_gpio_channel_t channel, int state);
179 
183 
185 
188 
190 
192 
193 #endif // _BC_GPIO_H
GPIO channel P5.
Definition: bc_gpio.h:30
GPIO channel has no pull-up/pull-down.
Definition: bc_gpio.h:84
GPIO channel P14.
Definition: bc_gpio.h:57
GPIO channel LED.
Definition: bc_gpio.h:69
int bc_gpio_get_output(bc_gpio_channel_t channel)
Get output state for GPIO channel.
Definition: bc_gpio.c:448
GPIO channel has pull-up.
Definition: bc_gpio.h:87
GPIO channel P16.
Definition: bc_gpio.h:63
GPIO channel operates in alternate mode AF6.
Definition: bc_gpio.h:132
GPIO channel P17.
Definition: bc_gpio.h:66
void bc_gpio_set_output(bc_gpio_channel_t channel, int state)
Set output state for GPIO channel.
Definition: bc_gpio.c:442
GPIO channel operates in alternate mode AF2.
Definition: bc_gpio.h:120
bc_gpio_mode_t bc_gpio_get_mode(bc_gpio_channel_t channel)
Get mode of operation for GPIO channel.
Definition: bc_gpio.c:399
GPIO channel operates in alternate mode AF1.
Definition: bc_gpio.h:117
bc_gpio_pull_t bc_gpio_get_pull(bc_gpio_channel_t channel)
Get pull-up/pull-down configuration for GPIO channel.
Definition: bc_gpio.c:334
void bc_gpio_set_mode(bc_gpio_channel_t channel, bc_gpio_mode_t mode)
Set mode of operation for GPIO channel.
Definition: bc_gpio.c:340
void bc_gpio_set_pull(bc_gpio_channel_t channel, bc_gpio_pull_t pull)
Set pull-up/pull-down configuration for GPIO channel.
Definition: bc_gpio.c:313
GPIO channel P13.
Definition: bc_gpio.h:54
bc_gpio_pull_t
GPIO pull-up/pull-down setting.
Definition: bc_gpio.h:81
GPIO channel P10.
Definition: bc_gpio.h:45
int bc_gpio_get_input(bc_gpio_channel_t channel)
Get input state for GPIO channel.
Definition: bc_gpio.c:436
GPIO channel P2.
Definition: bc_gpio.h:21
GPIO channel P8.
Definition: bc_gpio.h:39
GPIO channel operates as input.
Definition: bc_gpio.h:99
GPIO channel operates in alternate mode AF0.
Definition: bc_gpio.h:114
GPIO channel P6.
Definition: bc_gpio.h:33
GPIO channel BUTTON.
Definition: bc_gpio.h:72
GPIO channel P11.
Definition: bc_gpio.h:48
GPIO channel has pull-down.
Definition: bc_gpio.h:90
void bc_gpio_toggle_output(bc_gpio_channel_t channel)
Toggle output state for GPIO channel.
Definition: bc_gpio.c:454
GPIO channel P1.
Definition: bc_gpio.h:18
GPIO channel operates in alternate mode AF7.
Definition: bc_gpio.h:135
GPIO channel P9.
Definition: bc_gpio.h:42
bc_gpio_channel_t
GPIO channels.
Definition: bc_gpio.h:12
GPIO channel operates in alternate mode AF4.
Definition: bc_gpio.h:126
GPIO channel operates in alternate mode.
Definition: bc_gpio.h:105
GPIO channel P3.
Definition: bc_gpio.h:24
GPIO channel operates as open-drain output.
Definition: bc_gpio.h:111
GPIO channel P0.
Definition: bc_gpio.h:15
GPIO channel P15.
Definition: bc_gpio.h:60
GPIO channel operates in alternate mode AF5.
Definition: bc_gpio.h:129
GPIO channel operates in analog mode.
Definition: bc_gpio.h:108
GPIO channel P12.
Definition: bc_gpio.h:51
GPIO channel P4.
Definition: bc_gpio.h:27
void bc_gpio_init(bc_gpio_channel_t channel)
Initialize GPIO channel.
Definition: bc_gpio.c:301
GPIO channel BUTTON.
Definition: bc_gpio.h:75
GPIO channel operates as output.
Definition: bc_gpio.h:102
GPIO channel operates in alternate mode AF3.
Definition: bc_gpio.h:123
GPIO channel P7.
Definition: bc_gpio.h:36
bc_gpio_mode_t
GPIO mode of operation.
Definition: bc_gpio.h:96