usbd_conf.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*!
  2. \file usbd_conf.h
  3. \brief the header file of USBFS device-mode configuration
  4. */
  5. /*
  6. Copyright (C) 2017 GigaDevice
  7. 2017-06-06, V1.0.0, firmware for GD32F3x0
  8. */
  9. #ifndef USBD_CONF_H
  10. #define USBD_CONF_H
  11. #include "usb_conf.h"
  12. #define USBD_CFG_MAX_NUM 1
  13. #define USBD_ITF_MAX_NUM 1
  14. #define USB_STR_DESC_MAX_SIZE 64
  15. /* USB feature -- Self Powered */
  16. //#define USBD_SELF_POWERED
  17. /* USB user string supported */
  18. /* #define USB_SUPPORT_USER_STRING_DESC */
  19. //#define USBD_DYNAMIC_DESCRIPTOR_CHANGE_ENABLED
  20. /* Maximum number of supported media (Flash) */
  21. #define MAX_USED_MEMORY_MEDIA 1
  22. #define USB_STRING_COUNT 6
  23. /* DFU maximum data packet size */
  24. #define TRANSFER_SIZE 2048
  25. /* memory address from where user application will be loaded, which represents
  26. the dfu code protected against write and erase operations.*/
  27. #define APP_LOADED_ADDR 0x08004000
  28. /* Make sure the corresponding memory where the DFU code should not be loaded
  29. cannot be erased or overwritten by DFU application. */
  30. #define IS_PROTECTED_AREA(addr) (uint8_t)(((addr >= 0x08000000) && (addr < (APP_LOADED_ADDR)))? 1 : 0)
  31. /* DFU endpoint define */
  32. #define DFU_IN_EP EP0_IN
  33. #define DFU_OUT_EP EP0_OUT
  34. #endif /* USBD_CONF_H */