send a Report Descriptor HID on the USB port with python in es32
Posted: Fri Jul 08, 2022 7:51 am
Hello
I want to use The boot.py file in the URL(https://github.com/pmvr/micropython-fid ... ff91999c91) to send my Report Descriptor HID to the USB port, but there is no support for the library(import pyb), I used from libraries(machine.UART() -serial - time ), able not send my Report Descriptor HID through the USB port!
I followed various links about libraries - sample codes and instructions, but I didn't get an answer
Please guide me.
My source code...
from machine import UART
HID_PACKET_SIZE = 64
HID_FIDO_ReportDesc = bytes((
0x06, 0xd0, 0xf1, # USAGE_PAGE (FIDO Alliance)
0x09, 0x01, # USAGE (Keyboard)
0xa1, 0x01, # COLLECTION (Application)
0x09, 0x20, # USAGE (Input Report Data)
0x15, 0x00, # LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, # LOGICAL_MAXIMUM (255)
0x75, 0x08, # REPORT_SIZE (8)
0x95, HID_PACKET_SIZE, # REPORT_COUNT (64)
0x81, 0x02, # INPUT (Data,Var,Abs)
0x09, 0x21, # USAGE(Output Report Data)
0x15, 0x00, # LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, # LOGICAL_MAXIMUM (255)
0x75, 0x08, # REPORT_SIZE (8)
0x95, HID_PACKET_SIZE, # REPORT_COUNT (64)
0x91, 0x02, # OUTPUT (Data,Var,Abs)
0xc0 # END_COLLECTION
))
uart = UART(115200)
if uart.any():
uart.write(HID_FIDO_ReportDesc, vid=0xaffe, pid=0x7b01)
#uart.init(115200, bits=8, parity=None, stop=1)
Thanks.
I want to use The boot.py file in the URL(https://github.com/pmvr/micropython-fid ... ff91999c91) to send my Report Descriptor HID to the USB port, but there is no support for the library(import pyb), I used from libraries(machine.UART() -serial - time ), able not send my Report Descriptor HID through the USB port!
I followed various links about libraries - sample codes and instructions, but I didn't get an answer
Please guide me.
My source code...
from machine import UART
HID_PACKET_SIZE = 64
HID_FIDO_ReportDesc = bytes((
0x06, 0xd0, 0xf1, # USAGE_PAGE (FIDO Alliance)
0x09, 0x01, # USAGE (Keyboard)
0xa1, 0x01, # COLLECTION (Application)
0x09, 0x20, # USAGE (Input Report Data)
0x15, 0x00, # LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, # LOGICAL_MAXIMUM (255)
0x75, 0x08, # REPORT_SIZE (8)
0x95, HID_PACKET_SIZE, # REPORT_COUNT (64)
0x81, 0x02, # INPUT (Data,Var,Abs)
0x09, 0x21, # USAGE(Output Report Data)
0x15, 0x00, # LOGICAL_MINIMUM (0)
0x26, 0xff, 0x00, # LOGICAL_MAXIMUM (255)
0x75, 0x08, # REPORT_SIZE (8)
0x95, HID_PACKET_SIZE, # REPORT_COUNT (64)
0x91, 0x02, # OUTPUT (Data,Var,Abs)
0xc0 # END_COLLECTION
))
uart = UART(115200)
if uart.any():
uart.write(HID_FIDO_ReportDesc, vid=0xaffe, pid=0x7b01)
#uart.init(115200, bits=8, parity=None, stop=1)
Thanks.