modm API documentation
|
#include <modm/platform/gpio/software_port.hpp>
Public Typedefs | |
using | PortType = std::conditional_t< (width > 8), uint16_t, uint8_t > |
using | PortType = uint16_t |
may also be uint8_t, depending on port width | |
Public Types | |
enum | DataOrder : bool { DataOrder::Normal = false, DataOrder::Reversed = true } |
This enum can be used to reverse the bit order of the Data. More... | |
enum | InputTrigger : uint8_t { InputTrigger::LowLevel = 0b00, InputTrigger::BothEdges = 0b01, InputTrigger::FallingEdge = 0b10, InputTrigger::RisingEdge = 0b11 } |
Each External Interrupt can be configured to trigger on these conditions. More... | |
enum | InputType : uint8_t { InputType::Floating, InputType::PullUp } |
Each Input Pin can be configured in one of these states. More... | |
enum | OutputType : uint8_t { OutputType::PushPull } |
enum | Port { B } |
Available ports on this device. | |
enum | Signal { BitBang, Ain0, Ain1, Aref, Di, Do, In0, In1, In2, Oc0a, Oc0b, Oc1a, Oc1ainv, Oc1b, Oc1binv, Scl, Sda, T0, Usck } |
Static Public Member Functions | |
static PortType | isSet () |
static void | write (PortType data) |
static PortType | read () |
static constexpr DataOrder | getDataOrder () |
returns the chosen data order | |
static PortType | read () |
The read data is always right-aligned regardless of physical mapping. | |
static void | setInput () |
static void | setOutput () |
static void | toggle () |
Toggle the output states of all pins. | |
static void | write (PortType data) |
The write data is always right-aligned regardless of physical mapping. | |
static void | configure (OutputType) |
static void | configure (InputType type) |
static void | reset () |
static void | set () |
static void | set (bool status) |
static void | setInput () |
static void | setInput (InputType type) |
static void | setOutput () |
static void | setOutput (bool status) |
static void | setOutput (OutputType) |
static void | toggle () |
Static Public Attributes | |
static constexpr uint8_t | number_of_ports |
static constexpr uint8_t | width |
static constexpr uint8_t | number_of_ports |
static constexpr uint8_t | width |
Static Protected Attributes | |
static constexpr int8_t | shift_masks [1][width] |
static constexpr uint8_t | inverteds [1] |
static constexpr uint8_t | masks [1] |
Create an up to 16-bit port from arbitrary pins.
This class optimizes the data type for the read()
and write()
methods. Supplying up to 8 Gpios will use uint8_t
, up to 16 Gpios uint16_t
.
DataOrder::Normal
. If you need reverse bit order, reverse the order of Gpios
!Gpios | Up to 16 GpioIO classes, ordered MSB to LSB |
|
inheritedstrong |
This enum can be used to reverse the bit order of the Data.
Enum Values | Documentation |
---|---|
Normal | bit order of data is the same as bit order of port |
Reversed | bit order of data is the reverse bit order of port |
|
inheritedstrong |
|
inheritedstrong |
|
inheritedstrong |
|
inheritedstaticconstexpr |
This holds the number of unique platform ports that this implementation accesses. It's always at least 1.
|
staticprotectedconstexpr |
|
inheritedstaticconstexpr |
This holds the width of the port as number of bits and can be used in drivers to assert the correct requirements