diff options
| author | Damien <damien.p.george@gmail.com> | 2013-10-25 20:53:54 +0100 |
|---|---|---|
| committer | Damien <damien.p.george@gmail.com> | 2013-10-25 20:53:54 +0100 |
| commit | 58a1b4c6cf8b9675c56e9eebd0f620ec7b66d83f (patch) | |
| tree | eaa73f9969018ee88f5c013f63936c9665ecdcdd /stm/usb.c | |
| parent | 2839168340b5ac9f947c01b42f7ddf960da81aa6 (diff) | |
Add USB HID support. Runs as an alternative to VCP+MSC.
Diffstat (limited to 'stm/usb.c')
| -rw-r--r-- | stm/usb.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); +} |
