#ifndef USB_DEVICE_H_
#define USB_DEVICE_H_

#define DESC_CFG_MAX	TUD_CONFIG_DESC_LEN + TUD_CDC_DESC_LEN + TUD_CDC_NCM_DESC_LEN + CFG_TUD_HID*TUD_HID_DESC_LEN

#define USB_PID		0xA410
#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_NCM_NOTIF	0x83
#define EPNUM_NCM_OUT	0x03
#define EPNUM_NCM_IN	0x84
#define EPNUM_HID		0x85

enum
{
  ITF_NUM_CDC=0,
  ITF_NUM_CDC_DATA,
  ITF_NUM_NCM,
  ITF_NUM_NCM_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

