Go to the documentation of this file.
69 #define APP_IO_PIN_0 ((uint32_t)0x00000001U)
70 #define APP_IO_PIN_1 ((uint32_t)0x00000002U)
71 #define APP_IO_PIN_2 ((uint32_t)0x00000004U)
72 #define APP_IO_PIN_3 ((uint32_t)0x00000008U)
73 #define APP_IO_PIN_4 ((uint32_t)0x00000010U)
74 #define APP_IO_PIN_5 ((uint32_t)0x00000020U)
75 #define APP_IO_PIN_6 ((uint32_t)0x00000040U)
76 #define APP_IO_PIN_7 ((uint32_t)0x00000080U)
77 #define APP_IO_PIN_8 ((uint32_t)0x00000100U)
78 #define APP_IO_PIN_9 ((uint32_t)0x00000200U)
79 #define APP_IO_PIN_10 ((uint32_t)0x00000400U)
80 #define APP_IO_PIN_11 ((uint32_t)0x00000800U)
81 #define APP_IO_PIN_12 ((uint32_t)0x00001000U)
82 #define APP_IO_PIN_13 ((uint32_t)0x00002000U)
83 #define APP_IO_PIN_14 ((uint32_t)0x00004000U)
84 #define APP_IO_PIN_15 ((uint32_t)0x00008000U)
85 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR551X)
86 #define APP_IO_PIN_16 ((uint32_t)0x00010000U)
87 #define APP_IO_PIN_17 ((uint32_t)0x00020000U)
88 #define APP_IO_PIN_18 ((uint32_t)0x00040000U)
89 #define APP_IO_PIN_19 ((uint32_t)0x00080000U)
90 #define APP_IO_PIN_20 ((uint32_t)0x00100000U)
91 #define APP_IO_PIN_21 ((uint32_t)0x00200000U)
92 #define APP_IO_PIN_22 ((uint32_t)0x00400000U)
93 #define APP_IO_PIN_23 ((uint32_t)0x00800000U)
94 #define APP_IO_PIN_24 ((uint32_t)0x01000000U)
95 #define APP_IO_PIN_25 ((uint32_t)0x02000000U)
96 #define APP_IO_PIN_26 ((uint32_t)0x04000000U)
97 #define APP_IO_PIN_27 ((uint32_t)0x08000000U)
98 #define APP_IO_PIN_28 ((uint32_t)0x10000000U)
99 #define APP_IO_PIN_29 ((uint32_t)0x20000000U)
100 #define APP_IO_PIN_30 ((uint32_t)0x40000000U)
101 #define APP_IO_PIN_31 ((uint32_t)0x80000000U)
104 #define APP_IO_PINS_0_7 ((uint32_t)0x000000FFU)
105 #define APP_IO_PINS_0_15 ((uint32_t)0x0000FFFFU)
106 #define APP_IO_PINS_16_31 ((uint32_t)0xFFFF0000U)
107 #define APP_AON_IO_PIN_ALL ((uint32_t)0x000000FFU)
108 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5332X)
109 #define APP_IO_PIN_ALL ((uint32_t)0x00003FFFU)
110 #define APP_MSIO_IO_PIN_ALL ((uint32_t)0x000003FFU)
112 #define APP_IO_PIN_ALL ((uint32_t)0x0000FFFFU)
113 #define APP_MSIO_IO_PIN_ALL ((uint32_t)0x000000FFU)
115 #define APP_IO_PIN_MASK ((uint32_t)0xFFFFFFFFU)
120 #define APP_IO_DEFAULT_CONFIG \
122 .pin = APP_IO_PIN_ALL, \
123 .mode = APP_IO_MODE_INPUT, \
124 .pull = APP_IO_PULLDOWN, \
170 #if (APP_DRIVER_CHIP_TYPE != APP_DRIVER_GR551X)
171 APP_IO_MODE_IT_BOTH_EDGE,
193 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5332X)
276 #if (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5332X)
277 #define APP_IO_MUX APP_IO_MUX_0
278 #elif (APP_DRIVER_CHIP_TYPE == APP_DRIVER_GR5525X)
279 #define APP_IO_MUX APP_IO_MUX_8
281 #define APP_IO_MUX APP_IO_MUX_7
@ APP_IO_MUX_1
IO mux mode 1.
@ APP_IO_SPPED_MEDIUM
Select medium speed.
app_io_speed_t
GPIO Speed Structure definition.
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
IO mux mode 6.
app_io_mode_t mode
Specifies the operating mode for the selected pins.
GPIO Interrupt event Structure definition.
app_io_input_type_t
GPIO Input type Structure definition.
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
Interrupt Mode with High-level trigger detection.
@ APP_IO_MODE_ANALOG
Analog IO Mode.
@ APP_IO_NOPULL
No Pull-up or Pull-down activation.
void(* app_io_callback_t)(app_io_evt_t *p_evt)
GPIO callback type.
@ APP_IO_INPUT_TYPE_CMOS
Select CMOS input.
@ APP_IO_MUX_4
IO mux mode 4.
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
Interrupt Mode with Rising edge trigger detection.
@ APP_IO_MODE_MAX
Only for check parameter, not used as input parameters.
uint16_t app_io_deinit(app_io_type_t type, uint32_t pin)
De-initialize the GPIOx peripheral.
app_io_pull_t
GPIO pull Enumerations definition.
app_io_type_t
GPIO type Enumerations definition.
@ APP_IO_STRENGTH_HIGH
Select high output driver strength.
@ APP_IO_MUX_7
IO mux mode 7.
@ APP_IO_MODE_OUTPUT
Output Mode.
@ APP_IO_STRENGTH_ULTRA
Select high output driver strength.
@ APP_IO_TYPE_AON
Always-on Input/Output.
app_io_mode_t
GPIO mode Enumerations definition.
@ APP_IO_MUX_8
IO mux mode 8.
app_io_pull_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
@ APP_IO_PULL_MAX
Only for check parameter, not used as input parameters.
@ APP_IO_PIN_RESET
IO pin low level.
@ APP_IO_MODE_IT_FALLING
Interrupt Mode with Falling edge trigger detection.
@ APP_IO_TYPE_NORMAL
General Purpose Input/Output.
@ APP_IO_PULLUP
Pull-up activation.
@ APP_IO_STRENGTH_MAX
Only for check parameter, not used as input parameters.
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
Mixed Signal I/O.
@ APP_IO_MUX_MAX
Only for check parameter, not used as input parameters.
@ APP_IO_MUX_3
IO mux mode 3.
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
Only for check parameter, not used as input parameters.
@ APP_IO_MUX_5
IO mux mode 5.
@ APP_IO_MUX_0
IO mux mode 0.
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
IO mux mode 2.
@ APP_IO_SPPED_MAX
Only for check parameter, not used as input parameters.
@ APP_IO_MODE_INPUT
Input Mode.
void * arg
User parameters.
@ APP_IO_PIN_SET
IO pin high level.
@ APP_IO_PULLDOWN
Pull-down activation.
@ APP_IO_TYPE_MAX
Only for check parameter, not used as input parameters.
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
GPIO state Enumerations definition.
@ APP_IO_INPUT_TYPE_SCHMITT
Select Schmitt input.
app_io_type_t type
Type of event.
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
Select medium output driver strength.
uint16_t app_io_toggle_pin(app_io_type_t type, uint32_t pin)
Toggle the specified GPIO pin.
app_io_strength_t
GPIO Strength Structure definition.
app_io_mux_t
GPIO mux Enumerations definition.
@ APP_IO_TYPE_GPIOA
General Purpose Input/Output.
app_io_mux_t mux
Specifies the Peripheral to be connected to the selected pins.
@ APP_IO_MODE_MUX
Mux Mode.
Header file of app driver error code.
uint32_t pin
Specifies the IO pins to be configured.
Header file of app driver config code.
@ APP_IO_TYPE_GPIOC
General Purpose Input/Output.
@ APP_IO_TYPE_GPIOB
General Purpose Input/Output.
@ APP_IO_MODE_IT_LOW
Interrupt Mode with Low-level trigger detection.
GPIO parameter structure definition.
@ APP_IO_STRENGTH_LOW
Select low output driver strength.
@ APP_IO_SPPED_HIGH
Select high speed.
uint32_t pin
Specifies the IO pins to be configured.