adds a USB serial port to your design
Dependents: Example_WatchDog_Timer
Diff: USBSerial/USBSerial.h
- Revision:
- 70:2c525a50f1b6
- Parent:
- 51:deafa44182d9
- Child:
- 75:9e53252fac92
- Child:
- 77:3e96144c2bf2
diff -r c5e178adb138 -r 2c525a50f1b6 USBSerial/USBSerial.h --- a/USBSerial/USBSerial.h Fri Nov 11 17:59:00 2016 +0000 +++ b/USBSerial/USBSerial.h Thu Jul 20 10:14:36 2017 +0100 @@ -22,7 +22,7 @@ #include "USBCDC.h" #include "Stream.h" #include "CircBuffer.h" - +#include "Callback.h" /** * USBSerial example @@ -83,6 +83,13 @@ */ uint8_t available(); + /** + * Check if the terminal is connected. + * + * @returns connection status + */ + bool connected(); + /** Determine if there is a character available to read * * @returns @@ -153,7 +160,7 @@ } private: - FunctionPointer rx; + Callback<void()> rx; CircBuffer<uint8_t,128> buf; void (*settingsChangedCallback)(int baud, int bits, int parity, int stop); };