diff options
| author | Man, Jianting (Meco) <[email protected]> | 2023-02-25 13:52:37 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-25 13:52:37 -0500 |
| commit | 1acef4277b02e5084310ecd7028656ae535178f5 (patch) | |
| tree | 03b6b6f0b3df75a1cef301e1e7b2b3d234213390 /bsp/at32/libraries/rt_drivers/config/f415 | |
| parent | 759192f5f5af23ae360818483d35974ef5b91c78 (diff) | |
| parent | e63e33a3c64327aef3556fa811df0a8ec1e0e7ee (diff) | |
Merge pull request #6981 from RT-Thread/masterserialX-dev
sync from master
Diffstat (limited to 'bsp/at32/libraries/rt_drivers/config/f415')
| -rw-r--r-- | bsp/at32/libraries/rt_drivers/config/f415/usb_config.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/bsp/at32/libraries/rt_drivers/config/f415/usb_config.h b/bsp/at32/libraries/rt_drivers/config/f415/usb_config.h new file mode 100644 index 0000000000..8fedb30599 --- /dev/null +++ b/bsp/at32/libraries/rt_drivers/config/f415/usb_config.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2006-2021, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2023-02-28 leo first version + */ + +#ifndef __USB_CONFIG_H__ +#define __USB_CONFIG_H__ + +#include <rtthread.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined BSP_USING_DEVICE_USBFS1 +#define USE_OTG_DEVICE_MODE +#endif + +#if defined BSP_USING_HOST_USBFS1 +#define USE_OTG_HOST_MODE +#endif + +/* usbfs irqhandler */ +#define OTGFS1_IRQHandler OTGFS1_IRQHandler + +/** + * @brief usb device mode config + */ +#define USB_EPT_MAX_NUM 4 + +/* otg1 device fifo */ +#define USBD_RX_SIZE 128 +#define USBD_EP0_TX_SIZE 24 +#define USBD_EP1_TX_SIZE 20 +#define USBD_EP2_TX_SIZE 20 +#define USBD_EP3_TX_SIZE 20 +#define USBD_EP4_TX_SIZE 20 +#define USBD_EP5_TX_SIZE 20 +#define USBD_EP6_TX_SIZE 20 +#define USBD_EP7_TX_SIZE 20 + +/** + * @brief usb host mode config + */ +#define USB_HOST_CHANNEL_NUM 8 + +/* otg1 host fifo */ +#define USBH_RX_FIFO_SIZE 128 +#define USBH_NP_TX_FIFO_SIZE 96 +#define USBH_P_TX_FIFO_SIZE 96 + +/** + * @brief usb sof output enable + */ +// #define USB_SOF_OUTPUT_ENABLE + +/** + * @brief usb vbus ignore, not use vbus pin + */ +#define USB_VBUS_IGNORE + +/** + * @brief usb low power wakeup handler enable + */ +// #define USB_LOW_POWER_WAKUP + +#if defined(BSP_USING_HOST_USBFS1) +#undef BSP_USING_DEVICE_USBFS1 +#define USBFS1_CONFIG \ + { \ + .name = "usbh", \ + .id = USB_OTG1_ID, \ + .irqn = OTGFS1_IRQn, \ + } +#endif /* BSP_USING_HOST_USBFS1 */ + +#if defined(BSP_USING_DEVICE_USBFS1) +#define USBFS1_CONFIG \ + { \ + .name = "usbd", \ + .id = USB_OTG1_ID, \ + .irqn = OTGFS1_IRQn, \ + } +#endif /* BSP_USING_DEVICE_USBFS1 */ + +#ifdef __cplusplus +} +#endif + +#endif |
