question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Something that would be very helpful in communicating with computer side frameworks as an alternative to VCP would be the possiblity to have a RawHID class. My understanding of USB is not too in-depth but afaik this would just mean a new descriptor that allows for a report of the maximum possible size to send buffers back and forth.

Right now I can already do this with the existing classes, I’m just limited to very few bytes per transaction and can’t receive something back. F.e. with the consumer key device:

import usb_hid

value = 4024
code = bytearray(2)
bytes = value.to_bytes(2,'big')
for device in usb_hid.devices:
            if device.usage_page == 0x0C and device.usage == 0x01:
                print('found consumer device')
                myDevice = device
                break
device.send_report(bytes)

I found this in the mpy docs but apart from this lonely docs page not much more and the pyb module does not seem to exist in CPY.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dhalbertcommented, Dec 18, 2019

I started working on raw HID for a special project but it’s not at the top of my stack right now.

1reaction
timonskucommented, Dec 18, 2019

@luolou this will only work on microcontrollers that have native USB device support and are supported by CircuitPython. No Laptop or Desktop computer will ever work with this library as they are not USB devices but USB hosts. This library only supports “emulating” HID devices which talk to a USB host like a laptop or desktop PC. E.g. a keyboard that plugs into your laptop. Your laptop is not capable of acting like a keyboard to another computer through a USB connection. If you have further questions please post them in the Adafruit Forums: https://forums.adafruit.com/viewforum.php?f=60 Or on the Adafruit Discord.

Read more comments on GitHub >

github_iconTop Results From Across the Web

RAWHID (winuser.h) - Win32 apps | Microsoft Learn
Minimum supported client, Windows XP [desktop apps only]. Minimum supported server, Windows Server 2003 [desktop apps only].
Read more >
RawHID - Raw HID Support Library
RawHID - Raw HID Support Library. Contains abstraction classes for raw access to human interface devices (HID). The classes mostly provide exception safety ......
Read more >
T4.x support for Raw HID 512? wonder if it makes sense to ...
I thought I would play with Raw HID. This is not completely random as a lot of the MTP USB code is very...
Read more >
Service For You | The Rawhide Health approach
Establishing a doctor-patient relationship that removes barriers to access and encourages contact to support your health is the foundation of the Rawhide ......
Read more >
Residential Services - Rawhide Youth Services
Young men come to Rawhide at some of the lowest points of their lives—when ... Our caring house staff creates safety and builds...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found