mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-01 19:26:13 -04:00
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:
parent
f6c0501db9
commit
a0910e25c3
12 changed files with 2047 additions and 1138 deletions
42
hw/usb_interface/ch552_fw/include/print.h
Normal file
42
hw/usb_interface/ch552_fw/include/print.h
Normal file
|
@ -0,0 +1,42 @@
|
|||
#ifndef __PRINT_H__
|
||||
#define __PRINT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define DEBUG_PRINT
|
||||
//#define DEBUG_SETUP
|
||||
//#define UART_OUT_DEBUG
|
||||
//#define USE_NUM_U8
|
||||
#define USE_NUM_U32
|
||||
//#define USE_NEGATIVE_NUMS
|
||||
|
||||
void printStr(uint8_t *str);
|
||||
void printChar(uint8_t c);
|
||||
|
||||
#ifdef DEBUG_SETUP
|
||||
#define printStrSetup(x) printStr(x)
|
||||
#define printNumHexSetup(x) printNumHex(x)
|
||||
#else
|
||||
#define printStrSetup(x)
|
||||
#define printNumHexSetup(x)
|
||||
#endif
|
||||
|
||||
#ifdef USE_NUM_U8
|
||||
int8_t uint8_to_str(uint8_t *buf, uint8_t bufsize, uint8_t n);
|
||||
#endif
|
||||
|
||||
#ifdef USE_NUM_U32
|
||||
int8_t uint32_to_str(uint8_t *buf, uint8_t bufsize, uint32_t n);
|
||||
#endif
|
||||
|
||||
#ifdef USE_NUM_U8
|
||||
void printNumU8(uint8_t num);
|
||||
#endif
|
||||
|
||||
#ifdef USE_NUM_U32
|
||||
void printNumU32(uint32_t num);
|
||||
#endif
|
||||
|
||||
void printNumHex(uint8_t num);
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue