decorators module#
Pin decorators module for JITX Standard Library
This module provides pin decorator definitions for use with symbol pins. Decorators are collections of artwork that can be attached to pins to indicate special properties like active-low signals, open-collector outputs, clock inputs, and pin cardinality (input/output/bidirectional).
- class DecoratorPlacement(*values)[source]#
Bases:
EnumPlacement reference for pin decorators
Indicates whether the decorator is placed inside or outside the box symbol.
- OUTSIDE = 'outside'#
- INSIDE = 'inside'#
- class OpenCollectorType(*values)[source]#
Bases:
EnumOpen collector output types
Defines whether the open collector is a low-side sink (NPN/NMOS) or high-side source (PNP/PMOS).
- SINK = 'sink'#
Low side open collector (NPN BJT or NMOS FET)
- SOURCE = 'source'#
High side open collector (PNP BJT or PMOS FET)
- class CardinalityType(*values)[source]#
Bases:
EnumPin cardinality types
Defines the direction of signal flow for pin decorators.
- INPUT = 'input'#
- OUTPUT = 'output'#
- BIDIRECTIONAL = 'bidirectional'#
- class DecoratorSpec[source]#
Base class for all pin decorator specifications
This is the base type for data structures that specify how pins should be decorated (e.g., Cardinality, ActiveLow, etc.)
- class DecoratorConfig(cardinality=<factory>, active_low=<factory>, open_collector=<factory>, clock=<factory>)[source]#
Default configurations for all decorator types
- Parameters:
cardinality (Cardinality)
active_low (ActiveLow)
open_collector (OpenCollector)
clock (Clock)
-
cardinality:
Cardinality# Configuration for cardinality decorators
-
open_collector:
OpenCollector# Configuration for open-collector decorators
- class PinDecorator(spec)[source]#
Bases:
PropertyPin decorator property. This should be assigned to a component port for pin-specific decoration.
- Parameters:
spec (DecoratorSpec)
-
spec:
DecoratorSpec# The decorator specification that this property represents
- class ActiveLow(diameter=0.7, nudge=(0.0, 0.0))[source]#
Bases:
DecoratorSpecActive-low (bubble) pin decorator specification
Creates a circle/bubble symbol to indicate active-low signals.
- class OpenCollector(oc_type=OpenCollectorType.SINK, width=0.7, line_width=0.15, pullup_down=False, nudge=None)[source]#
Bases:
DecoratorSpecOpen collector pin decorator specification
Creates a diamond symbol with optional hat and pullup/pulldown indicator.
- Parameters:
-
oc_type:
OpenCollectorType= 'sink'# Type of open collector (sink or source)
- class Clock(size=0.85, line_width=0.15)[source]#
Bases:
DecoratorSpecClock pin decorator specification
Creates a “>” shaped symbol to indicate clock inputs.
- class Cardinality(cardinality, size=(0.85, 0.85), nudge=None)[source]#
Bases:
DecoratorSpecPin cardinality specification
This is a data structure that specifies the direction of signal flow for a pin (input, output, or bidirectional).
- Parameters:
-
cardinality:
CardinalityType# The direction of signal flow for this pin
- placement(spec)[source]#
Get the placement type for a decorator spec
- Return type:
- Parameters:
spec (DecoratorSpec)
- decorate(port, spec)[source]#
Decorate a port with a pin decorator spec
- Return type:
- Parameters:
port (Port)
spec (DecoratorSpec)
- draw(decorator, direction, at)[source]#
- Return type:
- Parameters:
decorator (DecoratorSpec)
direction (Direction)
at (Point)