aboutsummaryrefslogtreecommitdiffstats
path: root/firmware/source/periph/usbserial.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2023-08-08 23:10:02 -0400
committerClyne Sullivan <clyne@bitgloo.com>2023-08-08 23:10:02 -0400
commitf440728644ad3698ffd6af1abcfcc07aad5793c3 (patch)
tree68aff014ff17933717616f2f8d407b51611afe2b /firmware/source/periph/usbserial.hpp
initial commit
* combine all source files into this monorepo * convert all third-party source packages into submodules * small fixes due to changes in latest third-part packages
Diffstat (limited to 'firmware/source/periph/usbserial.hpp')
-rw-r--r--firmware/source/periph/usbserial.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/firmware/source/periph/usbserial.hpp b/firmware/source/periph/usbserial.hpp
new file mode 100644
index 0000000..58113c9
--- /dev/null
+++ b/firmware/source/periph/usbserial.hpp
@@ -0,0 +1,32 @@
+/**
+ * @file usbserial.hpp
+ * @brief Wrapper for ChibiOS's SerialUSBDriver.
+ *
+ * Copyright (C) 2021 Clyne Sullivan
+ *
+ * Distributed under the GNU GPL v3 or later. You should have received a copy of
+ * the GNU General Public License along with this program.
+ * If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifndef STMDSP_USBSERIAL_HPP_
+#define STMDSP_USBSERIAL_HPP_
+
+#include "usbcfg.h"
+
+class USBSerial
+{
+public:
+ static void begin();
+
+ static bool isActive();
+
+ static size_t read(unsigned char *buffer, size_t count);
+ static size_t write(const unsigned char *buffer, size_t count);
+
+private:
+ static SerialUSBDriver *m_driver;
+};
+
+#endif // STMDSP_USBSERIAL_HPP_
+