Handshake working with new abstractions
This commit is contained in:
parent
42d4bebde7
commit
2f4f3e13aa
11 changed files with 1118 additions and 77 deletions
|
|
@ -3,8 +3,35 @@
|
|||
|
||||
#include "usart_helpers.h"
|
||||
|
||||
|
||||
extern struct dma_usart_file *usart2_out;
|
||||
|
||||
enum control_packet_types {
|
||||
_HOST_RESERVED = 0,
|
||||
HOST_INITIATE_HANDSHAKE = 1,
|
||||
HOST_HANDSHAKE = 2,
|
||||
HOST_DATA = 3,
|
||||
};
|
||||
|
||||
enum packet_types {
|
||||
_PACKET_RESERVED = 0,
|
||||
HID_KEYBOARD_REPORT = 1,
|
||||
HID_MOUSE_REPORT = 2,
|
||||
PAIRING = 3,
|
||||
};
|
||||
|
||||
struct hid_report_packet {
|
||||
uint8_t type;
|
||||
uint8_t len;
|
||||
uint8_t report[8];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
struct control_packet {
|
||||
uint8_t type;
|
||||
uint8_t payload[0];
|
||||
} __attribute__((__packed__));
|
||||
|
||||
|
||||
void send_packet(struct dma_usart_file *f, const uint8_t *data, size_t len);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue