distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
STM32-GPIOv2.hpp File Reference

Header for GPIOv2 functions for STM32. More...

#include "distortos/chip/CMSIS-proxy.h"
#include <utility>
Include dependency graph for STM32-GPIOv2.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 distortos
 Top-level namespace of distortos project.
 
 distortos::chip
 Chip-related code of distortos project.
 

Enumerations

enum  distortos::chip::Pin : uint32_t {
  distortos::chip::Pin::pa0 = GPIOA_BASE | 0, distortos::chip::Pin::pa1 = GPIOA_BASE | 1, distortos::chip::Pin::pa2 = GPIOA_BASE | 2, distortos::chip::Pin::pa3 = GPIOA_BASE | 3,
  distortos::chip::Pin::pa4 = GPIOA_BASE | 4, distortos::chip::Pin::pa5 = GPIOA_BASE | 5, distortos::chip::Pin::pa6 = GPIOA_BASE | 6, distortos::chip::Pin::pa7 = GPIOA_BASE | 7,
  distortos::chip::Pin::pa8 = GPIOA_BASE | 8, distortos::chip::Pin::pa9 = GPIOA_BASE | 9, distortos::chip::Pin::pa10 = GPIOA_BASE | 10, distortos::chip::Pin::pa11 = GPIOA_BASE | 11,
  distortos::chip::Pin::pa12 = GPIOA_BASE | 12, distortos::chip::Pin::pa13 = GPIOA_BASE | 13, distortos::chip::Pin::pa14 = GPIOA_BASE | 14, distortos::chip::Pin::pa15 = GPIOA_BASE | 15,
  distortos::chip::Pin::pb0 = GPIOB_BASE | 0, distortos::chip::Pin::pb1 = GPIOB_BASE | 1, distortos::chip::Pin::pb2 = GPIOB_BASE | 2, distortos::chip::Pin::pb3 = GPIOB_BASE | 3,
  distortos::chip::Pin::pb4 = GPIOB_BASE | 4, distortos::chip::Pin::pb5 = GPIOB_BASE | 5, distortos::chip::Pin::pb6 = GPIOB_BASE | 6, distortos::chip::Pin::pb7 = GPIOB_BASE | 7,
  distortos::chip::Pin::pb8 = GPIOB_BASE | 8, distortos::chip::Pin::pb9 = GPIOB_BASE | 9, distortos::chip::Pin::pb10 = GPIOB_BASE | 10, distortos::chip::Pin::pb11 = GPIOB_BASE | 11,
  distortos::chip::Pin::pb12 = GPIOB_BASE | 12, distortos::chip::Pin::pb13 = GPIOB_BASE | 13, distortos::chip::Pin::pb14 = GPIOB_BASE | 14, distortos::chip::Pin::pb15 = GPIOB_BASE | 15,
  distortos::chip::Pin::pc0 = GPIOC_BASE | 0, distortos::chip::Pin::pc1 = GPIOC_BASE | 1, distortos::chip::Pin::pc2 = GPIOC_BASE | 2, distortos::chip::Pin::pc3 = GPIOC_BASE | 3,
  distortos::chip::Pin::pc4 = GPIOC_BASE | 4, distortos::chip::Pin::pc5 = GPIOC_BASE | 5, distortos::chip::Pin::pc6 = GPIOC_BASE | 6, distortos::chip::Pin::pc7 = GPIOC_BASE | 7,
  distortos::chip::Pin::pc8 = GPIOC_BASE | 8, distortos::chip::Pin::pc9 = GPIOC_BASE | 9, distortos::chip::Pin::pc10 = GPIOC_BASE | 10, distortos::chip::Pin::pc11 = GPIOC_BASE | 11,
  distortos::chip::Pin::pc12 = GPIOC_BASE | 12, distortos::chip::Pin::pc13 = GPIOC_BASE | 13, distortos::chip::Pin::pc14 = GPIOC_BASE | 14, distortos::chip::Pin::pc15 = GPIOC_BASE | 15,
  distortos::chip::Pin::pd0 = GPIOD_BASE | 0, distortos::chip::Pin::pd1 = GPIOD_BASE | 1, distortos::chip::Pin::pd2 = GPIOD_BASE | 2, distortos::chip::Pin::pd3 = GPIOD_BASE | 3,
  distortos::chip::Pin::pd4 = GPIOD_BASE | 4, distortos::chip::Pin::pd5 = GPIOD_BASE | 5, distortos::chip::Pin::pd6 = GPIOD_BASE | 6, distortos::chip::Pin::pd7 = GPIOD_BASE | 7,
  distortos::chip::Pin::pd8 = GPIOD_BASE | 8, distortos::chip::Pin::pd9 = GPIOD_BASE | 9, distortos::chip::Pin::pd10 = GPIOD_BASE | 10, distortos::chip::Pin::pd11 = GPIOD_BASE | 11,
  distortos::chip::Pin::pd12 = GPIOD_BASE | 12, distortos::chip::Pin::pd13 = GPIOD_BASE | 13, distortos::chip::Pin::pd14 = GPIOD_BASE | 14, distortos::chip::Pin::pd15 = GPIOD_BASE | 15,
  distortos::chip::Pin::pe0 = GPIOE_BASE | 0, distortos::chip::Pin::pe1 = GPIOE_BASE | 1, distortos::chip::Pin::pe2 = GPIOE_BASE | 2, distortos::chip::Pin::pe3 = GPIOE_BASE | 3,
  distortos::chip::Pin::pe4 = GPIOE_BASE | 4, distortos::chip::Pin::pe5 = GPIOE_BASE | 5, distortos::chip::Pin::pe6 = GPIOE_BASE | 6, distortos::chip::Pin::pe7 = GPIOE_BASE | 7,
  distortos::chip::Pin::pe8 = GPIOE_BASE | 8, distortos::chip::Pin::pe9 = GPIOE_BASE | 9, distortos::chip::Pin::pe10 = GPIOE_BASE | 10, distortos::chip::Pin::pe11 = GPIOE_BASE | 11,
  distortos::chip::Pin::pe12 = GPIOE_BASE | 12, distortos::chip::Pin::pe13 = GPIOE_BASE | 13, distortos::chip::Pin::pe14 = GPIOE_BASE | 14, distortos::chip::Pin::pe15 = GPIOE_BASE | 15,
  distortos::chip::Pin::pf0 = GPIOF_BASE | 0, distortos::chip::Pin::pf1 = GPIOF_BASE | 1, distortos::chip::Pin::pf2 = GPIOF_BASE | 2, distortos::chip::Pin::pf3 = GPIOF_BASE | 3,
  distortos::chip::Pin::pf4 = GPIOF_BASE | 4, distortos::chip::Pin::pf5 = GPIOF_BASE | 5, distortos::chip::Pin::pf6 = GPIOF_BASE | 6, distortos::chip::Pin::pf7 = GPIOF_BASE | 7,
  distortos::chip::Pin::pf8 = GPIOF_BASE | 8, distortos::chip::Pin::pf9 = GPIOF_BASE | 9, distortos::chip::Pin::pf10 = GPIOF_BASE | 10, distortos::chip::Pin::pf11 = GPIOF_BASE | 11,
  distortos::chip::Pin::pf12 = GPIOF_BASE | 12, distortos::chip::Pin::pf13 = GPIOF_BASE | 13, distortos::chip::Pin::pf14 = GPIOF_BASE | 14, distortos::chip::Pin::pf15 = GPIOF_BASE | 15,
  distortos::chip::Pin::pg0 = GPIOG_BASE | 0, distortos::chip::Pin::pg1 = GPIOG_BASE | 1, distortos::chip::Pin::pg2 = GPIOG_BASE | 2, distortos::chip::Pin::pg3 = GPIOG_BASE | 3,
  distortos::chip::Pin::pg4 = GPIOG_BASE | 4, distortos::chip::Pin::pg5 = GPIOG_BASE | 5, distortos::chip::Pin::pg6 = GPIOG_BASE | 6, distortos::chip::Pin::pg7 = GPIOG_BASE | 7,
  distortos::chip::Pin::pg8 = GPIOG_BASE | 8, distortos::chip::Pin::pg9 = GPIOG_BASE | 9, distortos::chip::Pin::pg10 = GPIOG_BASE | 10, distortos::chip::Pin::pg11 = GPIOG_BASE | 11,
  distortos::chip::Pin::pg12 = GPIOG_BASE | 12, distortos::chip::Pin::pg13 = GPIOG_BASE | 13, distortos::chip::Pin::pg14 = GPIOG_BASE | 14, distortos::chip::Pin::pg15 = GPIOG_BASE | 15,
  distortos::chip::Pin::ph0 = GPIOH_BASE | 0, distortos::chip::Pin::ph1 = GPIOH_BASE | 1, distortos::chip::Pin::ph2 = GPIOH_BASE | 2, distortos::chip::Pin::ph3 = GPIOH_BASE | 3,
  distortos::chip::Pin::ph4 = GPIOH_BASE | 4, distortos::chip::Pin::ph5 = GPIOH_BASE | 5, distortos::chip::Pin::ph6 = GPIOH_BASE | 6, distortos::chip::Pin::ph7 = GPIOH_BASE | 7,
  distortos::chip::Pin::ph8 = GPIOH_BASE | 8, distortos::chip::Pin::ph9 = GPIOH_BASE | 9, distortos::chip::Pin::ph10 = GPIOH_BASE | 10, distortos::chip::Pin::ph11 = GPIOH_BASE | 11,
  distortos::chip::Pin::ph12 = GPIOH_BASE | 12, distortos::chip::Pin::ph13 = GPIOH_BASE | 13, distortos::chip::Pin::ph14 = GPIOH_BASE | 14, distortos::chip::Pin::ph15 = GPIOH_BASE | 15,
  distortos::chip::Pin::pi0 = GPIOI_BASE | 0, distortos::chip::Pin::pi1 = GPIOI_BASE | 1, distortos::chip::Pin::pi2 = GPIOI_BASE | 2, distortos::chip::Pin::pi3 = GPIOI_BASE | 3,
  distortos::chip::Pin::pi4 = GPIOI_BASE | 4, distortos::chip::Pin::pi5 = GPIOI_BASE | 5, distortos::chip::Pin::pi6 = GPIOI_BASE | 6, distortos::chip::Pin::pi7 = GPIOI_BASE | 7,
  distortos::chip::Pin::pi8 = GPIOI_BASE | 8, distortos::chip::Pin::pi9 = GPIOI_BASE | 9, distortos::chip::Pin::pi10 = GPIOI_BASE | 10, distortos::chip::Pin::pi11 = GPIOI_BASE | 11,
  distortos::chip::Pin::pi12 = GPIOI_BASE | 12, distortos::chip::Pin::pi13 = GPIOI_BASE | 13, distortos::chip::Pin::pi14 = GPIOI_BASE | 14, distortos::chip::Pin::pi15 = GPIOI_BASE | 15
}
 identifier of single pin - combined address of GPIO port with pin number More...
 
enum  distortos::chip::PinAlternateFunction : uint8_t {
  distortos::chip::PinAlternateFunction::af0, distortos::chip::PinAlternateFunction::af1, distortos::chip::PinAlternateFunction::af2, distortos::chip::PinAlternateFunction::af3,
  distortos::chip::PinAlternateFunction::af4, distortos::chip::PinAlternateFunction::af5, distortos::chip::PinAlternateFunction::af6, distortos::chip::PinAlternateFunction::af7,
  distortos::chip::PinAlternateFunction::af8, distortos::chip::PinAlternateFunction::af9, distortos::chip::PinAlternateFunction::af10, distortos::chip::PinAlternateFunction::af11,
  distortos::chip::PinAlternateFunction::af12, distortos::chip::PinAlternateFunction::af13, distortos::chip::PinAlternateFunction::af14, distortos::chip::PinAlternateFunction::af15
}
 all possible alternate functions of pin More...
 
enum  distortos::chip::PinMode : uint8_t { distortos::chip::PinMode::input, distortos::chip::PinMode::output, distortos::chip::PinMode::alternateFunction, distortos::chip::PinMode::analog }
 all possible modes of pin More...
 
enum  distortos::chip::PinOutputSpeed : uint8_t { distortos::chip::PinOutputSpeed::low, distortos::chip::PinOutputSpeed::medium, distortos::chip::PinOutputSpeed::high, distortos::chip::PinOutputSpeed::veryHigh = 3 }
 all possible output speeds of pin More...
 
enum  distortos::chip::PinPull : uint8_t { distortos::chip::PinPull::none, distortos::chip::PinPull::up, distortos::chip::PinPull::down }
 all possible pull-up/pull-down configurations of pin More...
 

Functions

void distortos::chip::configurePin (Pin pin, PinMode mode, bool openDrain, PinOutputSpeed outputSpeed, PinPull pull, PinAlternateFunction alternateFunction, bool initialState)
 Configures pin. More...
 
void distortos::chip::configureAlternateFunctionPin (const Pin pin, const bool openDrain, const PinOutputSpeed outputSpeed, const PinPull pull, const PinAlternateFunction alternateFunction)
 Configures pin for "alternate function" mode. More...
 
void distortos::chip::configureAnalogPin (const Pin pin)
 Configures pin for "analog" mode. More...
 
void distortos::chip::configureInputPin (const Pin pin, const PinPull pull)
 Configures pin for "input" mode. More...
 
void distortos::chip::configureOutputPin (const Pin pin, const bool openDrain, const PinOutputSpeed outputSpeed, const PinPull pull, const bool initialState)
 Configures pin for "output" mode. More...
 
constexpr std::pair< GPIO_TypeDef *, uint8_t > distortos::chip::decodePin (const Pin pin)
 Decodes pin identifier into address of associated GPIO port and its pin number. More...
 

Detailed Description

Header for GPIOv2 functions for STM32.

Author
Copyright (C) 2016 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.