OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [CORTEX_LPC1768_IAR/] [LPCUSB/] [usbhw_lpc.h] - Blame information for rev 763

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 581 jeremybenn
/*
2
        LPCUSB, an USB device driver for LPC microcontrollers
3
        Copyright (C) 2006 Bertrik Sikken (bertrik@sikken.nl)
4
 
5
        Redistribution and use in source and binary forms, with or without
6
        modification, are permitted provided that the following conditions are met:
7
 
8
        1. Redistributions of source code must retain the above copyright
9
           notice, this list of conditions and the following disclaimer.
10
        2. Redistributions in binary form must reproduce the above copyright
11
           notice, this list of conditions and the following disclaimer in the
12
           documentation and/or other materials provided with the distribution.
13
        3. The name of the author may not be used to endorse or promote products
14
           derived from this software without specific prior written permission.
15
 
16
        THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17
        IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18
        OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19
        IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20
        INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21
        NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22
        DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23
        THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
        (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25
        THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
 
28
 
29
/**
30
        Hardware definitions for the LPC176x USB controller
31
 
32
        These are private to the usbhw module
33
*/
34
 
35
// CodeRed - pull in defines from NXP header file
36
//#include "NXP\LPC17xx\LPC17xx.h"
37
#include "LPC17xx.h"
38
 
39
 
40
// CodeRed - these registers have been renamed on LPC176x
41
#define USBReEP USBReEp
42
#define OTG_CLK_CTRL USBClkCtrl
43
#define OTG_CLK_STAT USBClkSt
44
 
45
/* USBIntSt bits */
46
#define USB_INT_REQ_LP                          (1<<0)
47
#define USB_INT_REQ_HP                          (1<<1)
48
#define USB_INT_REQ_DMA                         (1<<2)
49
#define USB_need_clock                          (1<<8)
50
#define EN_USB_BITS                                     (1<<31)
51
 
52
/* USBDevInt... bits */
53
#define FRAME                                           (1<<0)
54
#define EP_FAST                                         (1<<1)
55
#define EP_SLOW                                         (1<<2)
56
#define DEV_STAT                                        (1<<3)
57
#define CCEMTY                                          (1<<4)
58
#define CDFULL                                          (1<<5)
59
#define RxENDPKT                                        (1<<6)
60
#define TxENDPKT                                        (1<<7)
61
#define EP_RLZED                                        (1<<8)
62
#define ERR_INT                                         (1<<9)
63
 
64
/* USBRxPLen bits */
65
#define PKT_LNGTH                                       (1<<0)
66
#define PKT_LNGTH_MASK                          0x3FF
67
#define DV                                                      (1<<10)
68
#define PKT_RDY                                         (1<<11)
69
 
70
/* USBCtrl bits */
71
#define RD_EN                                           (1<<0)
72
#define WR_EN                                           (1<<1)
73
#define LOG_ENDPOINT                            (1<<2)
74
 
75
/* protocol engine command codes */
76
        /* device commands */
77
#define CMD_DEV_SET_ADDRESS                     0xD0
78
#define CMD_DEV_CONFIG                          0xD8
79
#define CMD_DEV_SET_MODE                        0xF3
80
#define CMD_DEV_READ_CUR_FRAME_NR       0xF5
81
#define CMD_DEV_READ_TEST_REG           0xFD
82
#define CMD_DEV_STATUS                          0xFE            /* read/write */
83
#define CMD_DEV_GET_ERROR_CODE          0xFF
84
#define CMD_DEV_READ_ERROR_STATUS       0xFB
85
        /* endpoint commands */
86
#define CMD_EP_SELECT                           0x00
87
#define CMD_EP_SELECT_CLEAR                     0x40
88
#define CMD_EP_SET_STATUS                       0x40
89
#define CMD_EP_CLEAR_BUFFER                     0xF2
90
#define CMD_EP_VALIDATE_BUFFER          0xFA
91
 
92
/* set address command */
93
#define DEV_ADDR                                        (1<<0)
94
#define DEV_EN                                          (1<<7)
95
 
96
/* configure device command */
97
#define CONF_DEVICE                                     (1<<0)
98
 
99
/* set mode command */
100
#define AP_CLK                                          (1<<0)
101
#define INAK_CI                                         (1<<1)
102
#define INAK_CO                                         (1<<2)
103
#define INAK_II                                         (1<<3)
104
#define INAK_IO                                         (1<<4)
105
#define INAK_BI                                         (1<<5)
106
#define INAK_BO                                         (1<<6)
107
 
108
/* set get device status command */
109
#define CON                                                     (1<<0)
110
#define CON_CH                                          (1<<1)
111
#define SUS                                                     (1<<2)
112
#define SUS_CH                                          (1<<3)
113
#define RST                                                     (1<<4)
114
 
115
/* get error code command */
116
// ...
117
 
118
/* Select Endpoint command read bits */
119
#define EPSTAT_FE                                       (1<<0)
120
#define EPSTAT_ST                                       (1<<1)
121
#define EPSTAT_STP                                      (1<<2)
122
#define EPSTAT_PO                                       (1<<3)
123
#define EPSTAT_EPN                                      (1<<4)
124
#define EPSTAT_B1FULL                           (1<<5)
125
#define EPSTAT_B2FULL                           (1<<6)
126
 
127
/* CMD_EP_SET_STATUS command */
128
#define EP_ST                                           (1<<0)
129
#define EP_DA                                           (1<<5)
130
#define EP_RF_MO                                        (1<<6)
131
#define EP_CND_ST                                       (1<<7)
132
 
133
/* read error status command */
134
#define PID_ERR                                         (1<<0)
135
#define UEPKT                                           (1<<1)
136
#define DCRC                                            (1<<2)
137
#define TIMEOUT                                         (1<<3)
138
#define EOP                                                     (1<<4)
139
#define B_OVRN                                          (1<<5)
140
#define BTSTF                                           (1<<6)
141
#define TGL_ERR                                         (1<<7)
142
 
143
 
144
 
145
 
146
 
147
 
148
 
149
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.