Paparazzi UAS  v5.14.0_stable-0-g3f680d1
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 functions implemented for ChibiOS arch More...

#include <hal.h>
#include "mcu_periph/gpio_def.h"
+ Include dependency graph for gpio_arch.h:

Go to the source code of this file.

Typedefs

typedef ioportid_t gpio_port_t
 Abstract gpio port type for hardware independent part. More...
 

Functions

void gpio_setup_output (ioportid_t port, uint16_t gpios)
 Setup one or more pins of the given GPIO port as outputs. More...
 
void gpio_setup_input (ioportid_t port, uint16_t gpios)
 Setup one or more pins of the given GPIO port as inputs. More...
 
void gpio_setup_input_pullup (ioportid_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 (ioportid_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 (ioportid_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 (ioportid_t port, uint16_t pin)
 Setup a gpio for analog use. More...
 
static uint8_t gpio_get (ioportid_t port, uint16_t pin)
 Get level of a gpio. More...
 
static void gpio_set (ioportid_t port, uint16_t pin)
 Set a gpio output to high level. More...
 
static void gpio_clear (ioportid_t port, uint16_t pin)
 Clear a gpio output to low level. More...
 
static void gpio_toggle (ioportid_t port, uint16_t pin)
 Toggle a gpio output to low level. More...
 

Detailed Description

gpio functions implemented for ChibiOS arch

Definition in file gpio_arch.h.

Typedef Documentation

typedef ioportid_t gpio_port_t

Abstract gpio port type for hardware independent part.

Definition at line 39 of file gpio_arch.h.

Function Documentation

static void gpio_clear ( ioportid_t  port,
uint16_t  pin 
)
inlinestatic
static uint8_t gpio_get ( ioportid_t  port,
uint16_t  pin 
)
inlinestatic

Get level of a gpio.

Parameters
[in]port
[in]pin

Definition at line 88 of file gpio_arch.h.

Referenced by actuators_ardrone_motor_status(), baro_eoc(), imu_aspirin_eoc(), mag_eoc(), main_event(), mcu_init(), opa_controller_periodic(), spektrum_try_bind(), and superbitrf_event().

+ Here is the caller graph for this function:

static void gpio_set ( ioportid_t  port,
uint16_t  pin 
)
inlinestatic
void gpio_setup_input ( ioportid_t  port,
uint16_t  gpios 
)

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

Parameters
[in]port
[in]gpios

Definition at line 40 of file gpio_arch.c.

Referenced by actuators_ardrone_init(), humid_sht_init(), mcu_init(), opa_controller_init(), spektrum_bind(), and superbitrf_init().

+ Here is the caller graph for this function:

void gpio_setup_input_pulldown ( ioportid_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]gpios

Definition at line 54 of file gpio_arch.c.

Referenced by baro_init(), and spektrum_try_bind().

+ Here is the caller graph for this function:

void gpio_setup_input_pullup ( ioportid_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]gpios

Definition at line 47 of file gpio_arch.c.

Referenced by main(), and spektrum_try_bind().

+ Here is the caller graph for this function:

void gpio_setup_pin_af ( ioportid_t  port,
uint16_t  pin,
uint8_t  af,
bool  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 code.

Definition at line 61 of file gpio_arch.c.

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

+ Here is the caller graph for this function:

void gpio_setup_pin_analog ( ioportid_t  port,
uint16_t  pin 
)

Setup a gpio for analog use.

Parameters
[in]port
[in]pin

Definition at line 86 of file gpio_arch.c.

Referenced by adc_init().

+ Here is the caller graph for this function:

static void gpio_toggle ( ioportid_t  port,
uint16_t  pin 
)
inlinestatic

Toggle a gpio output to low level.

Parameters
[in]port
[in]pin

Definition at line 118 of file gpio_arch.h.

Referenced by bat_checker_periodic(), and spektrum_bind().

+ Here is the caller graph for this function: