aboutsummaryrefslogtreecommitdiff
path: root/robot/sercomm.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 15:39:31 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 15:39:31 +0200
commit60f07661602a5dfe8e39b8038964b38bddcb33a5 (patch)
tree0b257acda0797a13cd09e7df2d16a6da0a6aef11 /robot/sercomm.h
parent333eea840a17d0f8ecf0110d952df2857fea4da0 (diff)
parentf073c9d3848dab915bed4844e9d13684aa5e23eb (diff)
merge dev into master
Diffstat (limited to 'robot/sercomm.h')
-rw-r--r--robot/sercomm.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/robot/sercomm.h b/robot/sercomm.h
index 58c79b9..b1f69c7 100644
--- a/robot/sercomm.h
+++ b/robot/sercomm.h
@@ -1,5 +1,23 @@
#pragma once
+#include "../shared/bin.h"
+#include "../shared/consts.h"
+#include "../shared/protocol.h"
+
+/** sercomm ring buffer */
+extern w2_s_bin *g_w2_sercomm_buffer[W2_SERCOMM_BUFFER_SIZE];
+/** stores head of ring buffer */
+extern uint8_t g_w2_sercomm_index;
+/** stores start of ring buffer */
+extern uint8_t g_w2_sercomm_offset;
+
+/** serial input (receive) buffer */
+extern char g_w2_serial_buffer[W2_SERIAL_READ_BUFFER_SIZE];
+/** serial input (receive) buffer current position */
+extern uint8_t g_w2_serial_buffer_index;
+/** serial input (receive) buffer head (sim only) */
+extern uint8_t g_w2_serial_buffer_head;
+
/**
* serial pc-robot communication module
*
@@ -7,3 +25,6 @@
* - sends all data in the message buffer
*/
void w2_sercomm_main();
+
+/** append binary message to send buffer */
+void w2_sercomm_append_msg(w2_s_bin *data);