KiCad PCB EDA Suite
pin_type.h File Reference

Electrical pin type handling. More...

#include <wx/string.h>
#include <bitmaps.h>

Go to the source code of this file.

Macros

#define ELECTRICAL_PINTYPES_TOTAL   ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )
 

Enumerations

enum  ELECTRICAL_PINTYPE {
  ELECTRICAL_PINTYPE::PT_INPUT, ELECTRICAL_PINTYPE::PT_OUTPUT, ELECTRICAL_PINTYPE::PT_BIDI, ELECTRICAL_PINTYPE::PT_TRISTATE,
  ELECTRICAL_PINTYPE::PT_PASSIVE, ELECTRICAL_PINTYPE::PT_UNSPECIFIED, ELECTRICAL_PINTYPE::PT_POWER_IN, ELECTRICAL_PINTYPE::PT_POWER_OUT,
  ELECTRICAL_PINTYPE::PT_OPENCOLLECTOR, ELECTRICAL_PINTYPE::PT_OPENEMITTER, ELECTRICAL_PINTYPE::PT_NC, ELECTRICAL_PINTYPE::PT_LAST_OPTION = PT_NC
}
 The component library pin object electrical types used in ERC tests. More...
 

Functions

wxString GetText (ELECTRICAL_PINTYPE)
 
BITMAP_DEF GetBitmap (ELECTRICAL_PINTYPE)
 

Detailed Description

Electrical pin type handling.

Definition in file pin_type.h.

Macro Definition Documentation

◆ ELECTRICAL_PINTYPES_TOTAL

#define ELECTRICAL_PINTYPES_TOTAL   ( static_cast<int>( ELECTRICAL_PINTYPE::PT_LAST_OPTION ) + 1 )

Definition at line 54 of file pin_type.h.

Enumeration Type Documentation

◆ ELECTRICAL_PINTYPE

enum ELECTRICAL_PINTYPE
strong

The component library pin object electrical types used in ERC tests.

Enumerator
PT_INPUT 

usual pin input: must be connected

PT_OUTPUT 

usual output

PT_BIDI 

input or output (like port for a microprocessor)

PT_TRISTATE 

tris state bus pin

PT_PASSIVE 

pin for passive components: must be connected, and can be connected to any pin

PT_UNSPECIFIED 

unknown electrical properties: creates always a warning when connected

PT_POWER_IN 

power input (GND, VCC for ICs). Must be connected to a power output.

PT_POWER_OUT 

output of a regulator: intended to be connected to power input pins

PT_OPENCOLLECTOR 

pin type open collector

PT_OPENEMITTER 

pin type open emitter

PT_NC 

not connected (must be left open)

PT_LAST_OPTION 

sentinel value, set to last usable enum option

Definition at line 37 of file pin_type.h.

38 {
39  PT_INPUT,
40  PT_OUTPUT,
41  PT_BIDI,
42  PT_TRISTATE,
43  PT_PASSIVE,
45  PT_POWER_IN,
46  PT_POWER_OUT,
49  PT_NC,
50 
52 };
power input (GND, VCC for ICs). Must be connected to a power output.
pin for passive components: must be connected, and can be connected to any pin
unknown electrical properties: creates always a warning when connected
sentinel value, set to last usable enum option
usual pin input: must be connected
input or output (like port for a microprocessor)
not connected (must be left open)
output of a regulator: intended to be connected to power input pins

Function Documentation

◆ GetBitmap()

BITMAP_DEF GetBitmap ( ELECTRICAL_PINTYPE  )

Definition at line 69 of file pin_type.cpp.

70 {
71  auto findIt = pinTypes.find( aType );
72 
73  wxCHECK_MSG( findIt != pinTypes.end(), nullptr, "Could not find pin type in lookup map" );
74 
75  return findIt->second.bitmap;
76 }
const std::map< ELECTRICAL_PINTYPE, struct pinTypeStruct > pinTypes
Definition: pin_type.cpp:44

References pinTypes.

◆ GetText()

wxString GetText ( ELECTRICAL_PINTYPE  )

Definition at line 59 of file pin_type.cpp.

60 {
61  auto findIt = pinTypes.find( aType );
62 
63  wxCHECK_MSG( findIt != pinTypes.end(), wxT( "???" ), "Could not find pin type in lookup map" );
64 
65  return findIt->second.name;
66 }
const std::map< ELECTRICAL_PINTYPE, struct pinTypeStruct > pinTypes
Definition: pin_type.cpp:44

References pinTypes.