M4521_BSP V3.02.000
The Board Support Package for M4521
usbh_config.h
Go to the documentation of this file.
1/**************************************************************************/
12#ifndef _USB_CONFIG_H_
13#define _USB_CONFIG_H_
14
15
16#ifdef __ICCARM__
17#define __inline inline
18#endif
19
20
21/*
22 * Debug messages...
23 */
24//#define USB_DEBUG /*!< Enable debug message */
25//#define USB_VERBOSE_DEBUG
26//#define DUMP_DEV_DESCRIPTORS
27
28
29/*
30 * Static Memory Settings...
31 */
32#define DEV_MAX_NUM 8
33#define URB_MAX_NUM 12
34#define ED_MAX_NUM 12
35#define TD_MAX_NUM 32
37#define MAX_ENDPOINTS 16
38#define MAX_DRIVER_PER_DEV 3
39#define MAX_TD_PER_OHCI_URB 8
40#define MAX_HUB_DEVICE 2
43#define ISO_FRAME_COUNT 4
44#define OHCI_ISO_DELAY 8
46/*
47 * Class driver support...
48 */
49#define SUPPORT_HUB_CLASS
53
54/*
55 * Debug/Warning/Information to be printed on console or not
56 */
57#define USB_error printf
58#ifdef USB_DEBUG
59#define USB_debug printf
60#else
61#define USB_debug(...)
62#endif
63
64#ifdef USB_VERBOSE_DEBUG
65#define USB_warning printf
66#define USB_info printf
67#else
68#define USB_warning(...)
69#define USB_info(...)
70#endif
71
72#define DISABLE_USB_INT() NVIC_DisableIRQ(USBH_IRQn);
73#define ENABLE_USB_INT() NVIC_EnableIRQ(USBH_IRQn);
74
75
76/*
77 * I/O
78 */
79#define SUPPORT_HUB_CLASS
80#define OHCI_BASE_ADDR 0x40009000
81
82#define readl(addr) (*(volatile uint32_t *)(addr))
83#define writel(x,addr) ((*(volatile uint32_t *)(addr)) = (volatile uint32_t)x)
84
85//#define inpw(addr) (*(volatile uint32_t *)(addr))
86
87#define USB_JIFFY (OHCI->FMNUM & 0xffff)
88
89
90/*--- CPU clock speed ---*/
91#define HZ (72)
92
93#define USB_SWAP16(x) (((x>>8)&0xff)|((x&0xff)<<8))
94#define USB_SWAP32(x) (((x>>24)&0xff)|((x>>8)&0xff00)|((x&0xff00)<<8)|((x&0xff)<<24))
95
97
98#endif /* _USB_CONFIG_H_ */
99
100