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.

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.

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.

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.

property width

Return width of a Pin, which is always 1.