Module Pin Group

class hal_py.ModulePinGroup

A group of module pins made up of a name, the pins, a pin order, and a start index.

property ascending

True if the pin order of a pin group comprising n pins is ascending, e.g., from index 0 to n-1, False otherwise.

Type

bool

contains_pin(self: hal_py.ModulePinGroup, pin: hal_py.ModulePin) bool

Check whether the pin group contaisn the given pin.

Parameters

pin (hal_py.ModulePin) – The pin to check.

Returns

True if the pin group contains the pin, True otherwise.

Return type

bool

property descending

True if the pin order of a pin group comprising n pins is descending, e.g., from index n-1 to 0, False otherwise.

Type

bool

property direction

The direction of the pin group.

Type

hal_py.PinDirection

empty(self: hal_py.ModulePinGroup) bool

Check whether the pin group is empty, i.e., contains no pins.

Returns

True if the pin group is empty, False otherwise.

Return type

bool

get_direction(self: hal_py.ModulePinGroup) hal_py.PinDirection

Get the direction of the pin group.

Returns

The direction of the pin.

Return type

hal_py.PinDirection

get_highest_index(self: hal_py.ModulePinGroup) int

Get the numerically highest index of the pin group.

Returns

The highest index.

Return type

int

get_id(self: hal_py.ModulePinGroup) int

Get the ID of the module pin group. The ID is unique within a module.

Returns

The ID of the pin.

Return type

int

get_index(self: hal_py.ModulePinGroup, pin: hal_py.ModulePin) int

Get the index within the pin group of the given pin.

Parameters

pin (hal_py.ModulePin) – The pin

Returns

The index of the pin on success, -1 otherwise.

Return type

int

get_lowest_index(self: hal_py.ModulePinGroup) int

Get the numerically lowest index of the pin group.

Returns

The lowest index.

Return type

int

get_name(self: hal_py.ModulePinGroup) str

Get the name of the pin group.

Returns

The name of the pin group.

Return type

str

get_pin_at_index(self: hal_py.ModulePinGroup, index: int) hal_py.ModulePin

Get the pin specified by the given index.

Parameters

index (int) – The index of the pin within the pin group.

Returns

The pin on success, None otherwise.

Return type

hal_py.ModulePin or None

get_pins(self: hal_py.ModulePinGroup, filter: Callable[[hal_py.ModulePin], bool] = None) List[hal_py.ModulePin]

Get the (ordered) pins of the pin groups. The optional filter is evaluated on every pin such that the result only contains pins matching the specified condition.

Parameters

filter (lambda) – Filter function to be evaluated on each pin.

Returns

The ordered pins.

Return type

list[hal_py.ModulePin]

get_start_index(self: hal_py.ModulePinGroup) int

Get the start index of the pin group. For ascending pin groups, this index equals the lowest index of the pin group. For descending pin groups, it is equal to the highest index of the pin group.

Returns

The start index.

Return type

int

get_type(self: hal_py.ModulePinGroup) hal_py.PinType

Get the type of the pin group.

Returns

The type of the pin.

Return type

hal_py.PinType

property highest_index

The numerically highest index of the pin group.

Type

int

property id

The ID of the module pin group. The ID is unique within a module.

Type

int

is_ascending(self: hal_py.ModulePinGroup) bool

Check whether the pin order of a pin group comprising n pins is ascending, e.g., from index 0 to n-1.

Returns

True for ascending bit order, False otherwise.

Return type

bool

is_descending(self: hal_py.ModulePinGroup) bool

Check whether the pin order of a pin group comprising n pins is descending, e.g., from index n-1 to 0.

Returns

True for descending bit order, False otherwise.

Return type

bool

is_ordered(self: hal_py.ModulePinGroup) bool

Check whether the pin group features an inherent order.

Returns

True if the pin group is inherently ordered, False otherwise.

Return type

bool

property lowest_index

The numerically lowest index of the pin group.

Type

int

property name

The name of the pin group.

Type

str

property ordered

True if the pin group is inherently ordered, False otherwise.

Type

bool

property pins

The (ordered) pins of the pin groups.

Type

list[hal_py.ModulePin]

set_ordered(self: hal_py.ModulePinGroup, ordered: bool = True) None

Set whether the pin group features an inherent order.

Parameters

ordered (bool) – Set True if the pin group is inherently ordered, False otherwise. Defaults to True.

size(self: hal_py.ModulePinGroup) int

Get the size, i.e., the number of pins, of the pin group.

Returns

The size of the pin group.

Return type

int

property start_index

The start index of the pin group. For ascending pin groups, this index equals the lowest index of the pin group. For descending pin groups, it is equal to the highest index of the pin group.

Type

int

property type

The type of the pin group.

Type

hal_py.PinType