Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Stm32GpioDefs< GPIOx, PIN, PIN_NUM > Struct Template Reference

Static GPIO implementation for the STM32 microcontrollers. More...

#include <Stm32Gpio.hxx>

Static Public Member Functions

static GPIO_TypeDef * port ()
 
static uint16_t pin ()
 
static void set (bool value)
 Sets the output pin to a given level.
 
static bool get ()
 Sets the output pin to a given level.
 
static void toggle ()
 Changes the output pin level.
 
static constexpr const Gpioinstance ()
 
static bool is_output ()
 

Detailed Description

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
struct Stm32GpioDefs< GPIOx, PIN, PIN_NUM >

Static GPIO implementation for the STM32 microcontrollers.

Do not use directly: use GPIO_PIN macro.

Parameters
PORTis the port base address pointer (e.g. GPIOC)
PINis the GPIO_PIN_# value for the pin number.
PIN_NUMis the number of the pin in the port. Zero-based.

Definition at line 49 of file Stm32Gpio.hxx.

Member Function Documentation

◆ get()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static bool Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::get ( )
inlinestatic

Sets the output pin to a given level.

Definition at line 86 of file Stm32Gpio.hxx.

◆ instance()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static constexpr const Gpio * Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::instance ( )
inlinestaticconstexpr
Returns
a os-indepentent Gpio abstraction instance for use in libraries.

Definition at line 99 of file Stm32Gpio.hxx.

◆ is_output()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static bool Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::is_output ( )
inlinestatic
Returns
whether this pin is configured as an output.

Definition at line 105 of file Stm32Gpio.hxx.

◆ pin()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static uint16_t Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::pin ( )
inlinestatic
Returns
the pin number within the port.

Definition at line 58 of file Stm32Gpio.hxx.

◆ port()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static GPIO_TypeDef * Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::port ( )
inlinestatic
Returns
the GPIO structure of the given gpio port.

Definition at line 52 of file Stm32Gpio.hxx.

◆ set()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static void Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::set ( bool  value)
inlinestatic

Sets the output pin to a given level.

Definition at line 64 of file Stm32Gpio.hxx.

◆ toggle()

template<uint32_t GPIOx, uint16_t PIN, uint8_t PIN_NUM>
static void Stm32GpioDefs< GPIOx, PIN, PIN_NUM >::toggle ( )
inlinestatic

Changes the output pin level.

Definition at line 92 of file Stm32Gpio.hxx.


The documentation for this struct was generated from the following file: