Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
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.

Functions

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

Detailed Description

gpio functions implemented for ChibiOS arch

Definition in file gpio_arch.h.

Typedef Documentation

◆ gpio_port_t

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

◆ gpio_clear()

void gpio_clear ( ioportid_t port,
uint16_t pin )
inlinestatic

Clear a gpio output to low level.

Parameters
[in]port
[in]pin

Definition at line 114 of file gpio_arch.h.

Referenced by cyrf6936_init(), humid_sht_init(), imu_heater_periodic(), power_switch_init(), power_switch_set(), pump_activate(), pump_control_init(), pump_purge(), pump_stop(), softi2c_gpio_drive_low(), spi_slave_select(), and w5100_init().

Here is the caller graph for this function:

◆ gpio_get()

uint8_t gpio_get ( ioportid_t port,
uint16_t pin )
inlinestatic

Get level of a gpio.

Parameters
[in]port
[in]pin

Definition at line 94 of file gpio_arch.h.

Referenced by bf_IORead(), hx711_event(), mcu_init(), opa_controller_periodic(), pwmpcb(), softi2c_gpio_read(), softi2c_read_bit(), softi2c_write_bit(), softi2c_write_restart(), softi2c_write_stop(), spektrum_try_bind(), and superbitrf_event().

Here is the caller graph for this function:

◆ gpio_set()

void gpio_set ( ioportid_t port,
uint16_t pin )
inlinestatic

Set a gpio output to high level.

Parameters
[in]port
[in]pin

Definition at line 104 of file gpio_arch.h.

Referenced by cyrf6936_init(), imu_aspirin_i2c_init(), imu_heater_periodic(), mf_ptu_init(), power_switch_set(), pump_activate(), pump_purge(), softi2c_gpio_highz(), spektrum_bind(), spi_slave_unselect(), and w5100_init().

Here is the caller graph for this function:

◆ gpio_setup_input()

void gpio_setup_input ( ioportid_t port,
uint16_t gpios )
extern

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 bf_IOConfigGPIO(), humid_sht_init(), hx711_init(), mcu_init(), opa_controller_init(), softi2c_gpio_highz(), spektrum_bind(), and superbitrf_init().

Here is the caller graph for this function:

◆ gpio_setup_input_pulldown()

void gpio_setup_input_pulldown ( ioportid_t port,
uint16_t gpios )
extern

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

Here is the caller graph for this function:

◆ gpio_setup_input_pullup()

void gpio_setup_input_pullup ( ioportid_t port,
uint16_t gpios )
extern

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 bf_IOConfigGPIO(), softi2c_gpio_highz(), and spektrum_try_bind().

Here is the caller graph for this function:

◆ gpio_setup_output()

void gpio_setup_output ( ioportid_t port,
uint16_t gpios )
extern

◆ gpio_setup_pin_af()

void gpio_setup_pin_af ( ioportid_t port,
uint16_t pin,
uint8_t af,
bool is_output )
extern

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 65 of file gpio_arch.c.

Referenced by actuators_dshot_arch_init(), actuators_pwm_arch_init(), buzzer_arch_init(), hx711_init(), light_ws2812_arch_init(), and pwm_input_init().

Here is the caller graph for this function:

◆ gpio_setup_pin_af_pullup()

void gpio_setup_pin_af_pullup ( ioportid_t port,
uint16_t pin,
uint8_t af )

Setup a gpio for input pullup 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_dshot_arch_init().

Here is the caller graph for this function:

◆ gpio_setup_pin_analog()

void gpio_setup_pin_analog ( ioportid_t port,
uint16_t pin )
extern

Setup a gpio for analog use.

Parameters
[in]port
[in]pin

Definition at line 90 of file gpio_arch.c.

Referenced by adc_init().

Here is the caller graph for this function:

◆ gpio_toggle()

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 124 of file gpio_arch.h.

Referenced by bat_checker_periodic(), bf_IOToggle(), and spektrum_bind().

Here is the caller graph for this function: