mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-14 03:30:02 +00:00
loader: better report descriptor format
This commit is contained in:
parent
0636c12729
commit
b592a95fb1
@ -95,17 +95,35 @@ int usb_init_all(void) {
|
||||
.interface_str = (const uint8_t *)"interface_str",
|
||||
};
|
||||
static uint8_t hid_rx_buffer[64];
|
||||
static const uint8_t hid_report_desc[] = {
|
||||
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined)
|
||||
0x09, 0x01, // USAGE (1)
|
||||
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, 0x40, // 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, 0x40, // REPORT_COUNT (64)
|
||||
0x91, 0x02, // OUTPUT (Data,Var,Abs)
|
||||
0xc0 // END_COLLECTION
|
||||
};
|
||||
static const usb_hid_info_t hid_info = {
|
||||
.iface_num = 0x00,
|
||||
.ep_in = USB_EP_DIR_IN | 0x01,
|
||||
.ep_out = USB_EP_DIR_OUT | 0x01,
|
||||
.subclass = 0,
|
||||
.protocol = 0,
|
||||
.rx_buffer = hid_rx_buffer,
|
||||
.max_packet_len = sizeof(hid_rx_buffer),
|
||||
.rx_buffer = hid_rx_buffer,
|
||||
.polling_interval = 1,
|
||||
.report_desc_len = 34,
|
||||
.report_desc = (const uint8_t *)"\x06\x00\xff\x09\x01\xa1\x01\x09\x20\x15\x00\x26\xff\x00\x75\x08\x95\x40\x81\x02\x09\x21\x15\x00\x26\xff\x00\x75\x08\x95\x40\x91\x02\xc0",
|
||||
.report_desc_len = sizeof(hid_report_desc),
|
||||
.report_desc = hid_report_desc,
|
||||
};
|
||||
|
||||
if (0 != usb_init(&dev_info)) {
|
||||
@ -128,7 +146,6 @@ void mainloop(void)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
SCB->VTOR = LOADER_START + HEADER_SIZE;
|
||||
periph_init();
|
||||
|
||||
if (0 != display_init()) {
|
||||
|
Loading…
Reference in New Issue
Block a user