summaryrefslogtreecommitdiff
path: root/client/serial.h
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-29 13:15:58 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-29 13:15:58 +0200
commit529f067e65b0146c5afa150103809ba5e09869b7 (patch)
tree80fa7a44ce8f5d43b2cc04dc1d0fd1fb79eb254e /client/serial.h
parentdbd005573295293d35647dc0e9feb2beec48a31c (diff)
client/robot sim connected
Diffstat (limited to 'client/serial.h')
-rw-r--r--client/serial.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/serial.h b/client/serial.h
new file mode 100644
index 0000000..caa3cda
--- /dev/null
+++ b/client/serial.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "../shared/bool.h"
+
+/** @file serial.h */
+
+/**
+ * read byte from serial port
+ *
+ * @return -1 if read fails, else char read
+ */
+int w2_serial_read();
+/** write `data` with length `length` to serial port */
+bool w2_serial_write(char *data, uint8_t length);
+/** open serial port */
+bool w2_serial_open(const char *port_name);
+/** close serial port */
+void w2_serial_close();