lpf2.port_expander

Port expanders: one port in, four ports out.

To use a real expander, plug it in and call hub.ports.A.device().getPort(0) (see lpf2.devices.port_expander). This module lets you build a pretend one.

Submodules

Classes

virtual_port_expander_device

Advanced: a pretend port expander that combines up to four ports into one.

Package Contents

class lpf2.port_expander.virtual_port_expander_device[source]

Bases: lpf2.virtual.device

Advanced: a pretend port expander that combines up to four ports into one.

Add ports with attachPort(), then put it into a lpf2.virtual.port or lpf2.local.emulated_port.

Create an empty pretend expander.

attachPort(port_num: int, port: lpf2.port) → None[source]

Use port as expander port port_num (0..3, see lpf2.port_expander.port_num).