m3dev

cortex m3 debug tools -- superceded by mdebug
git clone http://frotz.net/git/m3dev.git
Log | Files | Refs | README | LICENSE

usb-v1.h (1750B)


      1 #ifndef __ARCH_LPC13XX_USB_V1_H
      2 #define __ARCH_LPC13XX_USB_V1_H
      3 
      4 #define USB_INT_STATUS		0x40020000
      5 #define USB_INT_ENABLE		0x40020004
      6 #define USB_INT_CLEAR		0x40020008
      7 #define USB_INT_SET		0x4002000C
      8 #define USB_CMD_CODE		0x40020010
      9 #define USB_CMD_DATA		0x40020014
     10 #define USB_RX_DATA		0x40020018
     11 #define USB_TX_DATA		0x4002001C
     12 #define USB_RX_PLEN		0x40020020
     13 #define USB_TX_PLEN		0x40020024
     14 #define USB_CTRL		0x40020028
     15 #define USB_FIQ_SELECT		0x4002002C
     16 
     17 #define USB_INT_FRAME		(1 << 0)
     18 #define USB_INT_EP0		(1 << 1)
     19 #define USB_INT_EP1		(1 << 2)
     20 #define USB_INT_EP2		(1 << 3)
     21 #define USB_INT_EP3		(1 << 4)
     22 #define USB_INT_EP4		(1 << 5)
     23 #define USB_INT_EP5		(1 << 6)
     24 #define USB_INT_EP6		(1 << 7)
     25 #define USB_INT_EP7		(1 << 8)
     26 #define USB_INT_DEV_STAT	(1 << 9) /* RESET, SUSPEND, CONNECT */
     27 #define USB_INT_CC_EMPTY	(1 << 10) /* can write CMD_CODE */
     28 #define USB_INT_CD_FULL		(1 << 11) /* can read CMD_DATA */
     29 #define USB_INT_RX_END		(1 << 12)
     30 #define USB_INT_TX_END		(1 << 13)
     31 
     32 #define USB_CTRL_RD_EN		(1 << 0)
     33 #define USB_CTRL_WR_EN		(1 << 1)
     34 #define USB_CTRL_EP_NUM(n)	(((n) & 0xF) << 2)
     35 
     36 #define USB_OP_WRITE		0x0100
     37 #define USB_OP_READ		0x0200
     38 #define USB_OP_COMMAND		0x0500
     39 
     40 #define USB_CC_SET_ADDR		0xD00000
     41 #define USB_CC_CONFIG_DEV	0xD80000
     42 #define USB_CC_SET_MODE		0xF30000
     43 #define USB_CC_RD_INT_STATUS	0xF40000
     44 #define USB_CC_RD_FRAME_NUM	0xF50000
     45 #define USB_CC_RD_CHIP_ID	0xFD0000
     46 #define USB_CC_SET_DEV_STATUS	0xFE0000
     47 #define USB_CC_GET_DEV_STATUS	0xFE0000
     48 #define USB_CC_GET_ERROR_CODE	0xFF0000
     49 #define USB_CC_SEL_EPT(n)	(((n) & 0xF) << 16)
     50 #define USB_CC_CLR_EPT(n)	((((n) & 0xF) | 0x40) << 16)
     51 #define USB_CC_SET_EPT(n)	((((n) & 0xF) | 0x40) << 16)
     52 #define USB_CC_CLR_BUFFER	0xF20000
     53 #define USB_CC_VAL_BUFFER	0xFA0000
     54 
     55 #endif