Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gpio_arch.h File Reference

GPIO helper functions for STM32F1 and STM32F4. More...

#include <libopencm3/stm32/gpio.h>
+ Include dependency graph for gpio_arch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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_t 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...
 

Detailed Description

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.

Function Documentation

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 SpektrumUartInit().

+ Here is the caller graph for this function:

void gpio_setup_input ( uint32_t  port,
uint16_t  gpios 
)

Setup one or more pins of the given GPIO port as inputs.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 86 of file gpio_ardrone.c.

References GPIO_DIRECTION, GPIO_INPUT, gpiofp, gpio_direction::mode, and gpio_direction::pin.

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.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Referenced by baro_init(), and radio_control_spektrum_try_bind().

+ Here is the caller graph for this function:

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.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Referenced by main(), and radio_control_spektrum_try_bind().

+ Here is the caller graph for this function:

void gpio_setup_output ( uint32_t  port,
uint16_t  gpios 
)

Setup one or more pins of the given GPIO port as outputs.

Parameters
[in]port
[in]gpiosIf multiple pins are to be changed, use logical OR '|' to separate them.

Definition at line 102 of file gpio_ardrone.c.

void gpio_setup_pin_af ( uint32_t  port,
uint16_t  pin,
uint8_t  af,
bool_t  is_output 
)

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.

Referenced by actuators_dualpwm_arch_init(), actuators_pwm_arch_init(), ppm_arch_init(), pwm_input_init(), SpektrumUartInit(), spi1_arch_init(), and spi2_arch_init().

+ Here is the caller graph for this function:

void gpio_setup_pin_analog ( uint32_t  port,
uint16_t  pin 
)

Setup a gpio for analog use.

This is an STM32 specific helper funtion and should only be used in stm32 arch code.

Referenced by adc_init().

+ Here is the caller graph for this function: