IO operation 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]GPIOxWhere x can be (0, 1) to select the GPIO peripheral port
[in]gpio_pinSpecifies the port bit to be read. This parameter can be a one of the following values:
Return values
GPIO_PIN_RESETGPIO pin low level.
GPIO_PIN_SETGPIO 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]GPIOxWhere x can be (0, 1) to select the GPIO peripheral port
[in]gpio_pinSpecifies the pin to be toggled. This parameter can be a combiantion of the following values:

◆ 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]GPIOxWhere x can be (0, 1) to select the GPIO peripheral port
[in]gpio_pinSpecifies the port bit to be written. This parameter can be a combiantion of the following values:
[in]pin_stateSpecifies the value to be written to the selected bit. This parameter can be one of the GPIO_PinState enum values: