mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-08-12 00:20:17 -04:00
fw: Minimal CDC implementation of new framing protocol
Throwing away mode and length from incoming data. Adding mode and length to outgoing data. Splitting responses into frames small enough for the USB<->UART transceiver to handle.
This commit is contained in:
parent
1b9bbc4eba
commit
2ec36baaf4
3 changed files with 59 additions and 13 deletions
|
@ -8,6 +8,11 @@
|
|||
#ifndef PROTO_H
|
||||
#define PROTO_H
|
||||
|
||||
enum mode {
|
||||
MODE_CDC = 0x40,
|
||||
MODE_HID = 0x80,
|
||||
};
|
||||
|
||||
enum endpoints {
|
||||
DST_HW_IFPGA,
|
||||
DST_HW_AFPGA,
|
||||
|
@ -52,7 +57,8 @@ struct frame_header {
|
|||
|
||||
/*@ -exportlocal @*/
|
||||
void writebyte(uint8_t b);
|
||||
uint8_t readbyte(void);
|
||||
uint8_t readbyte(uint8_t *mode, uint8_t *mode_bytes_left);
|
||||
void fwreply(struct frame_header hdr, enum fwcmd rspcode, uint8_t *buf);
|
||||
int readcommand(struct frame_header *hdr, uint8_t *cmd, int state);
|
||||
int readcommand(struct frame_header *hdr, uint8_t *cmd, int state,
|
||||
uint8_t *mode, uint8_t *mode_bytes_left);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue