aboutsummaryrefslogtreecommitdiff
path: root/stmhal/usb.h
diff options
context:
space:
mode:
authorDamien George2014-03-30 00:00:15 +0000
committerDamien George2014-03-30 00:00:15 +0000
commit038df4318362325b5b6b77f7582fb6373a240f3c (patch)
tree412143786f23fc67681f44f0673ee72f2a6a7f0d /stmhal/usb.h
parentd40d8f1e168c5bc3cf52f51d9592425574e7e6a9 (diff)
stmhal: Implement selector for USB device mode; improve boot up.
Can now choose at boot up whether the USB device is CDC+MSC or CDC+HID. Choice is made by an option in boot.py, with default being CDC+MSC. HID+MSC is not currently supported, but should be easy to implement. Boot up now has ability to change the reset mode: hold down USR switch while booting and LEDs will count from 1 to 7 to indicate the boot mode. Release USR when correct mode is selected. Current modes are 1 (normal boot), 2 (safe mode), 3 (reset FS mode).
Diffstat (limited to 'stmhal/usb.h')
-rw-r--r--stmhal/usb.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/stmhal/usb.h b/stmhal/usb.h
index e30b1364f..014b51eef 100644
--- a/stmhal/usb.h
+++ b/stmhal/usb.h
@@ -5,16 +5,16 @@
#define VCP_CHAR_CTRL_D (4)
typedef enum {
- USBD_DEVICE_CDC_MSC,
- USBD_DEVICE_HID,
-} usbd_device_kind_t;
+ USB_DEVICE_MODE_CDC_MSC,
+ USB_DEVICE_MODE_CDC_HID,
+} usb_device_mode_t;
typedef enum {
- USBD_STORAGE_MEDIUM_FLASH,
- USBD_STORAGE_MEDIUM_SDCARD,
-} usbd_storage_medium_kind_t;
+ USB_STORAGE_MEDIUM_FLASH,
+ USB_STORAGE_MEDIUM_SDCARD,
+} usb_storage_medium_t;
-void pyb_usb_dev_init(usbd_device_kind_t device_kind, usbd_storage_medium_kind_t medium_kind);
+void pyb_usb_dev_init(usb_device_mode_t mode, usb_storage_medium_t medium);
bool usb_vcp_is_enabled(void);
bool usb_vcp_is_connected(void);
void usb_vcp_set_interrupt_char(int c);