Horizon
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
horizon::Pin Class Reference

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

#include <unit.hpp>

Public Types

enum  Direction {
  INPUT, OUTPUT, BIDIRECTIONAL, OPEN_COLLECTOR,
  POWER_INPUT, POWER_OUTPUT, PASSIVE, NOT_CONNECTED,
  INPUT, OUTPUT, BIDIRECTIONAL, OPEN_COLLECTOR,
  POWER_INPUT, POWER_OUTPUT, PASSIVE, NOT_CONNECTED
}
 
enum  Direction {
  INPUT, OUTPUT, BIDIRECTIONAL, OPEN_COLLECTOR,
  POWER_INPUT, POWER_OUTPUT, PASSIVE, NOT_CONNECTED,
  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
 
 Pin (const UUID &uu, const json &j)
 
 Pin (const UUID &uu)
 
json serialize () const
 
UUID get_uuid () const
 

Public Attributes

const UUID uuid
 
std::string primary_name
 The Pin's primary name. More...
 
Direction direction = Direction::INPUT
 
unsigned int swap_group = 0
 Pins of the same swap_group can be pinswapped. More...
 
std::vector< std::string > names
 The Pin's alternate names. More...
 

Static Public Attributes

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

Detailed Description

A Pin represents a logical pin of a Unit.

Member Data Documentation

◆ direction_lut

static 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

static 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"},
}

◆ names

std::vector< std::string > horizon::Pin::names

The Pin's alternate names.

i.e. UART_RX or I2C_SDA on an MCU.

◆ 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: