j5.components.component module

Base classes for components.

class j5.components.component.Component[source]

Bases: object

A component is the smallest logical part of some hardware.

identifier

An integer to identify the component on a board.

static interface_class() → Type[j5.components.component.Interface][source]

Get the interface class that is required to use this component.

class j5.components.component.DerivedComponent[source]

Bases: j5.components.component.Component

A derived component is a component that can take another component as a parameter.

For example, a device may be attached to various pins on the board, and this could vary depending on what the user wants. We solve this by passing the pins to the derived component.

>>> u = Ultrasound(pin_0, pin_1)
identifier

An integer to identify the component on a board.

static interface_class() → Type[j5.components.component.Interface][source]

Get the interface class that is required to use this component.

class j5.components.component.Interface[source]

Bases: object

A base class for interfaces to inherit from.

exception j5.components.component.NotSupportedByComponentError[source]

Bases: Exception

This is thrown when hardware does not support the action that is attempted.