aboutsummaryrefslogtreecommitdiff
path: root/drivers/serial/pcserialport.h
diff options
context:
space:
mode:
authorTero Kontkanen <tero.k@granitedevices.com>2017-08-23 14:44:10 +0300
committerTero Kontkanen <tero.k@granitedevices.com>2017-08-23 14:44:10 +0300
commit98a89371108bbcdedb201caf7be8b82a323e60cc (patch)
tree915a5596c632256ab77d5dc42236644307ea3b66 /drivers/serial/pcserialport.h
parent5d21340928cd46b3cb97cae0b9c707a71ef9ced0 (diff)
parent4176d9358a526ff207bb5f4d127f4143a632d748 (diff)
downloadSimpleMotionV2-98a89371108bbcdedb201caf7be8b82a323e60cc.tar.gz
SimpleMotionV2-98a89371108bbcdedb201caf7be8b82a323e60cc.zip
Merge branch 'feature/port_driver_ftdi_d2xx' into develop
Diffstat (limited to 'drivers/serial/pcserialport.h')
-rw-r--r--drivers/serial/pcserialport.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/serial/pcserialport.h b/drivers/serial/pcserialport.h
new file mode 100644
index 0000000..832786d
--- /dev/null
+++ b/drivers/serial/pcserialport.h
@@ -0,0 +1,40 @@
+/*
+ * pcserialport.h
+ *
+ * Header for PC serial port access library (win/linux)
+ *
+ * Created on: 28.12.2016
+ * Author: Tero
+ *
+ * Inspired by RS232 library by Teunis van Beelen
+ */
+
+
+/* Todo:
+ -Restore port settings at CloseComport
+ */
+
+#ifndef PCSERAILPORT_H
+#define PCSERAILPORT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "simplemotion.h"
+
+//return port handle or -1 if fails
+smint32 serialPortOpen(const char *port_device_name, smint32 baudrate_bps);
+smint32 serialPortRead(smint32 serialport_handle, unsigned char *buf, smint32 size);
+smint32 serialPortWriteByte(smint32 serialport_handle, unsigned char byte);
+smint32 serialPortWriteBuffer(smint32 serialport_handle, unsigned char *buf, smint32 size);
+void serialPortClose(smint32 serialport_number);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+