M471M/R1/S BSP
V3.01.000
The Board Support Package for M4521
UsbHostLib
inc
config.h
Go to the documentation of this file.
1
/**************************************************************************/
9
#ifndef _USBH_CONFIG_H_
10
#define _USBH_CONFIG_H_
11
13
14
/*----------------------------------------------------------------------------------------*/
15
/* Hardware settings */
16
/*----------------------------------------------------------------------------------------*/
17
#define HCLK_MHZ 192
/* used for loop-delay. must be larger than
18
true HCLK clock MHz */
19
20
#define ENABLE_OHCI_IRQ() NVIC_EnableIRQ(USBH_IRQn)
21
#define DISABLE_OHCI_IRQ() NVIC_DisableIRQ(USBH_IRQn)
22
23
#define ENABLE_OHCI
/* Enable OHCI host controller */
24
25
#define OHCI_ISO_DELAY 4
/* preserved number frames while scheduling
26
OHCI isochronous transfer */
27
28
#define MAX_DESC_BUFF_SIZE 512
/* To hold the configuration descriptor, USB
29
core will allocate a buffer with this size
30
for each connected device. USB core does
31
not release it until device disconnected. */
32
33
/*----------------------------------------------------------------------------------------*/
34
/* Memory allocation settings */
35
/*----------------------------------------------------------------------------------------*/
36
37
#define STATIC_MEMORY_ALLOC 0
/* pre-allocate static memory blocks. No dynamic memory aloocation.
38
But the maximum number of connected devices and transfers are
39
limited. */
40
41
#define MAX_UDEV_DRIVER 8
42
#define MAX_ALT_PER_IFACE 8
43
#define MAX_EP_PER_IFACE 6
44
#define MAX_HUB_DEVICE 8
46
/* Host controller hardware transfer descriptors memory pool. ED/TD/ITD of OHCI and QH/QTD of EHCI
47
are all allocated from this pool. Allocated unit size is determined by MEM_POOL_UNIT_SIZE.
48
May allocate one or more units depend on hardware descriptor type. */
49
50
#define MEM_POOL_UNIT_SIZE 64
51
#define MEM_POOL_UNIT_NUM 64
53
/*----------------------------------------------------------------------------------------*/
54
/* Re-defined staff for various compiler */
55
/*----------------------------------------------------------------------------------------*/
56
#ifdef __ICCARM__
57
#define __inline inline
58
#endif
59
60
61
/*----------------------------------------------------------------------------------------*/
62
/* Debug settings */
63
/*----------------------------------------------------------------------------------------*/
64
#define ENABLE_ERROR_MSG
/* enable debug messages */
65
#define ENABLE_DEBUG_MSG
/* enable debug messages */
66
//#define ENABLE_VERBOSE_DEBUG /* verbos debug messages */
67
//#define DUMP_DESCRIPTOR /* dump descriptors */
68
69
#ifdef ENABLE_ERROR_MSG
70
#define USB_error printf
71
#else
72
#define USB_error(...)
73
#endif
74
75
#ifdef ENABLE_DEBUG_MSG
76
#define USB_debug printf
77
#ifdef ENABLE_VERBOSE_DEBUG
78
#define USB_vdebug printf
79
#else
80
#define USB_vdebug(...)
81
#endif
82
#else
83
#define USB_debug(...)
84
#define USB_vdebug(...)
85
#endif
86
87
89
90
#endif
/* _USBH_CONFIG_H_ */
91
92
/*** (C) COPYRIGHT 2020 Nuvoton Technology Corp. ***/
93
Generated on Wed Feb 15 2023 14:24:15 for M471M/R1/S BSP by
1.9.3