complete refactor to directly pass reports and interfaces
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
#ifndef USB_DEVICE_H_
|
||||
#define USB_DEVICE_H_
|
||||
|
||||
#define DESC_CFG_MAX TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + CFG_TUD_HID*TUD_HID_DESC_LEN
|
||||
|
||||
#define USB_PID 0xE2BD
|
||||
#define USB_VID 0xCEC0
|
||||
#define USB_BCD 0x0200
|
||||
|
||||
#define EPNUM_CDC_NOTIF 0x81
|
||||
#define EPNUM_CDC_OUT 0x02
|
||||
#define EPNUM_CDC_IN 0x82
|
||||
#define EPNUM_HID 0x83
|
||||
|
||||
enum
|
||||
{
|
||||
ITF_NUM_CDC=0,
|
||||
ITF_NUM_CDC_DATA,
|
||||
ITF_NUM_HID
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
DEVICE_INACTIVE=0,
|
||||
DEVICE_ACTIVE,
|
||||
DEVICE_RESTART,
|
||||
} device_state_t;
|
||||
|
||||
extern char cdc_buf[64];
|
||||
extern uint16_t cdc_len;
|
||||
extern size_t cdc_count;
|
||||
extern device_state_t device_state;
|
||||
|
||||
void usb_device_main(void);
|
||||
void cdc_print_hex(uint8_t const* msg, uint16_t msg_len);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user