Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals  

usbprivatetypes.h

00001 
00042 #ifndef usbprivatetypes_H
00043 #define usbprivatetypes_H
00044 
00045 #include "usbbasictypes.h"
00046 #include "usbconstants.h"
00047 #include "usbprivateconstants.h"
00048 #include "usbdeviceparam.h"
00049 
00050 typedef struct /* USBDeviceCounters */
00051 {
00052     UINT32 frames;   /* number of processed USB frames */
00053 
00054     UINT32 irqCount; /* number of serviced IRQs */
00055 
00056     UINT32 Rx;       /* received packets */
00057     UINT32 Tx;       /* transmitted packets */
00058     UINT32 DRx;      /* dropped received packets */
00059     UINT32 DTx;      /* dropped transmitted packets */
00060 
00061     UINT32 bytesRx;  /* transmitted bytes */
00062     UINT32 bytesTx;  /* received bytes */
00063 
00064     UINT32 setup;    /* number of serviced SETUP transactions */
00065 } USBDeviceCounters;
00066 
00067 typedef struct /* USBEndpointCounters */
00068 {
00069     UINT32 Rx;  /* number of received packets */
00070     UINT32 Tx;  /* number of transmitted packets */
00071     UINT32 DRx; /* number of dropped received packets */
00072     UINT32 DTx; /* number of dropped transmitted packets */
00073 
00074     UINT32 fifoUnderruns; /* FIFO underruns */
00075     UINT32 fifoOverflows; /* FIFO overflows */
00076 
00077     UINT32 bytesRx; /* bytes received */
00078     UINT32 bytesTx; /* bytes transmitted */
00079 
00080     UINT32 irqCount; /* number of serviced IRQs for endpoint */
00081 } USBEndpointCounters;
00082 
00083 typedef struct /* USBDataQueue */
00084 {
00085     IX_USB_MBLK *base[MAX_QUEUE_SIZE];
00086     UINT32 head; /* offset in elements from base */
00087     UINT32 len;  /* length in elements */
00088 } USBDataQueue;
00089 
00090 typedef struct /* EPStatusData */
00091 {
00092     USBDevice *device;                  /* Parent device */
00093    
00094     USBEndpointNumber endpointNumber;   /* Endpoint number */
00095 
00096     USBEndpointDirection direction;     /* Endpoint direction */
00097 
00098     USBEndpointType type;               /* Endpoint type */
00099 
00100     UINT32 fifoSize;                    /* FIFO depth */
00101 
00102 #ifdef IX_USB_DMA
00103 
00104     BOOL dmaEnabled;                    /* DMA enabled for this endpoint? */
00105    
00106     UINT32 dmaSize;                     /* DMA buffer depth */
00107 
00108 #endif /* IX_USB_DMA */
00109     
00110     IX_USB_MBLK *currentBuffer;         /* Current send or receive buffer */
00111   
00112     UINT32 currentOffset;               /* Current fill offset in buffer */
00113     
00114     UINT32 currentTransferSize;         /* Current transfer chunk size (packet, DMA buffer or less) */
00115 
00116     BOOL transferAllowed;               /* FIFO semaphore */
00117 
00118 #ifdef IX_USB_HAS_TIMESTAMP_CHECKS
00119 
00120     UINT32 lastTimestamp;               /* Last sent/received packet timestamp */
00121 
00122 #endif /* IX_USB_HAS_TIMESTAMP_CHECKS */
00123 
00124     USBDataQueue queue;                 /* Data queue for endpoint */
00125   
00126     USBEndpointCounters counters;       /* Endpoint counters */
00127 
00128     volatile UINT32 *UDCCS;             /* control/status register */
00129     volatile UINT32 *UDDR;              /* data register */
00130     volatile UINT32 *UBCR;              /* FIFO byte-count register */
00131 } EPStatusData;
00132 
00133 typedef struct /* EP0ControlData */
00134 {
00135     USBToken currentToken;                  /* Last received token type */
00136     
00137     EP0State state;                         /* Endpoint 0 state machine */
00138     
00139     USBControlTransfer transferType;        /* Current transfer type */
00140     
00141     char setupBuffer[SETUP_PACKET_SIZE];    /* 8-byte buffer for SETUP packets */
00142     
00143     UINT16 expected, transferred;           /* Expected and actual transfer length */
00144 } EP0ControlData;
00145 
00146 typedef struct /* USBEventProcessor */
00147 {
00148     USBEventCallback eventCallback;     /* Reset, suspend, resume callback */
00149     
00150     USBEventMap eventMap;               /* Event map */
00151     
00152     USBSetupCallback setupCallback;     /* SETUP packet receive function */
00153     
00154     USBReceiveCallback receiveCallback; /* Data receive function */
00155 } USBEventProcessor;
00156 
00157 /*  UDC Registers */
00158 typedef struct  /* UDCRegisters */
00159 {
00160     volatile UINT32 UDCCR;
00161     volatile UINT32 RESERVED[3];
00162     volatile UINT32 UDCCS0;
00163     volatile UINT32 UDCCS1;
00164     volatile UINT32 UDCCS2;
00165     volatile UINT32 UDCCS3;
00166     volatile UINT32 UDCCS4;
00167     volatile UINT32 UDCCS5;
00168     volatile UINT32 UDCCS6;
00169     volatile UINT32 UDCCS7;
00170     volatile UINT32 UDCCS8;
00171     volatile UINT32 UDCCS9;
00172     volatile UINT32 UDCCS10;
00173     volatile UINT32 UDCCS11;
00174     volatile UINT32 UDCCS12;
00175     volatile UINT32 UDCCS13;
00176     volatile UINT32 UDCCS14;
00177     volatile UINT32 UDCCS15;
00178     volatile UINT32 UICR0;
00179     volatile UINT32 UICR1;
00180     volatile UINT32 USIR0;
00181     volatile UINT32 USIR1;
00182     volatile UINT32 UFNHR;
00183     volatile UINT32 UFNLR;
00184     volatile UINT32 UBCR2;
00185     volatile UINT32 UBCR4;
00186     volatile UINT32 UBCR7;
00187     volatile UINT32 UBCR9;
00188     volatile UINT32 UBCR12;
00189     volatile UINT32 UBCR14;
00190     volatile UINT32 UDDR0;          
00191     volatile UINT32 RESERVED0[7];
00192     volatile UINT32 UDDR5;          
00193     volatile UINT32 RESERVED5[7];
00194     volatile UINT32 UDDR10;         
00195     volatile UINT32 RESERVED10[7];  
00196     volatile UINT32 UDDR15;         
00197     volatile UINT32 RESERVED15[7];
00198     volatile UINT32 UDDR1;          
00199     volatile UINT32 RESERVED1[31];  
00200     volatile UINT32 UDDR2;          
00201     volatile UINT32 RESERVED2[31];  
00202     volatile UINT32 UDDR3;          
00203     volatile UINT32 RESERVED3[127]; 
00204     volatile UINT32 UDDR4;          
00205     volatile UINT32 RESERVED4[127]; 
00206     volatile UINT32 UDDR6;          
00207     volatile UINT32 RESERVED6[31];  
00208     volatile UINT32 UDDR7;          
00209     volatile UINT32 RESERVED7[31];  
00210     volatile UINT32 UDDR8;          
00211     volatile UINT32 RESERVED8[127]; 
00212     volatile UINT32 UDDR9;          
00213     volatile UINT32 RESERVED9[127]; 
00214     volatile UINT32 UDDR11;         
00215     volatile UINT32 RESERVED11[31]; 
00216     volatile UINT32 UDDR12;         
00217     volatile UINT32 RESERVED12[31]; 
00218     volatile UINT32 UDDR13;         
00219     volatile UINT32 RESERVED13[127];
00220     volatile UINT32 UDDR14;         
00221 } UDCRegisters;
00222 
00223 typedef struct /* USBDeviceContext */
00224 {
00225     UINT32 checkPattern;                      /* Check pattern for verifying the context */
00226 
00227     USBDevice *device;                        /* Reference to parent USBDevice structure */
00228     
00229     UDCRegisters *registers;                  /* Device registers */
00230     
00231     EP0ControlData ep0ControlData;            /* Endpoint 0 control data */
00232     
00233     EPStatusData epStatusData[NUM_ENDPOINTS]; /* Endpoint data array */
00234     
00235     USBEventProcessor eventProcessor;         /* Event callbacks and masks */
00236 
00237     USBDeviceCounters counters;               /* Global (device) counters */
00238 
00239     BOOL enabled;                             /* Enabled/disabled indicator */
00240 } USBDeviceContext;
00241 
00242 #endif /* usbprivatetypes_H */
Automatically generated from sources. © Intel Corp. 2003