Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Stm32Gpio.hxx File Reference
#include "os/Gpio.hxx"
#include "GpioWrapper.hxx"
#include "stm32f_hal_conf.hxx"

Go to the source code of this file.

Classes

struct  Stm32GpioDefs< GPIOx, PIN, PIN_NUM >
 Static GPIO implementation for the STM32 microcontrollers. More...
 
struct  GpioOutputPin< Base, SAFE_VALUE, INVERT >
 Parametric GPIO output class. More...
 
struct  GpioOutputSafeLow< Defs >
 Defines a GPIO output pin, initialized to be an output pin with low level. More...
 
struct  GpioOutputSafeHigh< Defs >
 Defines a GPIO output pin, initialized to be an output pin with high level. More...
 
struct  LedPin< Defs >
 Defines a GPIO output pin with high-current drive and low initialization level. More...
 
struct  GpioInputPin< Base, ACTIVE_HIGH >
 Parametric GPIO input class. More...
 
struct  GpioInputPU< Defs >
 Defines a GPIO input pin with pull-up. More...
 
struct  GpioInputPD< Defs >
 Defines a GPIO input pin with pull-down enabled. More...
 
struct  GpioInputNP< Defs >
 Defines a GPIO input pin. More...
 

Macros

#define GPIO_PIN(NAME, BaseClass, PORTNAME, NUM)    typedef BaseClass<Stm32GpioDefs<(uint32_t)(GPIO ## PORTNAME ## _BASE), GPIO_PIN_ ## NUM, NUM>> NAME##_Pin
 Helper macro for defining GPIO pins.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Helper declarations for using GPIO pins (both for GPIO and other hardware) on STM32 microcontrollers.

Author
Balazs Racz
Date
24 Aug 2015

Definition in file Stm32Gpio.hxx.

Macro Definition Documentation

◆ GPIO_PIN

#define GPIO_PIN (   NAME,
  BaseClass,
  PORTNAME,
  NUM 
)     typedef BaseClass<Stm32GpioDefs<(uint32_t)(GPIO ## PORTNAME ## _BASE), GPIO_PIN_ ## NUM, NUM>> NAME##_Pin

Helper macro for defining GPIO pins.

Parameters
NAMEis the basename of the declaration. For NAME==FOO the macro declares FOO_Pin as a structure on which the read-write functions will be available.
BaseClassis the initialization structure, such as LedPin, or GpioOutputSafeHigh or GpioOutputSafeLow.
PORTNAMEis a letter defining which port this is (like A, B, C). E.g. for PC8 this is C.
NUMis the pin number, such as 8 for PC8.

Example: GPIO_PIN(FOO, LedPin, 0, 3); ... FOO_Pin::set(true);

Definition at line 232 of file Stm32Gpio.hxx.