X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Fusb_stm32.h;h=a4cbb6b59d5a35ef68d807ed3e2db2452315d59f;hb=fc4c05ba8c053fb8dbc47717edce392dbd9b52aa;hp=f9cf425b4d9bcfc915255cd4a7402fc399c7493e;hpb=6480c41afbe49bae54aeb18ce38bf58f541bf14e;p=bertos.git diff --git a/bertos/cpu/cortex-m3/drv/usb_stm32.h b/bertos/cpu/cortex-m3/drv/usb_stm32.h index f9cf425b..a4cbb6b5 100644 --- a/bertos/cpu/cortex-m3/drv/usb_stm32.h +++ b/bertos/cpu/cortex-m3/drv/usb_stm32.h @@ -42,6 +42,7 @@ #include #include +#include #define USB_BASE_ADDR 0x40005C00 @@ -50,8 +51,10 @@ #define USB_DISC_PIN (1 << 11) #define USB_EP0_MAX_SIZE 8 -#define USB_RX_MAX_SIZE 64 -#define USB_TX_MAX_SIZE 64 +#define USB_XFER_MAX_SIZE 64 + +#define EP_MAX_SLOTS USB_EP_MAX +#define EP_MAX_NUM (EP_MAX_SLOTS << 1) /* USB packet memory organization */ #define USB_PACKET_MEMORY_BASE 0x40006000 @@ -59,7 +62,7 @@ /* Offset of the buffer descriptor table inside the packet memory */ #define USB_BDT_OFFSET \ - ((USB_PACKET_MEMORY_SIZE - (sizeof(stm32_UsbBd) * ENP_MAX_NUMB)) & ~7) + ((USB_PACKET_MEMORY_SIZE - (sizeof(stm32_UsbBd) * EP_MAX_NUM)) & ~7) #define USB_MEM_ADDR(offset) \ (USB_PACKET_MEMORY_BASE + ((offset << 1) & ~3) + (offset & 1)) @@ -169,7 +172,7 @@ typedef enum stm32_UsbEP ENP14_OUT, ENP14_IN, ENP15_OUT, ENP15_IN, - ENP_MAX_NUMB + EP_MAX_HW_NUM } stm32_UsbEP; /* STM32 USB packet memory slot */