Variable length frames, part1: USB Host -> Pm3

This commit is contained in:
Philippe Teuwen 2019-04-16 10:01:08 +02:00
commit 34467b7550
8 changed files with 229 additions and 16 deletions

View file

@ -35,6 +35,27 @@ typedef struct {
} d;
} PACKED UsbCommand;
typedef struct {
uint32_t magic;
uint32_t length; // length of the variable part, 0 if none.
} PACKED UsbCommandNGPreamble;
#define USB_PREAMBLE_MAGIC 0xAA5500FF
typedef struct {
uint64_t cmd;
uint64_t arg[3];
} PACKED UsbCommandNG;
typedef struct {
uint32_t crc;
uint32_t magic;
} PACKED UsbCommandNGPostamble;
#define USB_POSTAMBLE_MAGIC 0xFF0055AA
extern bool use_cmd_ng;
#ifdef WITH_FPC_HOST
// "Session" flag, to tell via which interface next msgs should be sent: USB or FPC USART
extern bool reply_via_fpc;