From 43f64f0e1fad6e3586cdd5b6f0243f03db9adc23 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 12 Jan 2019 12:31:59 +0900 Subject: Split receiver into logical parts --- fw/protocol.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 fw/protocol.h (limited to 'fw/protocol.h') diff --git a/fw/protocol.h b/fw/protocol.h new file mode 100644 index 0000000..508cfdd --- /dev/null +++ b/fw/protocol.h @@ -0,0 +1,28 @@ +#ifndef __PROTOCOL_H__ +#define __PROTOCOL_H__ + +#include "global.h" + +#define PKT_TYPE_BULK_FLAG 0x80 + +struct proto_rx_st { + int packet_type; + int is_bulk; + int rxpos; + int address; + uint8_t argbuf[8]; + int offset; + struct command_if_def *cmd_if; +}; + +struct command_if_def { + int packet_type_max; + int payload_len[0]; +}; + +/* Callback */ +void handle_command(int command, uint8_t *args); + +void receive_symbol(struct proto_rx_st *st, int symbol); + +#endif -- cgit