GPIO Functions

Top  Previous  Next
Got to SUB-20 page

GPIO Functional Description

SUB-20 GPIO can be in input or output state. GPIO state is defined by configuration bit. In output state GPIO will drive high or low level depending on output status. In input state GPIO can be pulled high by internal weak pull-up resistor.

 

gpio

 

GPIO Pin configuration

Configuration

State

Output Status

"0"

"1"

"0"

Input state

HiZ

pull-up

"1"

Output state

LOW

HIGH

 

GPIOB

GPIOB are located on SPI header (see SPI Header). GPIOB module shares I/O pins with SPI module. If SPI is enabled MISO,MOSI,SCK and SS0 pins are partially controlled by SPI module, although they can be accessed by GPIOB functions with restrictions.

Special care should be taken for SUB-Lxxx models where SPI Level Converters are installed. In this case GPIOB pins direction should respect direction of the corresponding Level Converter to prevent short circuit on this pins.

Functions

sub_gpio_config

sub_gpio_read

sub_gpio_write

sub_gpiob_config

sub_gpiob_read

sub_gpiob_write