Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
GPIO helper functions for STM32F1 and STM32F4. More...
#include <libopencm3/stm32/gpio.h>
Go to the source code of this file.
Typedefs | |
typedef uint32_t | gpio_port_t |
Abstract gpio port type for hardware independent part. More... | |
Functions | |
void | gpio_setup_output (uint32_t port, uint16_t gpios) |
Setup one or more pins of the given GPIO port as outputs. More... | |
void | gpio_setup_input (uint32_t port, uint16_t gpios) |
Setup one or more pins of the given GPIO port as inputs. More... | |
void | gpio_setup_input_pullup (uint32_t port, uint16_t gpios) |
Setup one or more pins of the given GPIO port as inputs with pull up resistor enabled. More... | |
void | gpio_setup_input_pulldown (uint32_t port, uint16_t gpios) |
Setup one or more pins of the given GPIO port as inputs with pull down resistors enabled. More... | |
void | gpio_setup_pin_af (uint32_t port, uint16_t pin, uint8_t af, bool is_output) |
Setup a gpio for input or output with alternate function. More... | |
void | gpio_setup_pin_analog (uint32_t port, uint16_t pin) |
Setup a gpio for analog use. More... | |
void | gpio_enable_clock (uint32_t port) |
Enable the relevant clock. More... | |
GPIO helper functions for STM32F1 and STM32F4.
The gpio_set and gpio_clear functions are already available from libopencm3.
Definition in file gpio_arch.h.
typedef uint32_t gpio_port_t |
Abstract gpio port type for hardware independent part.
Definition at line 39 of file gpio_arch.h.
void gpio_enable_clock | ( | uint32_t | port | ) |
Enable the relevant clock.
This is an STM32 specific helper funtion and should only be used in stm32 arch code.
Definition at line 34 of file gpio_arch.c.
References GPIOA, GPIOB, GPIOC, GPIOD, GPIOE, GPIOF, GPIOG, and GPIOH.
Referenced by softi2c_setup_gpio().
Setup one or more pins of the given GPIO port as inputs.
[in] | port | |
[in] | gpios | If multiple pins are to be changed, use logical OR '|' to separate them. |
Definition at line 33 of file gpio_arch.c.
References dir, GPIO_DIRECTION, GPIO_INPUT, gpiofp, and gpio_direction::pin.
Setup one or more pins of the given GPIO port as inputs with pull down resistors enabled.
[in] | port | |
[in] | gpios | If multiple pins are to be changed, use logical OR '|' to separate them. |
Setup one or more pins of the given GPIO port as inputs with pull up resistor enabled.
[in] | port | |
[in] | gpios | If multiple pins are to be changed, use logical OR '|' to separate them. |
Setup one or more pins of the given GPIO port as outputs.
[in] | port | |
[in] | gpios | If multiple pins are to be changed, use logical OR '|' to separate them. |
Definition at line 31 of file gpio_arch.c.
Setup a gpio for input or output with alternate function.
This is an STM32 specific helper funtion and should only be used in stm32 arch code.