Dmitry Kovalev / Mbed 2 deprecated LG2

Dependencies:   mbed

Fork of LG by igor Apu

Revision:
75:cc1942179a2f
Parent:
74:f4d9c3403578
Child:
76:1c54a614564d
diff -r f4d9c3403578 -r cc1942179a2f DeviceProtocol.h
--- a/DeviceProtocol.h	Sat Feb 27 18:42:37 2016 +0000
+++ b/DeviceProtocol.h	Sun Feb 28 06:07:22 2016 +0000
@@ -81,7 +81,7 @@
   ResponseData data; //what send: buffer/Delta_BINS/Delta_PS/Delta_SF/M_Rate
   uint32_t counter;  //time from: broadcast line request/latch pulse/last response; values in mks;
   uint32_t trigger;  //counter value to response; values in mks;
-  uint32_t rate; //response baud rate
+  uint32_t rate;     //response baud rate
   DeviceOutputBuffer buffer;
   uint8_t ready;
 } DeviceResponse;
@@ -99,12 +99,13 @@
 } DeviceRequest;
 
 typedef struct _DeviceProtocolDecoder {
-  uint8_t address;
-  uint8_t code;
-  uint8_t error;
-  uint8_t count;
-  uint16_t position;
-  uint16_t CRC;
+  uint8_t address;  //Decoded request address
+  uint8_t code;     //Decoded command code
+  uint8_t version;  //Decoded protocol version (currently only 0 version exist)
+  uint8_t error;    //Decode error encountered
+  uint8_t count;    //Decoded bytes count
+  uint16_t position;//Current decoder position in input buffer
+  uint16_t CRC;     //Current/final CRC of decoded packet
 } DeviceProtocolDecoder;
 
 typedef struct _DeviceProtocolEncoder {
@@ -115,7 +116,8 @@
 } DeviceProtocolEncoder;
 
 void Decode(void);
-
+void Encode(void);
+void Transmit(void);
 
 uint8_t Decode8(void);
 uint16_t Decode16(void);