APM:Libraries
Functions | Variables
gpio_hal.c File Reference
#include <gpio_hal.h>
Include dependency graph for gpio_hal.c:

Go to the source code of this file.

Functions

void gpio_init_all (void)
 
void gpio_set_mode (const gpio_dev *const dev, uint8_t pin, gpio_pin_mode mode)
 

Variables

const gpio_dev gpioa
 
const gpio_dev *const _GPIOA = &gpioa
 
const gpio_dev gpiob
 
const gpio_dev *const _GPIOB = &gpiob
 
const gpio_dev gpioc
 
const gpio_dev *const _GPIOC = &gpioc
 
const gpio_dev gpiod
 
const gpio_dev *const _GPIOD = &gpiod
 
const gpio_dev gpioe
 
const gpio_dev *const _GPIOE = &gpioe
 
const gpio_dev gpiof
 
const gpio_dev *const _GPIOF = &gpiof
 
const gpio_dev gpiog
 
const gpio_dev *const _GPIOG = &gpiog
 
static const gpio_dev_gpios [] = { &gpioa, &gpiob, &gpioc, &gpiod, &gpioe, &gpiof, &gpiog }
 

Function Documentation

◆ gpio_init_all()

void gpio_init_all ( void  )

Initialize and reset all available GPIO devices.

Definition at line 90 of file gpio_hal.c.

Referenced by F4Light::GPIO::init().

Here is the caller graph for this function:

◆ gpio_set_mode()

void gpio_set_mode ( const gpio_dev *const  dev,
uint8_t  pin,
gpio_pin_mode  mode 
)

Set the mode of a GPIO pin.

Definition at line 125 of file gpio_hal.c.

Referenced by F4Light::GPIO::_pinMode(), F4Light::UARTDriver::begin(), boardInit(), i2c_master_release_bus(), F4Light::SPIDevice::init(), Soft_I2C::init_hw(), F4Light::DigitalSource::mode(), pwmInitializeInput(), F4Light::AnalogSource::setup_read(), spi_gpio_master_cfg(), spi_gpio_slave_cfg(), F4Light::AnalogSource::stop_read(), usb_close(), usb_periphcfg(), and usb_setParams().

Here is the caller graph for this function:

Variable Documentation

◆ _GPIOA

const gpio_dev* const _GPIOA = &gpioa

GPIO port A device.

Definition at line 23 of file gpio_hal.c.

Referenced by usb_periphcfg().

◆ _GPIOB

const gpio_dev* const _GPIOB = &gpiob

GPIO port B device.

Definition at line 31 of file gpio_hal.c.

◆ _GPIOC

const gpio_dev* const _GPIOC = &gpioc

GPIO port C device.

Definition at line 39 of file gpio_hal.c.

◆ _GPIOD

const gpio_dev* const _GPIOD = &gpiod

GPIO port D device.

Definition at line 47 of file gpio_hal.c.

◆ _GPIOE

const gpio_dev* const _GPIOE = &gpioe

GPIO port E device.

Definition at line 55 of file gpio_hal.c.

◆ _GPIOF

const gpio_dev* const _GPIOF = &gpiof

GPIO port F device.

Definition at line 63 of file gpio_hal.c.

◆ _GPIOG

const gpio_dev* const _GPIOG = &gpiog

GPIO port G device.

Definition at line 71 of file gpio_hal.c.

◆ _gpios

const gpio_dev* _gpios[] = { &gpioa, &gpiob, &gpioc, &gpiod, &gpioe, &gpiof, &gpiog }
static

Definition at line 75 of file gpio_hal.c.

◆ gpioa

const gpio_dev gpioa
Initial value:
= {
.GPIOx = GPIOA,
.clk = RCC_AHB1Periph_GPIOA,
.exti_port = AFIO_EXTI_PA,
}

Definition at line 17 of file gpio_hal.c.

◆ gpiob

const gpio_dev gpiob
Initial value:
= {
.GPIOx = GPIOB,
.clk = RCC_AHB1Periph_GPIOB,
.exti_port = AFIO_EXTI_PB,
}

Definition at line 25 of file gpio_hal.c.

◆ gpioc

const gpio_dev gpioc
Initial value:
= {
.GPIOx = GPIOC,
.clk = RCC_AHB1Periph_GPIOC,
.exti_port = AFIO_EXTI_PC,
}

Definition at line 33 of file gpio_hal.c.

◆ gpiod

const gpio_dev gpiod
Initial value:
= {
.GPIOx = GPIOD,
.clk = RCC_AHB1Periph_GPIOD,
.exti_port = AFIO_EXTI_PD,
}

Definition at line 41 of file gpio_hal.c.

◆ gpioe

const gpio_dev gpioe
Initial value:
= {
.GPIOx = GPIOE,
.clk = RCC_AHB1Periph_GPIOE,
.exti_port = AFIO_EXTI_PE,
}

Definition at line 49 of file gpio_hal.c.

◆ gpiof

const gpio_dev gpiof
Initial value:
= {
.GPIOx = GPIOF,
.clk = RCC_AHB1Periph_GPIOF,
.exti_port = AFIO_EXTI_PF,
}

Definition at line 57 of file gpio_hal.c.

◆ gpiog

const gpio_dev gpiog
Initial value:
= {
.GPIOx = GPIOG,
.clk = RCC_AHB1Periph_GPIOG,
.exti_port = AFIO_EXTI_PG,
}

Definition at line 65 of file gpio_hal.c.