Functions
IO operation functions
Peripheral Driver » HAL Driver » GPIO » Functions

## Functions
gpio_pin_state_t | hal_gpio_read_pin (gpio_regs_t *GPIOx, uint16_t gpio_pin)
| Read the specified input port pin. More...
void | hal_gpio_write_pin (gpio_regs_t *GPIOx, uint16_t gpio_pin, gpio_pin_state_t pin_state)
| Set or clear the selected data port bit. More...
void | hal_gpio_toggle_pin (gpio_regs_t *GPIOx, uint16_t gpio_pin)
| Toggle the specified GPIO pin. More...

## Detailed Description

## Function Documentation

## ◆ hal_gpio_read_pin()

gpio_pin_state_t hal_gpio_read_pin | ( | gpio_regs_t * | GPIOx,
|  | uint16_t | gpio_pin
| ) |  |

Read the specified input port pin.

Parameters

  [in] | GPIOx | Where x can be (0, 1) to select the GPIO peripheral port
  [in] | gpio_pin | Specifies the port bit to be read. This parameter can be a one of the following values: GPIO_PIN_0 GPIO_PIN_1 GPIO_PIN_2 GPIO_PIN_3 GPIO_PIN_4 GPIO_PIN_5 GPIO_PIN_6 GPIO_PIN_7 GPIO_PIN_8 GPIO_PIN_9 GPIO_PIN_10 GPIO_PIN_11 GPIO_PIN_12 GPIO_PIN_13 GPIO_PIN_14 GPIO_PIN_15

Return values

  GPIO_PIN_RESET | GPIO pin low level.
  GPIO_PIN_SET | GPIO pin high level.

## ◆ hal_gpio_toggle_pin()

void hal_gpio_toggle_pin | ( | gpio_regs_t * | GPIOx,
|  | uint16_t | gpio_pin
| ) |  |

Toggle the specified GPIO pin.

Parameters

  [in] | GPIOx | Where x can be (0, 1) to select the GPIO peripheral port
  [in] | gpio_pin | Specifies the pin to be toggled. This parameter can be a combiantion of the following values: GPIO_PIN_0 GPIO_PIN_1 GPIO_PIN_2 GPIO_PIN_3 GPIO_PIN_4 GPIO_PIN_5 GPIO_PIN_6 GPIO_PIN_7 GPIO_PIN_8 GPIO_PIN_9 GPIO_PIN_10 GPIO_PIN_11 GPIO_PIN_12 GPIO_PIN_13 GPIO_PIN_14 GPIO_PIN_15 GPIO_PIN_ALL

## ◆ hal_gpio_write_pin()

void hal_gpio_write_pin | ( | gpio_regs_t * | GPIOx,
|  | uint16_t | gpio_pin,
|  | gpio_pin_state_t | pin_state
| ) |  |

Set or clear the selected data port bit.

Parameters

  [in] | GPIOx | Where x can be (0, 1) to select the GPIO peripheral port
  [in] | gpio_pin | Specifies the port bit to be written. This parameter can be a combiantion of the following values: GPIO_PIN_0 GPIO_PIN_1 GPIO_PIN_2 GPIO_PIN_3 GPIO_PIN_4 GPIO_PIN_5 GPIO_PIN_6 GPIO_PIN_7 GPIO_PIN_8 GPIO_PIN_9 GPIO_PIN_10 GPIO_PIN_11 GPIO_PIN_12 GPIO_PIN_13 GPIO_PIN_14 GPIO_PIN_15 GPIO_PIN_ALL
  [in] | pin_state | Specifies the value to be written to the selected bit. This parameter can be one of the GPIO_PinState enum values: GPIO_PIN_RESET clear the port pin GPIO_PIN_SET set the port pin