Go to the documentation of this file.
52 #ifndef __GR55xx_HAL_AON_GPIO_H__
53 #define __GR55xx_HAL_AON_GPIO_H__
136 #define AON_GPIO_PIN_0 ((uint16_t)0x0001U)
137 #define AON_GPIO_PIN_1 ((uint16_t)0x0002U)
138 #define AON_GPIO_PIN_2 ((uint16_t)0x0004U)
139 #define AON_GPIO_PIN_3 ((uint16_t)0x0008U)
140 #define AON_GPIO_PIN_4 ((uint16_t)0x0010U)
141 #define AON_GPIO_PIN_5 ((uint16_t)0x0020U)
142 #define AON_GPIO_PIN_6 ((uint16_t)0x0040U)
143 #define AON_GPIO_PIN_7 ((uint16_t)0x0080U)
145 #define AON_GPIO_PIN_ALL ((uint16_t)0x00FFU)
147 #define AON_GPIO_PIN_MASK (0x000000FFU)
157 #define AON_GPIO_MODE_INPUT (LL_AON_GPIO_MODE_INPUT << 0)
158 #define AON_GPIO_MODE_OUTPUT (LL_AON_GPIO_MODE_OUTPUT << 0)
159 #define AON_GPIO_MODE_MUX (LL_GPIO_MODE_MUX << 0)
160 #define AON_GPIO_MODE_IT_RISING (LL_AON_GPIO_TRIGGER_RISING << 4)
161 #define AON_GPIO_MODE_IT_FALLING (LL_AON_GPIO_TRIGGER_FALLING << 4)
162 #define AON_GPIO_MODE_IT_HIGH (LL_AON_GPIO_TRIGGER_HIGH << 4)
163 #define AON_GPIO_MODE_IT_LOW (LL_AON_GPIO_TRIGGER_LOW << 4)
171 #define AON_GPIO_NOPULL LL_AON_GPIO_PULL_NO
172 #define AON_GPIO_PULLUP LL_AON_GPIO_PULL_UP
173 #define AON_GPIO_PULLDOWN LL_AON_GPIO_PULL_DOWN
179 #define AON_GPIO_DEFAULT_CONFIG \
181 .pin = AON_GPIO_PIN_ALL, \
182 .mode = AON_GPIO_MODE_INPUT, \
183 .pull = AON_GPIO_PULLDOWN, \
184 .mux = AON_GPIO_MUX_7, \
199 #define __HAL_AON_GPIO_IT_GET_IT(__AON_GPIO_PIN__) ll_aon_gpio_read_flag_it(__AON_GPIO_PIN__)
207 #define __HAL_AON_GPIO_IT_CLEAR_IT(__AON_GPIO_PIN__) ll_aon_gpio_clear_flag_it(__AON_GPIO_PIN__)
221 #define IS_AON_GPIO_PIN_ACTION(__ACTION__) (((__ACTION__) == AON_GPIO_PIN_RESET) || ((__ACTION__) == AON_GPIO_PIN_SET))
228 #define IS_AON_GPIO_PIN(__PIN__) ((((__PIN__) & AON_GPIO_PIN_MASK) != 0x00U) &&\
229 (((__PIN__) & ~AON_GPIO_PIN_MASK) == 0x00U))
236 #define IS_AON_GPIO_MODE(__MODE__) (((__MODE__) == AON_GPIO_MODE_INPUT) ||\
237 ((__MODE__) == AON_GPIO_MODE_OUTPUT) ||\
238 ((__MODE__) == AON_GPIO_MODE_MUX) ||\
239 ((__MODE__) == AON_GPIO_MODE_IT_RISING) ||\
240 ((__MODE__) == AON_GPIO_MODE_IT_FALLING) ||\
241 ((__MODE__) == AON_GPIO_MODE_IT_HIGH) ||\
242 ((__MODE__) == AON_GPIO_MODE_IT_LOW))
249 #define IS_AON_GPIO_PULL(__PULL__) (((__PULL__) == AON_GPIO_NOPULL) ||\
250 ((__PULL__) == AON_GPIO_PULLUP) || \
251 ((__PULL__) == AON_GPIO_PULLDOWN))
struct _aon_gpio_init aon_gpio_init_t
AON_GPIO init structure definition.
void hal_aon_gpio_toggle_pin(uint16_t aon_gpio_pin)
Toggle the specified AON_GPIO pin.
void hal_aon_gpio_deinit(uint32_t aon_gpio_pin)
De-initialize the AON_GPIOx peripheral registers to their default reset values.
Header file containing functions prototypes of AON GPIO LL library.
aon_gpio_pin_state_t
AON_GPIO Bit SET and Bit RESET enumerations.
@ AON_GPIO_PIN_RESET
AON GPIO pin low level.
void hal_aon_gpio_write_pin(uint16_t aon_gpio_pin, aon_gpio_pin_state_t pin_state)
Set or clear the selected data port bit.
void(* aon_gpio_callback)(uint16_t aon_gpio_pin)
AON GPIO pin detection callback
uint32_t pin
Specifies the AON_GPIO pins to be configured.
HAL AON_GPIO Callback function definition.
struct _hal_aon_gpio_callback hal_aon_gpio_callback_t
HAL AON_GPIO Callback function definition.
void hal_aon_gpio_callback(uint16_t aon_gpio_pin)
AON GPIO pin detection callback.
@ AON_GPIO_PIN_SET
AON GPIO pin high level.
uint32_t mux
Specifies the Peripheral to be connected to the selected pins.
uint32_t pull
Specifies the Pull-up or Pull-Down activation for the selected pins.
uint32_t mode
Specifies the operating mode for the selected pins.
void hal_aon_gpio_init(aon_gpio_init_t *p_aon_gpio_init)
Initialize the AON_GPIOx peripheral according to the specified parameters in the aon_gpio_init_t.
AON_GPIO init structure definition.
void hal_aon_gpio_irq_handler(void)
Handle AON_GPIO interrupt request.
aon_gpio_pin_state_t hal_aon_gpio_read_pin(uint16_t aon_gpio_pin)
Read the specified input port pin.
This file contains HAL common definitions, enumeration, macros and structures definitions.
Header file containing extended macro of AON GPIO HAL library.