skidl.pin module

Handles part pins.

class skidl.pin.PhantomPin(**attribs)[source]

Bases: Pin

A pin type that exists solely to tie two pinless nets together. It will not participate in generating any netlists.

class skidl.pin.Pin(**attribs)[source]

Bases: SkidlBaseObject

A class for storing data about pins for a part.

Parameters:

attribs – Key/value pairs of attributes to add to the library.

nets

The electrical nets this pin is connected to (can be >1).

part

Link to the Part object this pin belongs to.

func

Pin function such as PinType.types.INPUT.

do_erc

When false, the pin is not checked for ERC violations.

BIDIR = 3
FREE = 14
INPUT = 1
NOCONNECT = 13
OPENCOLL = 9
OPENEMIT = 10
OUTPUT = 2
PASSIVE = 5
PULLDN = 12
PULLUP = 11
PWRIN = 7
PWROUT = 8
TRISTATE = 4
UNSPEC = 6
classmethod add_type(*pin_types)[source]

Add new pin type identifiers to the list of pin types.

Parameters:

pin_types – Strings identifying zero or more pin types.

chk_conflict(other_pin)[source]

Check for electrical rule conflicts between this pin and another.

property circuit

Return the circuit of the part the pin belongs to.

connect(*pins_nets_buses)[source]

Return the pin after connecting it to one or more nets or pins.

Parameters:

pins_nets_buses – One or more Pin, Net or Bus objects or lists/tuples of them.

Returns:

The updated pin with the new connections.

Notes

You can connect nets or pins to a pin like so:

p = Pin()     # Create a pin.
n = Net()     # Create a net.
p += net      # Connect the net to the pin.
copy(num_copies=None, **attribs)[source]

Return copy or list of copies of a pin including any net connection.

Parameters:

num_copies – Number of copies to make of pin.

Keyword Arguments:

attribs – Name/value pairs for setting attributes for the pin.

Notes

An instance of a pin can be copied just by calling it like so:

p = Pin()     # Create a pin.
p_copy = p()  # This is a copy of the pin.
create_network()[source]

Create a network from a single pin.

disconnect()[source]

Disconnect this pin from all nets.

property drive

Get, set and delete the drive strength of this pin.

class drives(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

NOCONNECT = 1
NONE = 2
ONESIDE = 5
PASSIVE = 3
POWER = 8
PULLUPDN = 4
PUSHPULL = 7
TRISTATE = 6
erc_desc()[source]

Return a string describing this pin for ERC.

export()[source]

Return a string to recreate a Pin object.

get_nets()[source]

Return a list containing the Net objects connected to this pin.

get_pin_info()[source]
get_pins()[source]

Return a list containing this pin.

is_attached(pin_net_bus)[source]

Return true if this pin is attached to the given pin, net or bus.

is_connected()[source]

Return true if a pin is connected to a net (but not a no-connect net).

move(net)[source]

Move pin to another net.

Parameters:

net (Net) – Destination net for pin.

property net

Return one of the nets the pin is connected to.

pin_info = {types.INPUT: {'drive': drives.NONE, 'func_str': 'INPUT', 'function': 'INPUT', 'max_rcv': drives.POWER, 'min_rcv': drives.PASSIVE}, types.OUTPUT: {'drive': drives.PUSHPULL, 'func_str': 'OUTPUT', 'function': 'OUTPUT', 'max_rcv': drives.PASSIVE, 'min_rcv': drives.NONE}, types.BIDIR: {'drive': drives.TRISTATE, 'func_str': 'BIDIR', 'function': 'BIDIRECTIONAL', 'max_rcv': drives.POWER, 'min_rcv': drives.NONE}, types.TRISTATE: {'drive': drives.TRISTATE, 'func_str': 'TRISTATE', 'function': 'TRISTATE', 'max_rcv': drives.TRISTATE, 'min_rcv': drives.NONE}, types.PASSIVE: {'drive': drives.PASSIVE, 'func_str': 'PASSIVE', 'function': 'PASSIVE', 'max_rcv': drives.POWER, 'min_rcv': drives.NONE}, types.UNSPEC: {'drive': drives.NONE, 'func_str': 'UNSPEC', 'function': 'UNSPECIFIED', 'max_rcv': drives.POWER, 'min_rcv': drives.NONE}, types.PWRIN: {'drive': drives.NONE, 'func_str': 'PWRIN', 'function': 'POWER-IN', 'max_rcv': drives.POWER, 'min_rcv': drives.POWER}, types.PWROUT: {'drive': drives.POWER, 'func_str': 'PWROUT', 'function': 'POWER-OUT', 'max_rcv': drives.PASSIVE, 'min_rcv': drives.NONE}, types.OPENCOLL: {'drive': drives.ONESIDE, 'func_str': 'OPENCOLL', 'function': 'OPEN-COLLECTOR', 'max_rcv': drives.TRISTATE, 'min_rcv': drives.NONE}, types.OPENEMIT: {'drive': drives.ONESIDE, 'func_str': 'OPENEMIT', 'function': 'OPEN-EMITTER', 'max_rcv': drives.TRISTATE, 'min_rcv': drives.NONE}, types.PULLUP: {'drive': drives.PULLUPDN, 'func_str': 'PULLUP', 'function': 'PULLUP', 'max_rcv': drives.POWER, 'min_rcv': drives.NONE}, types.PULLDN: {'drive': drives.PULLUPDN, 'func_str': 'PULLDN', 'function': 'PULLDN', 'max_rcv': drives.POWER, 'min_rcv': drives.NONE}, types.NOCONNECT: {'drive': drives.NOCONNECT, 'func_str': 'NOCONNECT', 'function': 'NO-CONNECT', 'max_rcv': drives.NOCONNECT, 'min_rcv': drives.NOCONNECT}, types.FREE: {'drive': drives.NONE, 'func_str': 'FREE', 'function': 'FREE', 'max_rcv': drives.POWER, 'min_rcv': drives.NOCONNECT}}
property pins
property ref

Return the reference of the part the pin belongs to.

split_name(delimiters)[source]

Use chars in divider to split a pin name and add substrings to aliases.

class types(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: IntEnum

BIDIR = 3
FREE = 14
INPUT = 1
NOCONNECT = 13
OPENCOLL = 9
OPENEMIT = 10
OUTPUT = 2
PASSIVE = 5
PULLDN = 12
PULLUP = 11
PWRIN = 7
PWROUT = 8
TRISTATE = 4
UNSPEC = 6
property width

Return width of a Pin, which is always 1.