Skip to content

Blinka Compatibility #18

@relic-se

Description

@relic-se

Continuing discussion on #17, I'd love to see Blinka compatibility with this library in some shape or fashion. We've determined it's best to continue using PyUsb as the core of interfacing with USB devices rather than another 3rd party mouse-specific library. This will enable native testing and reduce the need for additional code.

Here is a basic test to validate the library within Blinka:

import adafruit_usb_host_mouse
mouse = adafruit_usb_host_mouse.find_and_init_boot_mouse()
if mouse is not None:
    while True:
        if (pressed_btns := mouse.update()) is not None and len(pressed_btns) > 0:
            print(f"{mouse.x},{mouse.y} {" ".join(pressed_btns)}")
else:
    print("mouse not located")

The USB mouse I have connected has been proven to work on CircuitPython devices as a boot mouse, but currently, it is not able to be recognized. The output of the above program is as follows:

scanning usb (boot)
05ac:0304
Mitsumi Electric Apple Optical USB Mouse

bytearray(b'')
was not a boot mouse
mouse not located

It appears that the configuration descriptor isn't working. So, there is likely a issue with adafruit_usb_host_descriptors and Blinka.

config_descriptor = adafruit_usb_host_descriptors.get_configuration_descriptor(
device, 0
)
print(config_descriptor)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions