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 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR551X)
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_IO_PIN_ALL ((uint32_t)0x0000FFFFU) /**< All pins selected */
108 #define APP_AON_IO_PIN_ALL ((uint32_t)0x000000FFU) /**< All AON pins selected */
109 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5332X)
110 #define APP_MSIO_IO_PIN_ALL ((uint32_t)0x000003FFU) /**< All MISO pins selected */
111 #else
112 #define APP_MSIO_IO_PIN_ALL ((uint32_t)0x000000FFU) /**< All MISO pins selected */
113 #endif
114 #define APP_IO_PIN_MASK ((uint32_t)0xFFFFFFFFU) /**< PIN mask for assert test */
115 
116 /**
117  * @brief GR5xxx_APP_GPIO_default_config initStruct default configuart APP_GPIOn
118  */
119 #define APP_IO_DEFAULT_CONFIG \
120 { \
121  .pin = APP_IO_PIN_ALL, \
122  .mode = APP_IO_MODE_INPUT, \
123  .pull = APP_IO_PULLDOWN, \
124 }
125 
126 /** @} */
127 
128 /** @} */
129 
130 /** @addtogroup APP_GPIO_ENUMERATIONS Enumerations
131  * @{
132  */
133 /**
134  * @brief GPIO state Enumerations definition
135  */
136 typedef enum
137 {
138  APP_IO_PIN_RESET, /**< IO pin low level. */
139  APP_IO_PIN_SET, /**< IO pin high level. */
141 
142 /**
143  * @brief GPIO type Enumerations definition
144  */
145 typedef enum
146 {
147  APP_IO_TYPE_GPIOA, /**< General Purpose Input/Output. */
148  APP_IO_TYPE_GPIOB, /**< General Purpose Input/Output. */
149  APP_IO_TYPE_GPIOC, /**< General Purpose Input/Output. */
150 // #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR551X)
151  APP_IO_TYPE_NORMAL, /**< General Purpose Input/Output. */
152 // #endif
153  APP_IO_TYPE_AON, /**< Always-on Input/Output. */
154  APP_IO_TYPE_MSIO, /**< Mixed Signal I/O. */
155  APP_IO_TYPE_MAX, /**< Only for check parameter, not used as input parameters. */
156 } app_io_type_t;
157 
158 /**
159  * @brief GPIO mode Enumerations definition
160  */
161 typedef enum
162 {
164  APP_IO_MODE_INPUT, /**< Input Mode. */
165  APP_IO_MODE_OUTPUT, /**< Output Mode. */
166  APP_IO_MODE_MUX, /**< Mux Mode. */
167  APP_IO_MODE_IT_RISING, /**< Interrupt Mode with Rising edge trigger detection. */
168  APP_IO_MODE_IT_FALLING, /**< Interrupt Mode with Falling edge trigger detection. */
169 #if (APP_DRIVER_CHIP_TYPE != APP_DRIVER_GR551X)
170  APP_IO_MODE_IT_BOTH_EDGE, /**< Interrupt Mode with Rising and Falling edge trigger detection. */
171 #endif
172  APP_IO_MODE_IT_HIGH, /**< Interrupt Mode with High-level trigger detection. */
173  APP_IO_MODE_IT_LOW, /**< Interrupt Mode with Low-level trigger detection. */
174  APP_IO_MODE_ANALOG, /**< Analog IO Mode. */
175  APP_IO_MODE_MAX, /**< Only for check parameter, not used as input parameters. */
176 } app_io_mode_t;
177 
178 /**
179  * @brief GPIO pull Enumerations definition
180  */
181 typedef enum
182 {
183  APP_IO_NOPULL, /**< No Pull-up or Pull-down activation. */
184  APP_IO_PULLUP, /**< Pull-up activation. */
185  APP_IO_PULLDOWN, /**< Pull-down activation. */
186  APP_IO_PULL_MAX /**< Only for check parameter, not used as input parameters. */
188 
189 /**
190  * @brief GPIO mux Enumerations definition
191  */
192 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5332X)
193 typedef enum
194 {
195  APP_IO_MUX_0, /**< IO_MUX_GPIO. */
196  APP_IO_MUX_1, /**< IO_MUX_I2C0_SCL. */
197  APP_IO_MUX_2, /**< IO_MUX_I2C0_SDA. */
198  APP_IO_MUX_3, /**< IO_MUX_I2C1_SCL. */
199  APP_IO_MUX_4, /**< IO_MUX_I2C1_SDA. */
200  APP_IO_MUX_5, /**< IO_MUX_UART0_CTS. */
201  APP_IO_MUX_6, /**< IO_MUX_UART0_RTS. */
202  APP_IO_MUX_7, /**< IO_MUX_UART0_TX. */
203  APP_IO_MUX_8, /**< IO_MUX_UART0_RX. */
204  APP_IO_MUX_9, /**< IO_MUX_UART1_CTS. */
205  APP_IO_MUX_10, /**< IO_MUX_UART1_RTS. */
206  APP_IO_MUX_11, /**< IO_MUX_UART1_TX. */
207  APP_IO_MUX_12, /**< IO_MUX_UART1_RX.*/
208  APP_IO_MUX_13, /**< IO_MUX_PWM0. */
209  APP_IO_MUX_14, /**< IO_MUX_PWM1. */
210  APP_IO_MUX_15, /**< IO_MUX_PWM2. */
211  APP_IO_MUX_16, /**< IO_MUX_PWM3. */
212  APP_IO_MUX_17, /**< IO_MUX_PWM4. */
213  APP_IO_MUX_18, /**< IO_MUX_PWM5. */
214  APP_IO_MUX_19, /**< IO_MUX_df_ant_sw_0. */
215  APP_IO_MUX_20, /**< IO_MUX_df_ant_sw_1. */
216  APP_IO_MUX_21, /**< IO_MUX_df_ant_sw_2. */
217  APP_IO_MUX_22, /**< IO_MUX_df_ant_sw_3. */
218  APP_IO_MUX_23, /**< IO_MUX_df_ant_sw_4. */
219  APP_IO_MUX_24, /**< IO_MUX_df_ant_sw_5. */
220  APP_IO_MUX_25, /**< IO_MUX_df_ant_sw_6. */
221  APP_IO_MUX_26, /**< IO_MUX_ferp_gpio_trig_0. */
222  APP_IO_MUX_27, /**< IO_MUX_SWO. */
223  APP_IO_MUX_28, /**< IO_MUX_coex_ble_rx. */
224  APP_IO_MUX_29, /**< IO_MUX_coex_ble_tx. */
225  APP_IO_MUX_30, /**< IO_MUX_coex_wlan_rx. */
226  APP_IO_MUX_31, /**< IO_MUX_coex_wlan_tx. */
227  APP_IO_MUX_32, /**< IO_MUX_coex_ble_in_process. */
228  APP_IO_MUX_33, /**< IO_MUX_SWD_CLK. */
229  APP_IO_MUX_34, /**< IO_MUX_SWD_DATA. */
230  APP_IO_MUX_35, /**< IO_MUX_reserve3. */
231  APP_IO_MUX_36, /**< IO_MUX_reserve4. */
232  APP_IO_MUX_37, /**< IO_MUX_reserve5. */
233  APP_IO_MUX_38, /**< IO_MUX_SPI_S_MOSI. */
234  APP_IO_MUX_39, /**< IO_MUX_SPI_S_CS_N. */
235  APP_IO_MUX_40, /**< IO_MUX_SPI_S_CLK. */
236  APP_IO_MUX_41, /**< IO_MUX_SPI_S_MISO. */
237  APP_IO_MUX_42, /**< IO_MUX_SPI_M_CLK. */
238  APP_IO_MUX_43, /**< IO_MUX_SPI_M_CS0_N. */
239  APP_IO_MUX_44, /**< IO_MUX_SPI_M_CS1_N. */
240  APP_IO_MUX_45, /**< IO_MUX_SPI_M_MISO. */
241  APP_IO_MUX_46, /**< IO_MUX_SPI_M_MOSIss. */
242  APP_IO_MUX_47, /**< RESERVED. */
243  APP_IO_MUX_48, /**< RESERVED. */
244  APP_IO_MUX_49, /**< IO_MUX_DUAL_TIMER0_A. */
245  APP_IO_MUX_50, /**< IO_MUX_DUAL_TIMER0_B. */
246  APP_IO_MUX_51, /**< IO_MUX_DUAL_TIMER0_C. */
247  APP_IO_MUX_52, /**< IO_MUX_DUAL_TIMER1_A. */
248  APP_IO_MUX_53, /**< IO_MUX_DUAL_TIMER1_B. */
249  APP_IO_MUX_54, /**< IO_MUX_DUAL_TIMER1_C. */
250  APP_IO_MUX_MAX, /**< Only for check parameter, not used as input parameters. */
251 } app_io_mux_t;
252 #else
253 typedef enum
254 {
255  APP_IO_MUX_0, /**< IO mux mode 0. */
256  APP_IO_MUX_1, /**< IO mux mode 1. */
257  APP_IO_MUX_2, /**< IO mux mode 2. */
258  APP_IO_MUX_3, /**< IO mux mode 3. */
259  APP_IO_MUX_4, /**< IO mux mode 4. */
260  APP_IO_MUX_5, /**< IO mux mode 5. */
261  APP_IO_MUX_6, /**< IO mux mode 6. */
262  APP_IO_MUX_7, /**< IO mux mode 7. */
263  APP_IO_MUX_8, /**< IO mux mode 8. */
264  APP_IO_MUX_MAX, /**< Only for check parameter, not used as input parameters. */
265 } app_io_mux_t;
266 #endif
267 
268 /** @} */
269 
270 /** @addtogroup APP_GPIO_PIN_DEFINES Defines
271  * @{
272  */
273 /**
274 * @brief GPIO mux for different APP_DRIVER_CHIP_TYPE
275 */
276 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5332X)
277 #define APP_IO_MUX APP_IO_MUX_0 /**< IO mux for GR5332X. */
278 #elif (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5525X)
279 #define APP_IO_MUX APP_IO_MUX_8 /**< IO mux for GR5525X. */
280 #else
281 #define APP_IO_MUX APP_IO_MUX_7 /**< IO mux for others. */
282 #endif
283 /** @} */
284 
285 /** @addtogroup APP_GPIO_STRUCT Structures
286  * @{
287  */
288 /**
289  * @brief GPIO parameter structure definition
290  */
291 typedef struct
292 {
293  uint32_t pin; /**< Specifies the IO pins to be configured.
294  This parameter can be any value of @ref GR5xxx_pins */
295  app_io_mode_t mode; /**< Specifies the operating mode for the selected pins. */
296  app_io_pull_t pull; /**< Specifies the Pull-up or Pull-Down activation for the selected pins. */
297  app_io_mux_t mux; /**< Specifies the Peripheral to be connected to the selected pins. */
298 } app_io_init_t;
299 
300 /**
301  * @brief GPIO Interrupt event Structure definition
302  */
303 typedef struct
304 {
305  app_io_type_t type; /**< Type of event. */
306  uint32_t pin; /**< Specifies the IO pins to be configured. */
307  void *arg; /**< User parameters */
308 } app_io_evt_t;
309 /** @} */
310 
311 /** @addtogroup APP_GPIO_ENUMERATIONS Enumerations
312  * @{
313  */
314 /**
315  * @brief GPIO Speed Enumerations definition
316  */
317 typedef enum {
318  APP_IO_SPPED_MEDIUM, /**< Select medium speed. */
319  APP_IO_SPPED_HIGH, /**< Select high speed. */
320  APP_IO_SPPED_MAX /**< Only for check parameter, not used as input parameters. */
322 
323 
324 /**
325  * @brief GPIO Input type Enumerations definition
326  */
327 typedef enum {
328  APP_IO_INPUT_TYPE_CMOS, /**< Select CMOS input. */
329  APP_IO_INPUT_TYPE_SCHMITT, /**< Select Schmitt input. */
330  APP_IO_INPUT_TYPE_MAX /**< Only for check parameter, not used as input parameters. */
332 
333 
334 /**
335  * @brief GPIO Strength Enumerations definition
336  */
337 typedef enum {
338  APP_IO_STRENGTH_LOW, /**< Select low output driver strength */
339  APP_IO_STRENGTH_MEDIUM, /**< Select medium output driver strength */
340  APP_IO_STRENGTH_HIGH, /**< Select high output driver strength */
341  APP_IO_STRENGTH_ULTRA, /**< Select high output driver strength */
342  APP_IO_STRENGTH_MAX, /**< Only for check parameter, not used as input parameters. */
344 
345 /** @} */
346 
347 /** @addtogroup APP_GPIO_TYPEDEFS Type definitions
348  * @{
349  */
350 /**
351  * @brief GPIO callback type.
352  */
353 typedef void (*app_io_callback_t)(app_io_evt_t *p_evt);
354 
355 /** @} */
356 
357 /* Exported functions --------------------------------------------------------*/
358 /** @addtogroup HAL_APP_GPIO_DRIVER_FUNCTIONS Functions
359  * @{
360  */
361 /**
362  ****************************************************************************************
363  * @brief Initialize the APP GPIO DRIVER according to the specified parameters
364  * in the app_io_type_t and app_io_init_t.
365  *
366  * @param[in] type: GPIO type.
367  * @param[in] p_init: Pointer to app_io_init_t parameter which contains the
368  * configuration information for the specified GPIO.
369  *
370  * @return Result of initialization.
371  ****************************************************************************************
372  */
373 uint16_t app_io_init(app_io_type_t type, app_io_init_t *p_init);
374 
375 /**
376  ****************************************************************************************
377  * @brief De-initialize the GPIOx peripheral.
378  *
379  * @param[in] type: GPIO type, See app_io_type_t.
380  * @param[in] pin: The pin want to De-initialization.
381  *
382  * @return Result of De-initialization.
383  ****************************************************************************************
384  */
385 uint16_t app_io_deinit(app_io_type_t type, uint32_t pin);
386 
387 /**
388  ****************************************************************************************
389  * @brief Read the specified input port pin..
390  *
391  * @param[in] type: GPIO type, See app_io_type_t.
392  * @param[in] pin: The pin want to read.
393  *
394  * @return The GPIO state.
395  ****************************************************************************************
396  */
398 
399 /**
400  ****************************************************************************************
401  * @brief Set or clear the selected data port bit.
402  *
403  * @param[in] type: GPIO type, See app_io_type_t.
404  * @param[in] pin: The pin want to set or clear.
405  * @param[in] pin_state: Specifies the value to be written to the selected bit.
406  *
407  * @return Result of write.
408  ****************************************************************************************
409  */
410 uint16_t app_io_write_pin(app_io_type_t type, uint32_t pin, app_io_pin_state_t pin_state);
411 
412 /**
413  ****************************************************************************************
414  * @brief Toggle the specified GPIO pin.
415  *
416  * @param[in] type: GPIO type, See app_io_type_t.
417  * @param[in] pin: The pin want to toggle.
418  *
419  * @return Result of toggle.
420  ****************************************************************************************
421  */
422 uint16_t app_io_toggle_pin(app_io_type_t type, uint32_t pin);
423 
424 /**
425  ****************************************************************************************
426  * @brief Set the speed of the GPIO.
427  *
428  * @param[in] type: GPIO type, See app_io_type_t.
429  * @param[in] pin: The pin want to set.
430  * @param[in] speed: GPIO speed type, See app_io_speed_t.
431  *
432  * @return Result of seting.
433  ****************************************************************************************
434  */
435 uint16_t app_io_set_speed(app_io_type_t type, uint32_t pin, app_io_speed_t speed);
436 
437 /**
438  ****************************************************************************************
439  * @brief Set the strength of the GPIO.
440  *
441  * @param[in] type: GPIO type, See app_io_type_t.
442  * @param[in] pin: The pin want to set.
443  * @param[in] strength: GPIO strength type, See app_io_strength_t.
444  *
445  * @return Result of seting.
446  ****************************************************************************************
447  */
448 uint16_t app_io_set_strength(app_io_type_t type, uint32_t pin, app_io_strength_t strength);
449 
450 /**
451  ****************************************************************************************
452  * @brief Set the input type of the GPIO.
453  *
454  * @param[in] type: GPIO type, See app_io_type_t.
455  * @param[in] pin: The pin want to toggle.
456  * @param[in] input_type: GPIO input type, See app_io_input_type_t.
457  *
458  * @return Result of seting.
459  ****************************************************************************************
460  */
461 uint16_t app_io_set_intput_type(app_io_type_t type, uint32_t pin, app_io_input_type_t input_type);
462 
463 /**
464  ****************************************************************************************
465  * @brief Initialize GPIO to interrupt mode and register interrupt callback function.
466  *
467  * @param[in] type: GPIO type, See app_io_type_t.
468  * @param[in] p_init: Pointer to app_io_init_t parameter which contains the
469  * configuration information for the specified GPIO.
470  * @param[in] io_evt_cb: Interrupt callback function.
471  * @param[in] arg: User parameters.
472  *
473  * @return Result of register.
474  ****************************************************************************************
475  */
476 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);
477 
478 /**
479  ****************************************************************************************
480  * @brief Deinitialize GPIO to normal mode and unregister interrupt.
481  *
482  * @param[in] type: GPIO type, See app_io_type_t.
483  * @param[in] pin: The pin want to unregister.
484  *
485  * @return Result of unregister.
486  ****************************************************************************************
487  */
488 uint16_t app_io_event_unregister(app_io_type_t type, uint32_t pin);
489 
490 /** @} */
491 #endif
492 
493 /** @} */
494 
495 /** @} */
496 
497 /** @} */
498 
APP_IO_MUX_1
@ APP_IO_MUX_1
Definition: app_io.h:256
APP_IO_SPPED_MEDIUM
@ APP_IO_SPPED_MEDIUM
Definition: app_io.h:318
app_io_speed_t
app_io_speed_t
GPIO Speed Enumerations definition.
Definition: app_io.h:317
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:261
app_io_init_t::mode
app_io_mode_t mode
Definition: app_io.h:295
app_io_evt_t
GPIO Interrupt event Structure definition.
Definition: app_io.h:304
app_io_input_type_t
app_io_input_type_t
GPIO Input type Enumerations definition.
Definition: app_io.h:327
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:172
APP_IO_MODE_ANALOG
@ APP_IO_MODE_ANALOG
Definition: app_io.h:174
APP_IO_NOPULL
@ APP_IO_NOPULL
Definition: app_io.h:183
app_io_callback_t
void(* app_io_callback_t)(app_io_evt_t *p_evt)
GPIO callback type.
Definition: app_io.h:353
APP_IO_INPUT_TYPE_CMOS
@ APP_IO_INPUT_TYPE_CMOS
Definition: app_io.h:328
APP_IO_MUX_4
@ APP_IO_MUX_4
Definition: app_io.h:259
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:167
APP_IO_MODE_MAX
@ APP_IO_MODE_MAX
Definition: app_io.h:175
app_io_deinit
uint16_t app_io_deinit(app_io_type_t type, uint32_t pin)
De-initialize the GPIOx peripheral.
APP_IO_MODE_IT_BOTH_EDGE
@ APP_IO_MODE_IT_BOTH_EDGE
Definition: app_io.h:170
app_io_pull_t
app_io_pull_t
GPIO pull Enumerations definition.
Definition: app_io.h:182
app_io_type_t
app_io_type_t
GPIO type Enumerations definition.
Definition: app_io.h:146
APP_IO_STRENGTH_HIGH
@ APP_IO_STRENGTH_HIGH
Definition: app_io.h:340
APP_IO_MUX_7
@ APP_IO_MUX_7
Definition: app_io.h:262
APP_IO_MODE_OUTPUT
@ APP_IO_MODE_OUTPUT
Definition: app_io.h:165
APP_IO_STRENGTH_ULTRA
@ APP_IO_STRENGTH_ULTRA
Definition: app_io.h:341
APP_IO_TYPE_AON
@ APP_IO_TYPE_AON
Definition: app_io.h:153
app_io_mode_t
app_io_mode_t
GPIO mode Enumerations definition.
Definition: app_io.h:162
APP_IO_MUX_8
@ APP_IO_MUX_8
Definition: app_io.h:263
app_io_init_t::pull
app_io_pull_t pull
Definition: app_io.h:296
APP_IO_PULL_MAX
@ APP_IO_PULL_MAX
Definition: app_io.h:186
APP_IO_PIN_RESET
@ APP_IO_PIN_RESET
Definition: app_io.h:138
APP_IO_MODE_NONE
@ APP_IO_MODE_NONE
Definition: app_io.h:163
APP_IO_MODE_IT_FALLING
@ APP_IO_MODE_IT_FALLING
Definition: app_io.h:168
APP_IO_TYPE_NORMAL
@ APP_IO_TYPE_NORMAL
Definition: app_io.h:151
APP_IO_PULLUP
@ APP_IO_PULLUP
Definition: app_io.h:184
APP_IO_STRENGTH_MAX
@ APP_IO_STRENGTH_MAX
Definition: app_io.h:342
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:154
APP_IO_MUX_MAX
@ APP_IO_MUX_MAX
Definition: app_io.h:264
APP_IO_MUX_3
@ APP_IO_MUX_3
Definition: app_io.h:258
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:330
APP_IO_MUX_5
@ APP_IO_MUX_5
Definition: app_io.h:260
APP_IO_MUX_0
@ APP_IO_MUX_0
Definition: app_io.h:255
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:257
APP_IO_SPPED_MAX
@ APP_IO_SPPED_MAX
Definition: app_io.h:320
APP_IO_MODE_INPUT
@ APP_IO_MODE_INPUT
Definition: app_io.h:164
app_io_evt_t::arg
void * arg
Definition: app_io.h:307
APP_IO_PIN_SET
@ APP_IO_PIN_SET
Definition: app_io.h:139
APP_IO_PULLDOWN
@ APP_IO_PULLDOWN
Definition: app_io.h:185
APP_IO_TYPE_MAX
@ APP_IO_TYPE_MAX
Definition: app_io.h:155
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:137
APP_IO_INPUT_TYPE_SCHMITT
@ APP_IO_INPUT_TYPE_SCHMITT
Definition: app_io.h:329
app_io_evt_t::type
app_io_type_t type
Definition: app_io.h:305
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:339
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 Enumerations definition.
Definition: app_io.h:337
app_io_mux_t
app_io_mux_t
GPIO mux Enumerations definition.
Definition: app_io.h:254
APP_IO_TYPE_GPIOA
@ APP_IO_TYPE_GPIOA
Definition: app_io.h:147
app_io_init_t::mux
app_io_mux_t mux
Definition: app_io.h:297
APP_IO_MODE_MUX
@ APP_IO_MODE_MUX
Definition: app_io.h:166
app_drv_error.h
Header file of app driver error code.
app_io_evt_t::pin
uint32_t pin
Definition: app_io.h:306
app_drv_config.h
Header file of app driver config code.
APP_IO_TYPE_GPIOC
@ APP_IO_TYPE_GPIOC
Definition: app_io.h:149
APP_IO_TYPE_GPIOB
@ APP_IO_TYPE_GPIOB
Definition: app_io.h:148
APP_IO_MODE_IT_LOW
@ APP_IO_MODE_IT_LOW
Definition: app_io.h:173
app_io_init_t
GPIO parameter structure definition.
Definition: app_io.h:292
APP_IO_STRENGTH_LOW
@ APP_IO_STRENGTH_LOW
Definition: app_io.h:338
APP_IO_SPPED_HIGH
@ APP_IO_SPPED_HIGH
Definition: app_io.h:319
app_io_init_t::pin
uint32_t pin
Definition: app_io.h:293