libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
GPIO

VF6xx General-Purpose Input/Output (GPIO) More...

Collaboration diagram for GPIO:

Functions

void gpio_set (uint32_t gpio)
 Set GPIO. More...
 
void gpio_clear (uint32_t gpio)
 Set GPIO. More...
 
bool gpio_get (uint32_t gpio)
 Get GPIOs logic state. More...
 
void gpio_toggle (uint32_t gpio)
 Toggles GPIO. More...
 
uint32_t gpio_port_read (uint32_t gpioport)
 Read a whole GPIO Port. More...
 
void gpio_port_write (uint32_t gpioport, uint32_t data)
 Write a whole GPIO Port. More...
 

Detailed Description

VF6xx General-Purpose Input/Output (GPIO)

GPIO API.

Author
© 2014 Stefan Agner stefa.nosp@m.n@ag.nosp@m.ner.c.nosp@m.h
Date
03 July 2014

This library supports the GPIO module in the VF6xx SoC of Freescale. Access is provided by GPIO number according to the Pinmux list of the Reference Manual, similar as GPIOs are available on Linux.

LGPL License Terms libopencm3 License

Function Documentation

◆ gpio_clear()

void gpio_clear ( uint32_t  gpio)

Set GPIO.

Clears GPIO by GPIO number according to MUX list

Parameters
[in]gpiounsigned 32 bit. GPIO number

Definition at line 65 of file gpio.c.

References GPIO, GPIO_OFFSET, and GPIO_PCOR.

◆ gpio_get()

bool gpio_get ( uint32_t  gpio)

Get GPIOs logic state.

Get logic level of GPIO given by GPIO number according to MUX list. Reading a GPIO value is possible even if the port is not muxed for GPIO.

Parameters
[in]gpiounsigned 32 bit. GPIO number
Returns
the logic state of the given GPIO.

Definition at line 81 of file gpio.c.

References GPIO, GPIO_OFFSET, and GPIO_PDIR.

◆ gpio_port_read()

uint32_t gpio_port_read ( uint32_t  gpioport)

Read a whole GPIO Port.

Gets all 32 GPIOs of a Port.

Parameters
[in]gpioportunsigned 32 bit. GPIO port GPIO register base addresses
Returns
the logic states of the given GPIO port.

Definition at line 110 of file gpio.c.

References GPIO_PDIR.

◆ gpio_port_write()

void gpio_port_write ( uint32_t  gpioport,
uint32_t  data 
)

Write a whole GPIO Port.

Sets all 32 GPIOs of a Port.

Parameters
[in]gpioportunsigned 32 bit. GPIO port GPIO register base addresses
[in]gpiounsigned 32 bit. 1 for a logic 1 driven at port, 0 for a logic 0 driven at port.

Definition at line 125 of file gpio.c.

References GPIO_PDOR.

◆ gpio_set()

void gpio_set ( uint32_t  gpio)

Set GPIO.

Set GPIO by GPIO number according to MUX list

Parameters
[in]gpiounsigned 32 bit. GPIO number

Definition at line 51 of file gpio.c.

References GPIO, GPIO_OFFSET, and GPIO_PSOR.

◆ gpio_toggle()

void gpio_toggle ( uint32_t  gpio)

Toggles GPIO.

Toggles GPIO by GPIO number according to MUX list

Parameters
[in]gpiounsigned 32 bit. GPIO number

Definition at line 95 of file gpio.c.

References GPIO, GPIO_OFFSET, and GPIO_PTOR.