modm API documentation
modm::platform::GpioStatic< detail::DataUnused > Class Reference

#include <modm/platform/gpio/unused.hpp>

Inheritance diagram for modm::platform::GpioStatic< detail::DataUnused >:
modm::platform::Gpio modm::GpioIO modm::GpioOutput modm::GpioInput modm::Gpio modm::Gpio

Classes

struct  BitBang
 
struct  Bkin
 
struct  Cec
 
struct  Ch1
 
struct  Ch1n
 
struct  Ch2
 
struct  Ch2n
 
struct  Ch3
 
struct  Ch3n
 
struct  Ch4
 
struct  Ck
 
struct  Crssync
 
struct  Cts
 
struct  De
 
struct  Dm
 
struct  Dp
 
struct  Etr
 
struct  G1io1
 
struct  G1io2
 
struct  G1io3
 
struct  G1io4
 
struct  G2io1
 
struct  G2io2
 
struct  G2io3
 
struct  G2io4
 
struct  G3io2
 
struct  G3io3
 
struct  G4io1
 
struct  G4io2
 
struct  G4io3
 
struct  G4io4
 
struct  G5io1
 
struct  G5io2
 
struct  G5io3
 
struct  G5io4
 
struct  In0
 
struct  In1
 
struct  In2
 
struct  In3
 
struct  In4
 
struct  In5
 
struct  In6
 
struct  In7
 
struct  In8
 
struct  In9
 
struct  Mck
 
struct  Mco
 
struct  Miso
 
struct  Mosi
 
struct  Noe
 
struct  Nss
 
struct  Osc32in
 
struct  Osc32out
 
struct  Oscin
 
struct  Oscout
 
struct  Out
 
struct  Outalarm
 
struct  Outcalib
 
struct  Rts
 
struct  Rx
 
struct  Sck
 
struct  Scl
 
struct  Sd
 
struct  Sda
 
struct  Smba
 
struct  Swclk
 
struct  Swdio
 
struct  Sync
 
struct  Tamp1
 
struct  Tamp2
 
struct  Ts
 
struct  Tx
 
struct  Wkup1
 
struct  Wkup2
 
struct  Wkup4
 
struct  Wkup6
 
struct  Ws
 

Public Typedefs

using Output = GpioUnused
 
using Input = GpioUnused
 
using IO = GpioUnused
 
using Type = GpioUnused
 
using Data = detail::DataUnused
 

Public Types

enum  InputType { InputType::Floating = 0x0, InputType::PullUp = 0x1, InputType::PullDown = 0x2 }
 
enum  OutputSpeed {
  Low = 0, Medium = 0x1, High = 0x3, MHz2 = Low,
  MHz10 = Medium, MHz50 = High
}
 
enum  OutputType { OutputType::PushPull = 0x0, OutputType::OpenDrain = 0x1 }
 
enum  Port { A = 0, B = 1, C = 2, F = 5 }
 The Port a Gpio Pin is connected to.
 
enum  Direction { In = 0, Out = 1, InOut = 2, Special = 3 }
 Declares the direction of a GPIO.
 
enum  Direction { In = 0, Out = 1, InOut = 2, Special = 3 }
 Declares the direction of a GPIO.
 

Static Public Member Functions

static void setOutput ()
 
static void setOutput (bool)
 
static void setOutput (OutputType, OutputSpeed=OutputSpeed::MHz50)
 
static void configure (OutputType, OutputSpeed=OutputSpeed::MHz50)
 
static void set ()
 
static void set (bool)
 
static void reset ()
 
static bool isSet ()
 
static void toggle ()
 
static void setInput ()
 
static void setInput (InputType)
 
static void configure (InputType)
 
static bool read ()
 
static Direction getDirection ()
 
static void lock ()
 
static void disconnect ()
 
static bool isSet ()
 
static void reset ()
 set output to low level
 
static void set ()
 set output to high level
 
static void set (bool value)
 set output to high or low level
 
static void setOutput ()
 configure pin as output
 
static void setOutput (bool value)
 configure pin as output and set high or low
 
static void toggle ()
 toggle output level
 

Static Public Attributes

static constexpr bool isInverted = false
 
static constexpr Port port = Port(-1)
 
static constexpr uint8_t pin = uint8_t(-1)
 
static constexpr uint16_t mask = 0
 
static constexpr bool High = true
 
static constexpr bool High = true
 
static constexpr bool Low = false
 
static constexpr bool Low = false
 
static constexpr Direction direction = Direction::InOut
 Declares the Pin direction.
 
static constexpr Direction direction = Direction::Out
 Declares the Pin direction.
 

Static Protected Member Functions

static void setAlternateFunction (uint8_t)
 
static void setAlternateFunction ()
 
static void setAnalogInput ()
 

Detailed Description

Dummy implementation of an I/O pin.

This class can be used when a pin is not required. All functions are dummy functions which do nothing. read() will always return false.

For example when creating a software SPI with the modm::SoftwareSimpleSpi class and the return channel (MISO - Master In Slave Out) is not needed, a good way is to use this class as a parameter when defining the SPI class.

Example:

#include <modm/architecture/platform.hpp>
namespace pin
{
typedef GpioOutputD7 Clk;
typedef GpioOutputD5 Mosi;
}
modm::SoftwareSpiMaster< pin::Clk, pin::Mosi, GpioUnused > Spi;
...
Spi::write(0xaa);
Author
Fabian Greif
Niklas Hauser

Member Enumeration Documentation

enum modm::platform::Gpio::InputType
inheritedstrong
Enum ValuesDocumentation
Floating 

floating on input

PullUp 

pull-up on input

PullDown 

pull-down on input

enum modm::platform::Gpio::OutputType
inheritedstrong
Enum ValuesDocumentation
PushPull 

push-pull on output

OpenDrain 

open-drain on output

Member Function Documentation

static bool modm::GpioOutput::isSet ( )
inheritedstatic

Returns the set logical output state of the pin. This may be different from the physical state!

Member Data Documentation

constexpr bool modm::Gpio::Low = false
inheritedstaticconstexpr

These constants refer to the logical state of the GPIO. The physical state is determined by the configuration and external connection.

constexpr bool modm::Gpio::Low = false
inheritedstaticconstexpr

These constants refer to the logical state of the GPIO. The physical state is determined by the configuration and external connection.


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