summaryrefslogtreecommitdiff
path: root/stm/usb.c
diff options
context:
space:
mode:
authorDamien <damien.p.george@gmail.com>2013-10-25 20:53:54 +0100
committerDamien <damien.p.george@gmail.com>2013-10-25 20:53:54 +0100
commit58a1b4c6cf8b9675c56e9eebd0f620ec7b66d83f (patch)
treeeaa73f9969018ee88f5c013f63936c9665ecdcdd /stm/usb.c
parent2839168340b5ac9f947c01b42f7ddf960da81aa6 (diff)
Add USB HID support. Runs as an alternative to VCP+MSC.
Diffstat (limited to 'stm/usb.c')
-rw-r--r--stm/usb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/stm/usb.c b/stm/usb.c
index 97e96c35e..b0fbfa194 100644
--- a/stm/usb.c
+++ b/stm/usb.c
@@ -23,6 +23,7 @@ void usb_init(void) {
if (!is_enabled) {
// only init USB once in the device's power-lifetime
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_PYB_cb, &USR_cb);
+ //USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_PYB_HID_cb, &USR_cb);
}
rx_buf_in = 0;
rx_buf_out = 0;
@@ -100,3 +101,7 @@ void usb_vcp_send_strn_cooked(const char *str, int len) {
APP_Rx_ptr_in = (APP_Rx_ptr_in + 1) & (APP_RX_DATA_SIZE - 1);
}
}
+
+void usb_hid_send_report(uint8_t *buf) {
+ USBD_HID_SendReport(&USB_OTG_dev, buf, 4);
+}