USB_HID and how to declare VENDOR DEVICE ID

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ryenbee
 
Posts: 2
Joined: Wed Nov 24, 2021 11:39 am

USB_HID and how to declare VENDOR DEVICE ID

Post by ryenbee »

Hi all,

I want to set the VID/HID ( aka Vendor and Device ) id for the keyboard (see below) that I am exposing via HID. When I worked with Arduino IDE and Digispark board, I only had to modify the usbconfig.h file. I have searched for a long time on how to do this with CircuitPython to no avail.

BG info:
I have read the article here: https://learn.adafruit.com/customizing- ... n?view=all
and learned how to _only_ expose a keyboard with my trinket M0

Code: Select all

usb_hid.enable((usb_hid.Device.KEYBOARD,))   # Enable just KEYBOARD.


Any thoughts, tips, ideas ? Thanks.

User avatar
danhalbert
 
Posts: 4653
Joined: Tue Aug 08, 2017 12:37 pm

Re: USB_HID and how to declare VENDOR DEVICE ID

Post by danhalbert »

The USB VID/PID (Vendor/Product ids) are set in one of the board configuration files, e.g. `circuitpython/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk`

User avatar
ryenbee
 
Posts: 2
Joined: Wed Nov 24, 2021 11:39 am

Re: USB_HID and how to declare VENDOR DEVICE ID

Post by ryenbee »

I can't believe I'm asking this, as I thought it was straightforward, but with my trinket M0, when plugged in just mounts a drive with main.py and some other files. I looked through this whole drive could not find anything close to what you mentioned.

I went ahead and tried to hit the reset button, that then gave me the BOOTDRV mounting, which only has 3 files. I am stuck now, I think the abstraction with CircuitPython is very well done and can't find low level files. ??

User avatar
danhalbert
 
Posts: 4653
Joined: Tue Aug 08, 2017 12:37 pm

Re: USB_HID and how to declare VENDOR DEVICE ID

Post by danhalbert »

Sorry, the files and settings I am talking about are in the source code files for CircuitPython. You would change them when you build CircuitPython. There are not changeable at runtime, and are not set in CIRCUITPY.

Here's a guide on building CircuitPython: https://learn.adafruit.com/building-circuitpython

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”