summaryrefslogtreecommitdiff
path: root/ucoo/hal/usb/usb.stm32.hh
diff options
context:
space:
mode:
authorNicolas Schodet2016-01-14 14:06:02 +0100
committerNicolas Schodet2019-10-07 00:44:57 +0200
commit4295b92ef9725acceb655bc551643c91773a00c6 (patch)
tree980534bb677aaedbbfb5e2010c16c5577f161db3 /ucoo/hal/usb/usb.stm32.hh
parente6c2060483a75dbfd266ab13571af721e9cdd2fa (diff)
ucoo/hal/usb: add enable and disable functions
Diffstat (limited to 'ucoo/hal/usb/usb.stm32.hh')
-rw-r--r--ucoo/hal/usb/usb.stm32.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/ucoo/hal/usb/usb.stm32.hh b/ucoo/hal/usb/usb.stm32.hh
index 11ce16c..5c44e2f 100644
--- a/ucoo/hal/usb/usb.stm32.hh
+++ b/ucoo/hal/usb/usb.stm32.hh
@@ -43,6 +43,12 @@ class UsbStreamControl
/// Construct a new USB control object, with given VENDOR and PRODUCT
/// strings.
UsbStreamControl (const char *vendor, const char *product);
+ /// Destruct and disable.
+ ~UsbStreamControl ();
+ /// Enable device.
+ void enable ();
+ /// Disable device.
+ void disable ();
/// Return true if the device is configured. This means that the
/// connection is done with the host and data can be exchanged.
bool is_configured () const { return configured_; }
@@ -59,6 +65,8 @@ class UsbStreamControl
static const int stream_nb_ = CONFIG_UCOO_HAL_USB_STREAM_NB;
/// Pointer to the one and only instance.
static UsbStreamControl *instance_;
+ /// Is currently enabled?
+ bool enabled_;
/// Whether device is currently configured.
bool configured_;
/// Internal RX buffer type.