]> mj.ucw.cz Git - home-hw.git/blobdiff - Inc/usb.h
Cleaned up handling of endpoints
[home-hw.git] / Inc / usb.h
index ec7cc232f18cbe7d817638aa6481f87dbbf0b216..589774d6af50e02404e6fa48976edcc392e6f049 100644 (file)
--- a/Inc/usb.h
+++ b/Inc/usb.h
@@ -12,24 +12,17 @@ typedef int32_t s32;
 
 /*** USB state structure ***/
 
-struct usb_endpoint {
-  u32 max_packet_size;
-  u32 total_length;
-  u32 remaining_length;
-};
-
 struct usb {
   PCD_HandleTypeDef *hpcd;
   byte state;                  // USB_STATE_xxx
   byte pre_suspend_state;
   byte address;
-  byte speed;                  // PCD_SPEED_xxx
   byte config;
   byte remote_wakeup;
   byte ep0_state;              // USB_EP0_xxx
-  byte ep0_data_len;
-  struct usb_endpoint ep_in[15];
-  struct usb_endpoint ep_out[15];
+  u16 ep0_setup_data_length;
+  u16 ep0_remaining_length;
+  u16 ep0_total_length;
   byte status_buf[2];
 };