#define USB_SELF_POWERED
#define USB_NUM_CONFIGURATIONS 1
-
-typedef unsigned int uint;
-typedef uint8_t byte;
-typedef uint16_t u16;
-typedef int16_t s16;
-typedef uint32_t u32;
-typedef int32_t s32;
-
-#define MIN(x,y) ((x) < (y) ? (x) : (y))
-#define MAX(x,y) ((x) > (y) ? (x) : (y))
+#define USB_DEBUG
/*** USB state structure ***/
};
void usb_init(struct usb *usb, PCD_HandleTypeDef *hpcd);
+void usb_start(struct usb *usb);
enum usb_device_state {
USB_STATE_DEFAULT,
USB_EP0_STALL,
};
+#ifdef USB_DEBUG
+#define usb_debug debug_printf
+#else
+static inline void usb_debug(char *msg, ...)
+{ }
+#endif
+
/*** Constants from USB specs ***/
#define USB_REQ_DIRECTION 0x80