Test1

Dependencies:   mbed

Revision:
12:6f63e376c0aa
Parent:
11:6519744c77f9
Child:
13:b9e066badefa
--- a/TxRxService.h	Sat Aug 03 20:03:56 2019 +0000
+++ b/TxRxService.h	Sat Aug 03 21:21:01 2019 +0000
@@ -1,6 +1,19 @@
-#define ArrTxInitializer {0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4b,0x4c,0x4d,0x4e,0x4f}
-#define ArrRxInitializer {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
-//#define ArrRxInitializer {}
+#define HeaderByte 0
+#define HeaderByteQty 5
+#define MsgCmdSize 1
+#define MsgParsSize 4
+#define MsgCS_Size 1
+
+#define ArrTxSize (HeaderByteQty + MsgCmdSize + MsgParsSize + MsgCS_Size)
+#define ArrRxSize (HeaderByteQty + MsgCmdSize + MsgParsSize + MsgCS_Size)
+
+
+
+
+//#define ArrTxInitializer {0x20,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4b,0x4c,0x4d,0x4e,0x4f}
+#define ArrTxInitializer {}
+//#define ArrRxInitializer {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}
+#define ArrRxInitializer {}
 
 extern uint8_t RxBuff[ArrRxSize];
 extern uint8_t TxBuff[ArrTxSize];
@@ -8,4 +21,21 @@
 extern bool ArrTxBusy;
 extern bool TxBuffFull;
 extern void StartTx();
-extern void TxRxServiceInit();
\ No newline at end of file
+extern void TxRxServiceInit();
+
+typedef union {
+    uint8_t ui8[4];
+    int8_t i8[4];
+    uint16_t ui16[2];
+    int16_t i16[2];
+    uint32_t ui32;
+    int32_t i32;
+    float f;
+    } ParsType;
+  
+typedef struct {
+    uint8_t cmd;
+    ParsType pars;
+    uint8_t cs;
+    } MsgType;
+       
\ No newline at end of file