WIP: Add USB HID and framing support over UART

- Add USB HID support.
- Add framing to distinguish between CDC and HID data sent over the UART.
- Add some debug printing.
- Cleanup of code and formatting.
This commit is contained in:
Jonas Thörnblad 2024-07-04 18:24:07 +02:00 committed by Mikael Ågren
parent f6c0501db9
commit a0910e25c3
No known key found for this signature in database
GPG key ID: E02DA3D397792C46
12 changed files with 2047 additions and 1138 deletions

View file

@ -37,17 +37,17 @@ if __name__ == "__main__":
f.write('#ifndef USB_STRINGS\n')
f.write('#define USB_STRINGS\n')
f.write('unsigned char __code Prod_Des[]={{ // "{}"\n'.format(product))
f.write('unsigned char __code ProdDesc[]={{ // "{}"\n'.format(product))
f.write(' ')
f.write(', '.join(['0x{:02x}'.format(i) for i in string_to_descriptor(product)]))
f.write('\n};\n\n')
f.write('unsigned char __code Manuf_Des[]={{ // "{}"\n'.format(manufacturer))
f.write('unsigned char __code ManufDesc[]={{ // "{}"\n'.format(manufacturer))
f.write(' ')
f.write(', '.join(['0x{:02x}'.format(i) for i in string_to_descriptor(manufacturer)]))
f.write('\n};\n\n')
f.write('unsigned char __code SerDes[]={{ // "{}"\n'.format(serial))
f.write('unsigned char __code SerialDesc[]={{ // "{}"\n'.format(serial))
f.write(' ')
f.write(', '.join(['0x{:02x}'.format(i) for i in string_to_descriptor(serial)]))
f.write('\n};\n\n')