Horizon
Loading...
Searching...
No Matches
horizon::Pin Class Reference

A Pin represents a logical pin of a Unit. More...

#include <unit.hpp>

Classes

class  AlternateName
 The Pin's alternate names. More...

Public Types

enum class  Direction {
  INPUT , OUTPUT , BIDIRECTIONAL , OPEN_COLLECTOR ,
  POWER_INPUT , POWER_OUTPUT , PASSIVE , NOT_CONNECTED
}

Public Member Functions

 Pin (const UUID &uu, const json &j)
 Pin (const UUID &uu)
json serialize () const
UUID get_uuid () const

Static Public Member Functions

static UUID alternate_name_uuid_from_index (int idx)

Public Attributes

UUID uuid
std::string primary_name
 The Pin's primary name.
Direction direction = Direction::INPUT
unsigned int swap_group = 0
 Pins of the same swap_group can be pinswapped.
std::map< UUID, AlternateNamenames

Static Public Attributes

static const LutEnumStr< Pin::Direction > direction_lut
static const std::vector< std::pair< Pin::Direction, std::string > > direction_names
static const std::map< Pin::Direction, std::string > direction_abbreviations

Detailed Description

A Pin represents a logical pin of a Unit.

Member Data Documentation

◆ direction_abbreviations

const std::map< Pin::Direction, std::string > horizon::Pin::direction_abbreviations
static
Initial value:
= {
{Pin::Direction::INPUT, "In"}, {Pin::Direction::OUTPUT, "Out"},
{Pin::Direction::BIDIRECTIONAL, "BiDi"}, {Pin::Direction::PASSIVE, "Passive"},
{Pin::Direction::POWER_INPUT, "PIn"}, {Pin::Direction::POWER_OUTPUT, "POut"},
{Pin::Direction::OPEN_COLLECTOR, "OC"}, {Pin::Direction::NOT_CONNECTED, "NC"},
}

◆ direction_lut

const LutEnumStr< Pin::Direction > horizon::Pin::direction_lut
static
Initial value:
= {
{"output", Pin::Direction::OUTPUT},
{"input", Pin::Direction::INPUT},
{"bidirectional", Pin::Direction::BIDIRECTIONAL},
{"open_collector", Pin::Direction::OPEN_COLLECTOR},
{"power_input", Pin::Direction::POWER_INPUT},
{"power_output", Pin::Direction::POWER_OUTPUT},
{"passive", Pin::Direction::PASSIVE},
{"not_connected", Pin::Direction::NOT_CONNECTED},
}

◆ direction_names

const std::vector< std::pair< Pin::Direction, std::string > > horizon::Pin::direction_names
static
Initial value:
= {
{Pin::Direction::INPUT, "Input"},
{Pin::Direction::OUTPUT, "Output"},
{Pin::Direction::BIDIRECTIONAL, "Bidirectional"},
{Pin::Direction::PASSIVE, "Passive"},
{Pin::Direction::POWER_INPUT, "Power Input"},
{Pin::Direction::POWER_OUTPUT, "Power Output"},
{Pin::Direction::OPEN_COLLECTOR, "Open Collector"},
{Pin::Direction::NOT_CONNECTED, "Not Connected"},
}

◆ primary_name

std::string horizon::Pin::primary_name

The Pin's primary name.

i.e. PB0 on an MCU.

◆ swap_group

unsigned int horizon::Pin::swap_group = 0

Pins of the same swap_group can be pinswapped.

The swap group 0 is for unswappable pins.


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