35 #ifndef __HAL_GPIO_H__ 36 #define __HAL_GPIO_H__ 37 #include "hal_platform.h" 38 #include "hal_pinmux_define.h" 40 #ifdef HAL_GPIO_MODULE_ENABLED 84 #ifdef HAL_GPIO_FEATURE_PUPD 99 #ifdef HAL_GPIO_FEATURE_INVERSE 114 #ifdef HAL_GPIO_FEATURE_CLOCKOUT 240 #ifdef HAL_GPIO_FEATURE_SET_DRIVING 243 HAL_GPIO_DRIVING_CURRENT_4MA = 0,
244 HAL_GPIO_DRIVING_CURRENT_8MA = 1,
245 HAL_GPIO_DRIVING_CURRENT_12MA = 2,
246 HAL_GPIO_DRIVING_CURRENT_16MA = 3
247 } hal_gpio_driving_current_t;
375 #ifdef HAL_GPIO_FEATURE_HIGH_Z 445 #ifdef HAL_GPIO_FEATURE_INVERSE 572 #ifdef HAL_GPIO_FEATURE_PUPD 601 #ifdef HAL_GPIO_FEATURE_CLOCKOUT 630 #ifdef HAL_GPIO_FEATURE_SET_DRIVING hal_gpio_status_t hal_gpio_set_output(hal_gpio_pin_t gpio_pin, hal_gpio_data_t gpio_data)
This function sets the output data of the target GPIO.
hal_gpio_status_t hal_gpio_init(hal_gpio_pin_t gpio_pin)
This function initializes the GPIO hardware with basic functionality.
hal_gpio_status_t hal_gpio_disable_pull(hal_gpio_pin_t gpio_pin)
This function disables pull-up or pull-down of the target GPIO.
hal_gpio_status_t hal_gpio_pull_down(hal_gpio_pin_t gpio_pin)
This function sets the target GPIO to the pull-down state, after this function, the input data of the...
hal_gpio_status_t hal_gpio_set_pupd_register(hal_gpio_pin_t gpio_pin, uint8_t gpio_pupd, uint8_t gpio_r0, uint8_t gpio_r1)
This function sets the pull up/down state of the GPIO that has more than one pull-up or pull-down res...
hal_gpio_status_t hal_gpio_get_direction(hal_gpio_pin_t gpio_pin, hal_gpio_direction_t *gpio_direction)
This function gets the direction of the target GPIO.
hal_gpio_status_t hal_gpio_enable_inversion(hal_gpio_pin_t gpio_pin)
This function enables the input data inversion of the target GPIO, after this function, the input data of the target GPIO will always be inversed until the inverse function is disabled.
hal_gpio_direction_t
This enum defines the GPIO direction.
Definition: hal_gpio.h:210
Invalid input pin port.
Definition: hal_gpio.h:235
hal_gpio_status_t hal_gpio_pull_up(hal_gpio_pin_t gpio_pin)
This function sets the target GPIO to pull-up state, after this function, the input data of the targe...
GPIO output direction.
Definition: hal_gpio.h:212
The pinmux function failed to execute.
Definition: hal_gpio.h:234
hal_gpio_status_t hal_gpio_disable_inversion(hal_gpio_pin_t gpio_pin)
This function disables the input data inversion of the target GPIO.
The GPIO function executed successfully.
Definition: hal_gpio.h:228
hal_gpio_status_t hal_gpio_set_direction(hal_gpio_pin_t gpio_pin, hal_gpio_direction_t gpio_direction)
This function sets the direction of the target GPIO.
The GPIO function failed to execute.
Definition: hal_gpio.h:225
hal_gpio_clock_t
This enum defines output clock number of GPIO.
Definition: hal_platform.h:415
hal_gpio_pin_t
This enum defines the GPIO port.
Definition: hal_platform.h:339
hal_gpio_status_t hal_gpio_set_clockout(hal_gpio_clock_t gpio_clock_num, hal_gpio_clock_mode_t clock_mode)
This function sets the clock-out source of the target GPIO.
hal_gpio_status_t hal_gpio_toggle_pin(hal_gpio_pin_t gpio_pin)
This function toggles the output data of the target GPIO when the direction of the pin is output...
hal_pinmux_status_t hal_pinmux_set_function(hal_gpio_pin_t gpio_pin, uint8_t function_index)
This function configures the pinmux of target GPIO.
GPIO data high.
Definition: hal_gpio.h:219
hal_gpio_clock_mode_t
This enum defines output clock mode of GPIO.
Definition: hal_platform.h:427
hal_gpio_status_t hal_gpio_clear_high_impedance(hal_gpio_pin_t gpio_pin)
This function removes the high impedance state for the target GPIO.
Invalid input pin number.
Definition: hal_gpio.h:226
The pinmux function executed successfully.
Definition: hal_gpio.h:237
hal_gpio_data_t
This enum defines the data type of GPIO.
Definition: hal_gpio.h:217
hal_pinmux_status_t
This enum defines the return type of pinmux API.
Definition: hal_gpio.h:233
hal_gpio_status_t hal_gpio_deinit(hal_gpio_pin_t gpio_pin)
This function deinitializes the GPIO hardware to its default status.
Invalid input function.
Definition: hal_gpio.h:236
Invalid input parameter.
Definition: hal_gpio.h:227
hal_gpio_status_t hal_gpio_get_input(hal_gpio_pin_t gpio_pin, hal_gpio_data_t *gpio_data)
This function gets the input data of target GPIO when the direction of the GPIO is input...
GPIO input direction.
Definition: hal_gpio.h:211
hal_gpio_status_t
This enum defines the return type of GPIO API.
Definition: hal_gpio.h:224
hal_gpio_status_t hal_gpio_set_high_impedance(hal_gpio_pin_t gpio_pin)
This function sets the target GPIO to high impedance state.
GPIO data low.
Definition: hal_gpio.h:218
hal_gpio_status_t hal_gpio_get_output(hal_gpio_pin_t gpio_pin, hal_gpio_data_t *gpio_data)
This function gets the output data of the target GPIO when the direction of the GPIO is output...