The main use case for this Feather is to use it as a USB host device. In the example below, you'll use scan for an attached USB device and print out its descriptors using the Adafruit_CircuitPython_USB_Host_Descriptors library.
CircuitPython Usage
To use with CircuitPython, you need to first install the USB host descriptors library into the lib folder onto your CIRCUITPY drive. Then you need to update code.py with the example script.
Thankfully, we can do this in one go. In the example below, click the Download Project Bundle button below to download the necessary libraries and the code.py file in a zip file. Extract the contents of the zip file, and copy the entire lib folder and the code.py file to your CIRCUITPY drive.
Your CIRCUITPY/lib folder should contain the following file:
- adafruit_usb_host_descriptors.mpy

# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries # SPDX-FileCopyrightText: Copyright (c) 2023 Scott Shawcroft for Adafruit Industries # # SPDX-License-Identifier: Unlicense import time import usb.core import adafruit_usb_host_descriptors DIR_IN = 0x80 while True: print("searching for devices") for device in usb.core.find(find_all=True): print("pid", hex(device.idProduct)) print("vid", hex(device.idVendor)) print("man", device.manufacturer) print("product", device.product) print("serial", device.serial_number) print("config[0]:") config_descriptor = adafruit_usb_host_descriptors.get_configuration_descriptor(device, 0) i = 0 while i < len(config_descriptor): descriptor_len = config_descriptor[i] descriptor_type = config_descriptor[i + 1] if descriptor_type == adafruit_usb_host_descriptors.DESC_CONFIGURATION: config_value = config_descriptor[i + 5] print(f" value {config_value:d}") elif descriptor_type == adafruit_usb_host_descriptors.DESC_INTERFACE: interface_number = config_descriptor[i + 2] interface_class = config_descriptor[i + 5] interface_subclass = config_descriptor[i + 6] print(f" interface[{interface_number:d}]") print(f" class {interface_class:02x} subclass {interface_subclass:02x}") elif descriptor_type == adafruit_usb_host_descriptors.DESC_ENDPOINT: endpoint_address = config_descriptor[i + 2] if endpoint_address & DIR_IN: print(f" IN {endpoint_address:02x}") else: print(f" OUT {endpoint_address:02x}") i += descriptor_len print() time.sleep(5)
Plug in a USB device into the USB A host port on the Feather. You'll see its descriptor information print to the serial console.
Page last edited February 19, 2025
Text editor powered by tinymce.