X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fdrv%2Fusb_stm32.h;h=7801e2c8a3940a76858a00c975450a19dad511fb;hb=d369c385f36aae74d203f6c40ee81c80d9032bbc;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..7801e2c8 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 @@ -49,9 +50,11 @@ #define USB_DP_PIN (1 << 12) #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_EP0_MAX_SIZE CONFIG_EP0_MAX_SIZE +#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 */