2013-10-13 19:02:15 +01:00
|
|
|
#include "usb_core.h"
|
|
|
|
#include "usbd_core.h"
|
2013-10-17 22:50:21 +01:00
|
|
|
#include "usbd_cdc_core.h"
|
2013-10-13 19:02:15 +01:00
|
|
|
#include "usbd_pyb_core.h"
|
2013-10-13 00:42:20 +01:00
|
|
|
#include "usbd_usr.h"
|
|
|
|
#include "usbd_desc.h"
|
2013-10-19 15:37:09 +01:00
|
|
|
#include "usb.h"
|
2013-10-13 00:42:20 +01:00
|
|
|
|
2013-10-17 22:50:21 +01:00
|
|
|
extern CDC_IF_Prop_TypeDef VCP_fops;
|
2013-10-13 00:42:20 +01:00
|
|
|
|
2013-10-17 22:50:21 +01:00
|
|
|
int is_enabled = 0;
|
2013-10-13 00:42:20 +01:00
|
|
|
USB_OTG_CORE_HANDLE USB_OTG_dev;
|
|
|
|
|
2013-10-17 22:50:21 +01:00
|
|
|
void usb_init() {
|
|
|
|
USBD_Init(&USB_OTG_dev, USB_OTG_FS_CORE_ID, &USR_desc, &USBD_PYB_cb, &USR_cb);
|
|
|
|
is_enabled = 1;
|
2013-10-13 00:42:20 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void usb_vcp_send(const char* str, int len) {
|
2013-10-17 22:50:21 +01:00
|
|
|
if (is_enabled) {
|
2013-10-19 14:40:54 +01:00
|
|
|
//VCP_fops.pIf_DataTx((const uint8_t*)str, len);
|
2013-10-17 22:50:21 +01:00
|
|
|
}
|
2013-10-13 00:42:20 +01:00
|
|
|
}
|