BeRTOS
Functions
gpio_stm32.h File Reference

STM32 GPIO control interface. More...

#include <io/stm32.h>

Go to the source code of this file.

Enumerations

enum  
 GPIO mode.
enum  
 GPIO speed.

Functions

void stm32_gpioPinWrite (struct stm32_gpio *base, uint16_t pins, bool val)
 Write a value to the specified pin(s)
uint16_t stm32_gpioPinRead (struct stm32_gpio *base, uint16_t pins)
 Read a value from the specified pin(s)
int stm32_gpioPinConfig (struct stm32_gpio *base, uint16_t pins, uint8_t mode, uint8_t speed)
 Initialize a GPIO peripheral configuration.

Detailed Description

STM32 GPIO control interface.

Definition in file gpio_stm32.h.


Function Documentation

int stm32_gpioPinConfig ( struct stm32_gpio base,
uint16_t  pins,
uint8_t  mode,
uint8_t  speed 
)

Initialize a GPIO peripheral configuration.

Parameters:
basegpio register address
pinsmask of pins that we want to configure
modeselect the behaviour of selected pins
speedclock frequency for selected gpio ports

Initialize a GPIO peripheral configuration.

Parameters:
baseBase address of the GPIO port
pinsBit-packed representation of the pin(s)
modePin(s) configuration mode
speedOutput drive speed

Return 0 on success, otherwise a negative value.

Definition at line 56 of file gpio_stm32.c.

uint16_t stm32_gpioPinRead ( struct stm32_gpio base,
uint16_t  pins 
) [inline]

Read a value from the specified pin(s)

Parameters:
basegpio register address
pinsmask of pins that we want read

Definition at line 91 of file gpio_stm32.h.

void stm32_gpioPinWrite ( struct stm32_gpio base,
uint16_t  pins,
bool  val 
) [inline]

Write a value to the specified pin(s)

Parameters:
basegpio register address
pinsmask of pins that we want set or clear
valtrue to set selected pins of false to clear they.

Definition at line 77 of file gpio_stm32.h.