usb_host – USB Host

The usb_host module allows you to manage USB host ports. To communicate with devices use the usb module that is a subset of PyUSB’s API.

Available on these boards
  • SparkFun Teensy MicroMod Processor
  • Teensy 4.1
  • iMX RT 1060 EVK

class usb_host.Port(dp: microcontroller.Pin, dm: microcontroller.Pin)

USB host port. Also known as a root hub port.

Create a USB host port on the given pins. Access attached devices through the usb module. Keep this object referenced while interacting with devices, otherwise they will be disconnected.

Parameters
  • dp (Pin) – The data plus pin

  • dm (Pin) – The data minus pin

deinit() None

Turn off the USB host port and release the pins for other use.

__enter__() Port

No-op used by Context Managers.

__exit__() None

Automatically deinitializes the hardware when exiting a context. See Lifetime and ContextManagers for more info.