app_io.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file app_io.h
5 * @author BLE Driver Team
6 * @brief Header file containing functions prototypes of GPIO app library.
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 ****************************************************************************************
36 */
37
38 /** @addtogroup PERIPHERAL Peripheral Driver
39 * @{
40 */
41
42 /** @addtogroup APP_DRIVER APP DRIVER
43 * @{
44 */
45
46 /** @defgroup APP_GPIO GPIO
47 * @brief GPIO APP module driver.
48 * @{
49 */
50
51
52 #ifndef _APP_IO_H_
53 #define _APP_IO_H_
54
55 #include "app_drv_error.h"
56 #include "app_drv_config.h"
57 #include <stdint.h>
58
59 /** @addtogroup APP_GPIO_PIN_DEFINES Defines
60 * @{
61 */
62
63 /** @addtogroup GR5xxx_pins Defines
64 * @{
65 */
66 /**
67 * @brief APP_GPIO_DEFINE IO pins
68 */
69 #define APP_IO_PIN_0 ((uint32_t)0x00000001U) /**< Pin 0 selected */
70 #define APP_IO_PIN_1 ((uint32_t)0x00000002U) /**< Pin 1 selected */
71 #define APP_IO_PIN_2 ((uint32_t)0x00000004U) /**< Pin 2 selected */
72 #define APP_IO_PIN_3 ((uint32_t)0x00000008U) /**< Pin 3 selected */
73 #define APP_IO_PIN_4 ((uint32_t)0x00000010U) /**< Pin 4 selected */
74 #define APP_IO_PIN_5 ((uint32_t)0x00000020U) /**< Pin 5 selected */
75 #define APP_IO_PIN_6 ((uint32_t)0x00000040U) /**< Pin 6 selected */
76 #define APP_IO_PIN_7 ((uint32_t)0x00000080U) /**< Pin 7 selected */
77 #define APP_IO_PIN_8 ((uint32_t)0x00000100U) /**< Pin 8 selected */
78 #define APP_IO_PIN_9 ((uint32_t)0x00000200U) /**< Pin 9 selected */
79 #define APP_IO_PIN_10 ((uint32_t)0x00000400U) /**< Pin 10 selected */
80 #define APP_IO_PIN_11 ((uint32_t)0x00000800U) /**< Pin 11 selected */
81 #define APP_IO_PIN_12 ((uint32_t)0x00001000U) /**< Pin 12 selected */
82 #define APP_IO_PIN_13 ((uint32_t)0x00002000U) /**< Pin 13 selected */
83 #define APP_IO_PIN_14 ((uint32_t)0x00004000U) /**< Pin 14 selected */
84 #define APP_IO_PIN_15 ((uint32_t)0x00008000U) /**< Pin 15 selected */
85 #ifdef APP_IO_GR551X_LEGACY_ENABLE
86 #define APP_IO_PIN_16 ((uint32_t)0x00010000U) /**< Pin 16 selected */
87 #define APP_IO_PIN_17 ((uint32_t)0x00020000U) /**< Pin 17 selected */
88 #define APP_IO_PIN_18 ((uint32_t)0x00040000U) /**< Pin 18 selected */
89 #define APP_IO_PIN_19 ((uint32_t)0x00080000U) /**< Pin 19 selected */
90 #define APP_IO_PIN_20 ((uint32_t)0x00100000U) /**< Pin 20 selected */
91 #define APP_IO_PIN_21 ((uint32_t)0x00200000U) /**< Pin 21 selected */
92 #define APP_IO_PIN_22 ((uint32_t)0x00400000U) /**< Pin 22 selected */
93 #define APP_IO_PIN_23 ((uint32_t)0x00800000U) /**< Pin 23 selected */
94 #define APP_IO_PIN_24 ((uint32_t)0x01000000U) /**< Pin 24 selected */
95 #define APP_IO_PIN_25 ((uint32_t)0x02000000U) /**< Pin 25 selected */
96 #define APP_IO_PIN_26 ((uint32_t)0x04000000U) /**< Pin 26 selected */
97 #define APP_IO_PIN_27 ((uint32_t)0x08000000U) /**< Pin 27 selected */
98 #define APP_IO_PIN_28 ((uint32_t)0x10000000U) /**< Pin 28 selected */
99 #define APP_IO_PIN_29 ((uint32_t)0x20000000U) /**< Pin 29 selected */
100 #define APP_IO_PIN_30 ((uint32_t)0x40000000U) /**< Pin 30 selected */
101 #define APP_IO_PIN_31 ((uint32_t)0x80000000U) /**< Pin 31 selected */
102 #endif
103
104 #define APP_IO_PINS_0_7 ((uint32_t)0x000000FFU) /**< 0~7 pins selected */
105 #define APP_IO_PINS_0_15 ((uint32_t)0x0000FFFFU) /**< 0~15 pins selected */
106 #define APP_IO_PINS_16_31 ((uint32_t)0xFFFF0000U) /**< 16~31 pins selected */
107 #define APP_AON_IO_PIN_ALL ((uint32_t)0x000000FFU) /**< All AON pins selected */
108 #define APP_IO_PIN_ALL ((uint32_t)0x0000FFFFU) /**< All pins selected */
109 #define APP_MSIO_IO_PIN_ALL ((uint32_t)0x000000FFU) /**< All MISO pins selected */
110 #define APP_IO_PIN_MASK ((uint32_t)0xFFFFFFFFU) /**< PIN mask for assert test */
111
112 /**
113 * @brief GR5xxx_APP_GPIO_default_config initStruct default config of APP_GPIOn
114 */
115 #define APP_IO_DEFAULT_CONFIG \
116 { \
117 .pin = APP_IO_PIN_ALL, \
118 .mode = APP_IO_MODE_INPUT, \
119 .pull = APP_IO_PULLDOWN, \
120 }
121
122 /** @} */
123
124 /** @} */
125
126 /** @addtogroup APP_GPIO_ENUMERATIONS Enumerations
127 * @{
128 */
129 /**
130 * @brief GPIO state Enumerations definition
131 */
132 typedef enum
133 {
134 APP_IO_PIN_RESET, /**< IO pin low level. */
135 APP_IO_PIN_SET, /**< IO pin high level. */
136 } app_io_pin_state_t;
137
138 /**
139 * @brief GPIO type Enumerations definition
140 */
141 typedef enum
142 {
143 APP_IO_TYPE_GPIOA, /**< General Purpose Input/Output. */
144 APP_IO_TYPE_GPIOB, /**< General Purpose Input/Output. */
145 APP_IO_TYPE_GPIOC, /**< General Purpose Input/Output. */
146 APP_IO_TYPE_AON, /**< Always-on Input/Output. */
147 APP_IO_TYPE_MSIO, /**< Mixed Signal I/O. */
148 APP_IO_TYPE_NORMAL, /**< General Purpose Input/Output. */
149 APP_IO_TYPE_MAX, /**< Only for check parameter, not used as input parameters. */
150 } app_io_type_t;
151
152 /**
153 * @brief GPIO mode Enumerations definition
154 */
155 typedef enum
156 {
157 APP_IO_MODE_NONE,
158 APP_IO_MODE_INPUT, /**< Input Mode. */
159 APP_IO_MODE_OUTPUT, /**< Output Mode. */
160 APP_IO_MODE_MUX, /**< Mux Mode. */
161 APP_IO_MODE_IT_RISING, /**< Interrupt Mode with Rising edge trigger detection. */
162 APP_IO_MODE_IT_FALLING, /**< Interrupt Mode with Falling edge trigger detection. */
163 #ifdef APP_IO_IT_BOTH_EDGE_ENABLE
164 APP_IO_MODE_IT_BOTH_EDGE, /**< Interrupt Mode with Rising and Falling edge trigger detection */
165 #endif
166 APP_IO_MODE_IT_HIGH, /**< Interrupt Mode with High-level trigger detection. */
167 APP_IO_MODE_IT_LOW, /**< Interrupt Mode with Low-level trigger detection. */
168 APP_IO_MODE_ANALOG, /**< Analog IO Mode. */
169 APP_IO_MODE_MAX, /**< Only for check parameter, not used as input parameters. */
170 } app_io_mode_t;
171
172 /**
173 * @brief GPIO pull Enumerations definition
174 */
175 typedef enum
176 {
177 APP_IO_NOPULL, /**< No Pull-up or Pull-down activation. */
178 APP_IO_PULLUP, /**< Pull-up activation. */
179 APP_IO_PULLDOWN, /**< Pull-down activation. */
180 APP_IO_PULL_MAX /**< Only for check parameter, not used as input parameters. */
181 } app_io_pull_t;
182
183 /**
184 * @brief GPIO mux Enumerations definition
185 */
186 #ifdef APP_IO_MUX_ARBITRARY_V0
187 typedef enum
188 {
189 APP_IO_MUX_0, /**< IO_MUX_GPIO. */
190 APP_IO_MUX_1, /**< IO_MUX_I2C0_SCL. */
191 APP_IO_MUX_2, /**< IO_MUX_I2C0_SDA. */
192 APP_IO_MUX_3, /**< IO_MUX_I2C1_SCL. */
193 APP_IO_MUX_4, /**< IO_MUX_I2C1_SDA. */
194 APP_IO_MUX_5, /**< IO_MUX_UART0_CTS. */
195 APP_IO_MUX_6, /**< IO_MUX_UART0_RTS. */
196 APP_IO_MUX_7, /**< IO_MUX_UART0_TX. */
197 APP_IO_MUX_8, /**< IO_MUX_UART0_RX. */
198 APP_IO_MUX_9, /**< IO_MUX_UART1_CTS. */
199 APP_IO_MUX_10, /**< IO_MUX_UART1_RTS. */
200 APP_IO_MUX_11, /**< IO_MUX_UART1_TX. */
201 APP_IO_MUX_12, /**< IO_MUX_UART1_RX. */
202 APP_IO_MUX_13, /**< IO_MUX_PWM0. */
203 APP_IO_MUX_14, /**< IO_MUX_PWM1. */
204 APP_IO_MUX_15, /**< IO_MUX_PWM2. */
205 APP_IO_MUX_16, /**< IO_MUX_PWM3. */
206 APP_IO_MUX_17, /**< IO_MUX_PWM4. */
207 APP_IO_MUX_18, /**< IO_MUX_PWM5. */
208 APP_IO_MUX_19, /**< IO_MUX_df_ant_sw_0. */
209 APP_IO_MUX_20, /**< IO_MUX_df_ant_sw_1. */
210 APP_IO_MUX_21, /**< IO_MUX_df_ant_sw_2. */
211 APP_IO_MUX_22, /**< IO_MUX_df_ant_sw_3. */
212 APP_IO_MUX_23, /**< IO_MUX_df_ant_sw_4. */
213 APP_IO_MUX_24, /**< IO_MUX_df_ant_sw_5. */
214 APP_IO_MUX_25, /**< IO_MUX_df_ant_sw_6. */
215 APP_IO_MUX_26, /**< IO_MUX_ferp_gpio_trig_0. */
216 APP_IO_MUX_27, /**< IO_MUX_SWO. */
217 APP_IO_MUX_28, /**< IO_MUX_coex_ble_rx. */
218 APP_IO_MUX_29, /**< IO_MUX_coex_ble_tx. */
219 APP_IO_MUX_30, /**< IO_MUX_coex_wlan_rx. */
220 APP_IO_MUX_31, /**< IO_MUX_coex_wlan_tx. */
221 APP_IO_MUX_32, /**< IO_MUX_coex_ble_in_process. */
222 APP_IO_MUX_33, /**< IO_MUX_SWD_CLK. */
223 APP_IO_MUX_34, /**< IO_MUX_SWD_DATA. */
224 APP_IO_MUX_35, /**< IO_MUX_reserve3. */
225 APP_IO_MUX_36, /**< IO_MUX_reserve4. */
226 APP_IO_MUX_37, /**< IO_MUX_reserve5. */
227 APP_IO_MUX_38, /**< IO_MUX_SPI_S_MOSI. */
228 APP_IO_MUX_39, /**< IO_MUX_SPI_S_CS_N. */
229 APP_IO_MUX_40, /**< IO_MUX_SPI_S_CLK. */
230 APP_IO_MUX_41, /**< IO_MUX_SPI_S_MISO. */
231 APP_IO_MUX_42, /**< IO_MUX_SPI_M_CLK. */
232 APP_IO_MUX_43, /**< IO_MUX_SPI_M_CS0_N. */
233 APP_IO_MUX_44, /**< IO_MUX_SPI_M_CS1_N. */
234 APP_IO_MUX_45, /**< IO_MUX_SPI_M_MISO. */
235 APP_IO_MUX_46, /**< IO_MUX_SPI_M_MOSIss. */
236 APP_IO_MUX_47, /**< RESERVED. */
237 APP_IO_MUX_48, /**< RESERVED. */
238 APP_IO_MUX_49, /**< IO_MUX_DUAL_TIMER0_A. */
239 APP_IO_MUX_50, /**< IO_MUX_DUAL_TIMER0_B. */
240 APP_IO_MUX_51, /**< IO_MUX_DUAL_TIMER0_C. */
241 APP_IO_MUX_52, /**< IO_MUX_DUAL_TIMER1_A. */
242 APP_IO_MUX_53, /**< IO_MUX_DUAL_TIMER1_B. */
243 APP_IO_MUX_54, /**< IO_MUX_DUAL_TIMER1_C. */
244 APP_IO_MUX_MAX, /**< Only for check parameter, not used as input parameters. */
245 } app_io_mux_t;
246 #else
247 typedef enum
248 {
249 APP_IO_MUX_0, /**< IO mux mode 0. */
250 APP_IO_MUX_1, /**< IO mux mode 1. */
251 APP_IO_MUX_2, /**< IO mux mode 2. */
252 APP_IO_MUX_3, /**< IO mux mode 3. */
253 APP_IO_MUX_4, /**< IO mux mode 4. */
254 APP_IO_MUX_5, /**< IO mux mode 5. */
255 APP_IO_MUX_6, /**< IO mux mode 6. */
256 APP_IO_MUX_MAX, /**< Only for check parameter, not used as input parameters. */
257 } app_io_mux_t;
258 #endif
259 /** @} */
260
261 /** @addtogroup APP_GPIO_STRUCT Structures
262 * @{
263 */
264 /**
265 * @brief GPIO parameter structure definition
266 */
267 typedef struct
268 {
269 uint32_t pin; /**< Specifies the IO pins to be configured.
270 This parameter can be any value of @ref GR5xxx_pins */
271 app_io_mode_t mode; /**< Specifies the operating mode for the selected pins. */
272 app_io_pull_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins. */
273 app_io_mux_t mux; /**< Specifies the Peripheral to be connected to the selected pins. */
274 } app_io_init_t;
275
276 /**
277 * @brief GPIO Interrupt event Structure definition
278 */
279 typedef struct
280 {
281 app_io_type_t type; /**< Type of event. */
282 uint32_t pin; /**< Specifies the IO pins to be configured. */
283 void *arg; /**< User parameters */
284 } app_io_evt_t;
285
286 /** @} */
287
288 /** @addtogroup APP_GPIO_ENUMERATIONS Enumerations
289 * @{
290 */
291 /**
292 * @brief GPIO Speed Structure definition
293 */
294 typedef enum {
295 APP_IO_SPPED_MEDIUM, /**< Select medium speed. */
296 APP_IO_SPPED_HIGH, /**< Select high speed. */
297 APP_IO_SPPED_MAX /**< Only for check parameter, not used as input parameters. */
298 } app_io_speed_t;
299
300
301 /**
302 * @brief GPIO Input type Structure definition
303 */
304 typedef enum {
305 APP_IO_INPUT_TYPE_CMOS, /**< Select CMOS input. */
306 APP_IO_INPUT_TYPE_SCHMITT, /**< Select Schmitt input. */
307 APP_IO_INPUT_TYPE_MAX /**< Only for check parameter, not used as input parameters. */
308 } app_io_input_type_t;
309
310 /**
311 * @brief GPIO Strength Structure definition
312 */
313 typedef enum {
314 APP_IO_STRENGTH_LOW, /**< Select low output driver strength. */
315 APP_IO_STRENGTH_MEDIUM, /**< Select medium output driver strength. */
316 APP_IO_STRENGTH_HIGH, /**< Select high output driver strength. */
317 APP_IO_STRENGTH_ULTRA, /**< Select high output driver strength. */
318 APP_IO_STRENGTH_MAX, /**< Only for check parameter, not used as input parameters. */
319 } app_io_strength_t;
320
321 /** @} */
322
323 /** @addtogroup APP_GPIO_TYPEDEFS Type definitions
324 * @{
325 */
326 /**
327 * @brief GPIO callback type.
328 */
329 typedef void (*app_io_callback_t)(app_io_evt_t *p_evt);
330
331 /** @} */
332
333 /* Exported functions --------------------------------------------------------*/
334 /** @addtogroup HAL_APP_GPIO_DRIVER_FUNCTIONS Functions
335 * @{
336 */
337 /**
338 ****************************************************************************************
339 * @brief Initialize the APP GPIO DRIVER according to the specified parameters
340 * in the app_io_type_t and app_io_init_t.
341 *
342 * @param[in] type: GPIO type.
343 * @param[in] p_init: Pointer to app_io_init_t parameter which contains the
344 * configuration information for the specified GPIO.
345 *
346 * @return Result of initialization.
347 ****************************************************************************************
348 */
349 uint16_t app_io_init(app_io_type_t type, app_io_init_t *p_init);
350
351 /**
352 ****************************************************************************************
353 * @brief De-initialize the GPIOx peripheral.
354 *
355 * @param[in] type: GPIO type, See app_io_type_t.
356 * @param[in] pin: The pin want to De-initialization.
357 *
358 * @return Result of De-initialization.
359 ****************************************************************************************
360 */
361 uint16_t app_io_deinit(app_io_type_t type, uint32_t pin);
362
363 /**
364 ****************************************************************************************
365 * @brief Read the specified input port pin..
366 *
367 * @param[in] type: GPIO type, See app_io_type_t.
368 * @param[in] pin: The pin want to read.
369 *
370 * @return The GPIO state.
371 ****************************************************************************************
372 */
373 app_io_pin_state_t app_io_read_pin(app_io_type_t type, uint32_t pin);
374
375 /**
376 ****************************************************************************************
377 * @brief Set or clear the selected data port bit.
378 *
379 * @param[in] type: GPIO type, See app_io_type_t.
380 * @param[in] pin: The pin want to set or clear.
381 * @param[in] pin_state: Specifies the value to be written to the selected bit.
382 *
383 * @return Result of write.
384 ****************************************************************************************
385 */
386 uint16_t app_io_write_pin(app_io_type_t type, uint32_t pin, app_io_pin_state_t pin_state);
387
388 /**
389 ****************************************************************************************
390 * @brief Toggle the specified GPIO pin.
391 *
392 * @param[in] type: GPIO type, See app_io_type_t.
393 * @param[in] pin: The pin want to toggle.
394 *
395 * @return Result of toggle.
396 ****************************************************************************************
397 */
398 uint16_t app_io_toggle_pin(app_io_type_t type, uint32_t pin);
399
400 /**
401 ****************************************************************************************
402 * @brief Set the speed of the GPIO.
403 *
404 * @param[in] type: GPIO type, See app_io_type_t.
405 * @param[in] pin: The pin want to set.
406 * @param[in] speed: GPIO speed type, See app_io_speed_t.
407 *
408 * @return Result of setting.
409 ****************************************************************************************
410 */
411 uint16_t app_io_set_speed(app_io_type_t type, uint32_t pin, app_io_speed_t speed);
412
413 /**
414 ****************************************************************************************
415 * @brief Set the strength of the GPIO.
416 *
417 * @param[in] type: GPIO type, See app_io_type_t.
418 * @param[in] pin: The pin want to set.
419 * @param[in] strength: GPIO strength type, See app_io_strength_t.
420 *
421 * @return Result of setting.
422 ****************************************************************************************
423 */
424 uint16_t app_io_set_strength(app_io_type_t type, uint32_t pin, app_io_strength_t strength);
425
426 /**
427 ****************************************************************************************
428 * @brief Set the input type of the GPIO.
429 *
430 * @param[in] type: GPIO type, See app_io_type_t.
431 * @param[in] pin: The pin want to toggle.
432 * @param[in] input_type: GPIO input type, See app_io_input_type_t.
433 *
434 * @return Result of setting.
435 ****************************************************************************************
436 */
437 uint16_t app_io_set_intput_type(app_io_type_t type, uint32_t pin, app_io_input_type_t input_type);
438
439 /**
440 ****************************************************************************************
441 * @brief Initialize GPIO to interrupt mode and register interrupt callback function.
442 *
443 * @param[in] type: GPIO type, See app_io_type_t.
444 * @param[in] p_init: Pointer to app_io_init_t parameter which contains the
445 * configuration information for the specified GPIO.
446 * @param[in] io_evt_cb: Interrupt callback function.
447 * @param[in] arg: User parameters.
448 *
449 * @return Result of register.
450 ****************************************************************************************
451 */
452 uint16_t app_io_event_register_cb(app_io_type_t type, app_io_init_t *p_init, app_io_callback_t io_evt_cb, void *arg);
453
454 /**
455 ****************************************************************************************
456 * @brief Deinitialize GPIO to normal mode and unregister interrupt.
457 *
458 * @param[in] type: GPIO type, See app_io_type_t.
459 * @param[in] pin: The pin want to unregister.
460 *
461 * @return Result of unregister.
462 ****************************************************************************************
463 */
464 uint16_t app_io_event_unregister(app_io_type_t type, uint32_t pin);
465
466 /** @} */
467 #endif
468
469 /** @} */
470
471 /** @} */
472
473 /** @} */
474
APP_IO_MUX_1
@ APP_IO_MUX_1
Definition: app_io.h:250
APP_IO_SPPED_MEDIUM
@ APP_IO_SPPED_MEDIUM
Definition: app_io.h:295
app_io_speed_t
app_io_speed_t
GPIO Speed Structure definition.
Definition: app_io.h:294
app_io_set_intput_type
uint16_t app_io_set_intput_type(app_io_type_t type, uint32_t pin, app_io_input_type_t input_type)
Set the input type of the GPIO.
APP_IO_MUX_6
@ APP_IO_MUX_6
Definition: app_io.h:255
app_io_init_t::mode
app_io_mode_t mode
Definition: app_io.h:271
app_io_evt_t
GPIO Interrupt event Structure definition.
Definition: app_io.h:280
app_io_input_type_t
app_io_input_type_t
GPIO Input type Structure definition.
Definition: app_io.h:304
app_io_event_unregister
uint16_t app_io_event_unregister(app_io_type_t type, uint32_t pin)
Deinitialize GPIO to normal mode and unregister interrupt.
APP_IO_MODE_IT_HIGH
@ APP_IO_MODE_IT_HIGH
Definition: app_io.h:166
APP_IO_MODE_ANALOG
@ APP_IO_MODE_ANALOG
Definition: app_io.h:168
APP_IO_NOPULL
@ APP_IO_NOPULL
Definition: app_io.h:177
app_io_callback_t
void(* app_io_callback_t)(app_io_evt_t *p_evt)
GPIO callback type.
Definition: app_io.h:329
APP_IO_INPUT_TYPE_CMOS
@ APP_IO_INPUT_TYPE_CMOS
Definition: app_io.h:305
APP_IO_MUX_4
@ APP_IO_MUX_4
Definition: app_io.h:253
app_io_write_pin
uint16_t app_io_write_pin(app_io_type_t type, uint32_t pin, app_io_pin_state_t pin_state)
Set or clear the selected data port bit.
APP_IO_MODE_IT_RISING
@ APP_IO_MODE_IT_RISING
Definition: app_io.h:161
APP_IO_MODE_MAX
@ APP_IO_MODE_MAX
Definition: app_io.h:169
app_io_deinit
uint16_t app_io_deinit(app_io_type_t type, uint32_t pin)
De-initialize the GPIOx peripheral.
app_io_pull_t
app_io_pull_t
GPIO pull Enumerations definition.
Definition: app_io.h:176
app_io_type_t
app_io_type_t
GPIO type Enumerations definition.
Definition: app_io.h:142
APP_IO_STRENGTH_HIGH
@ APP_IO_STRENGTH_HIGH
Definition: app_io.h:316
APP_IO_MODE_OUTPUT
@ APP_IO_MODE_OUTPUT
Definition: app_io.h:159
APP_IO_STRENGTH_ULTRA
@ APP_IO_STRENGTH_ULTRA
Definition: app_io.h:317
APP_IO_TYPE_AON
@ APP_IO_TYPE_AON
Definition: app_io.h:146
app_io_mode_t
app_io_mode_t
GPIO mode Enumerations definition.
Definition: app_io.h:156
app_io_init_t::pull
app_io_pull_t pull
Definition: app_io.h:272
APP_IO_PULL_MAX
@ APP_IO_PULL_MAX
Definition: app_io.h:180
APP_IO_PIN_RESET
@ APP_IO_PIN_RESET
Definition: app_io.h:134
APP_IO_MODE_NONE
@ APP_IO_MODE_NONE
Definition: app_io.h:157
APP_IO_MODE_IT_FALLING
@ APP_IO_MODE_IT_FALLING
Definition: app_io.h:162
APP_IO_TYPE_NORMAL
@ APP_IO_TYPE_NORMAL
Definition: app_io.h:148
APP_IO_PULLUP
@ APP_IO_PULLUP
Definition: app_io.h:178
APP_IO_STRENGTH_MAX
@ APP_IO_STRENGTH_MAX
Definition: app_io.h:318
app_io_set_strength
uint16_t app_io_set_strength(app_io_type_t type, uint32_t pin, app_io_strength_t strength)
Set the strength of the GPIO.
APP_IO_TYPE_MSIO
@ APP_IO_TYPE_MSIO
Definition: app_io.h:147
APP_IO_MUX_MAX
@ APP_IO_MUX_MAX
Definition: app_io.h:256
APP_IO_MUX_3
@ APP_IO_MUX_3
Definition: app_io.h:252
app_io_event_register_cb
uint16_t app_io_event_register_cb(app_io_type_t type, app_io_init_t *p_init, app_io_callback_t io_evt_cb, void *arg)
Initialize GPIO to interrupt mode and register interrupt callback function.
APP_IO_INPUT_TYPE_MAX
@ APP_IO_INPUT_TYPE_MAX
Definition: app_io.h:307
APP_IO_MUX_5
@ APP_IO_MUX_5
Definition: app_io.h:254
APP_IO_MUX_0
@ APP_IO_MUX_0
Definition: app_io.h:249
app_io_set_speed
uint16_t app_io_set_speed(app_io_type_t type, uint32_t pin, app_io_speed_t speed)
Set the speed of the GPIO.
APP_IO_MUX_2
@ APP_IO_MUX_2
Definition: app_io.h:251
APP_IO_SPPED_MAX
@ APP_IO_SPPED_MAX
Definition: app_io.h:297
APP_IO_MODE_INPUT
@ APP_IO_MODE_INPUT
Definition: app_io.h:158
app_io_evt_t::arg
void * arg
Definition: app_io.h:283
APP_IO_PIN_SET
@ APP_IO_PIN_SET
Definition: app_io.h:135
APP_IO_PULLDOWN
@ APP_IO_PULLDOWN
Definition: app_io.h:179
APP_IO_TYPE_MAX
@ APP_IO_TYPE_MAX
Definition: app_io.h:149
app_io_read_pin
app_io_pin_state_t app_io_read_pin(app_io_type_t type, uint32_t pin)
Read the specified input port pin..
app_io_pin_state_t
app_io_pin_state_t
GPIO state Enumerations definition.
Definition: app_io.h:133
APP_IO_INPUT_TYPE_SCHMITT
@ APP_IO_INPUT_TYPE_SCHMITT
Definition: app_io.h:306
app_io_evt_t::type
app_io_type_t type
Definition: app_io.h:281
app_io_init
uint16_t app_io_init(app_io_type_t type, app_io_init_t *p_init)
Initialize the APP GPIO DRIVER according to the specified parameters in the app_io_type_t and app_io_...
APP_IO_STRENGTH_MEDIUM
@ APP_IO_STRENGTH_MEDIUM
Definition: app_io.h:315
app_io_toggle_pin
uint16_t app_io_toggle_pin(app_io_type_t type, uint32_t pin)
Toggle the specified GPIO pin.
app_io_strength_t
app_io_strength_t
GPIO Strength Structure definition.
Definition: app_io.h:313
app_io_mux_t
app_io_mux_t
GPIO mux Enumerations definition.
Definition: app_io.h:248
APP_IO_TYPE_GPIOA
@ APP_IO_TYPE_GPIOA
Definition: app_io.h:143
app_io_init_t::mux
app_io_mux_t mux
Definition: app_io.h:273
APP_IO_MODE_MUX
@ APP_IO_MODE_MUX
Definition: app_io.h:160
app_drv_error.h
Header file of app driver error code.
app_io_evt_t::pin
uint32_t pin
Definition: app_io.h:282
app_drv_config.h
Header file of app driver config code.
APP_IO_TYPE_GPIOC
@ APP_IO_TYPE_GPIOC
Definition: app_io.h:145
APP_IO_TYPE_GPIOB
@ APP_IO_TYPE_GPIOB
Definition: app_io.h:144
APP_IO_MODE_IT_LOW
@ APP_IO_MODE_IT_LOW
Definition: app_io.h:167
app_io_init_t
GPIO parameter structure definition.
Definition: app_io.h:268
APP_IO_STRENGTH_LOW
@ APP_IO_STRENGTH_LOW
Definition: app_io.h:314
APP_IO_SPPED_HIGH
@ APP_IO_SPPED_HIGH
Definition: app_io.h:296
app_io_init_t::pin
uint32_t pin
Definition: app_io.h:269