ch552: Add functionality to dynamically control USB endpoints

- Make it possible to enable and disable endpoints on demand
- Add internal FPGA<->CH552 communication channel (IO_CH552)
- Reorder IO endpoint numbering
- Rename endpoint from TKEYCTRL to DEBUG and update related variables
- Rename endpoint from HID to FIDO and update related variables
This commit is contained in:
Jonas Thörnblad 2025-03-24 16:00:41 +01:00 committed by Michael Cardell Widerkrantz
parent d94387a9e7
commit d43585ee1a
No known key found for this signature in database
GPG key ID: D3DB3DDF57E704E5
8 changed files with 453 additions and 365 deletions

View file

@ -3,12 +3,11 @@
#include "config.h"
#include "debug.h"
#include "io.h"
#include "lib.h"
#include "mem.h"
#include "print.h"
#define MODE_CH552 0x10
void printStr(uint8_t *str)
{
#ifdef USE_DEBUG_PRINT
@ -19,7 +18,7 @@ void printStr(uint8_t *str)
}
#elif defined(DEBUG_PRINT_SW)
uint32_t str_len = strlen(str);
CH554UART1SendByte(MODE_CH552);
CH554UART1SendByte(IO_CH552);
CH554UART1SendByte(str_len);
CH554UART1SendBuffer(str, str_len);
#endif
@ -34,7 +33,7 @@ void printChar(uint8_t c)
#if defined(DEBUG_PRINT_HW)
CH554UART0SendByte(c);
#elif defined(DEBUG_PRINT_SW)
CH554UART1SendByte(MODE_CH552);
CH554UART1SendByte(IO_CH552);
CH554UART1SendByte(1);
CH554UART1SendByte(c);
#endif