diff options
Diffstat (limited to 'firmware/source/periph/usbserial.hpp')
-rw-r--r-- | firmware/source/periph/usbserial.hpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/firmware/source/periph/usbserial.hpp b/firmware/source/periph/usbserial.hpp index 58113c9..85da470 100644 --- a/firmware/source/periph/usbserial.hpp +++ b/firmware/source/periph/usbserial.hpp @@ -2,7 +2,7 @@ * @file usbserial.hpp * @brief Wrapper for ChibiOS's SerialUSBDriver. * - * Copyright (C) 2021 Clyne Sullivan + * Copyright (C) 2023 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. @@ -17,11 +17,30 @@ class USBSerial { public: + /** + * Prepares for USB serial communication. + */ static void begin(); + /** + * Returns true if input data has been received. + */ static bool isActive(); + /** + * Reads received input data into the given buffer. + * @param buffer Buffer to store input data. + * @param count Number of bytes to read. + * @return Number of bytes actually read. + */ static size_t read(unsigned char *buffer, size_t count); + + /** + * Writes data to serial output. + * @param buffer Buffer of output data. + * @param count Number of bytes to write. + * @return Number of bytes actually written. + */ static size_t write(const unsigned char *buffer, size_t count); private: |