Junichi Katsu / Mbed 2 deprecated UsbTouch

Dependencies:   mbed

Committer:
jksoft
Date:
Fri Jun 10 09:01:25 2011 +0000
Revision:
0:4c75a597cb26

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:4c75a597cb26 1 /* usbdc.h */
jksoft 0:4c75a597cb26 2 /* USB device controller */
jksoft 0:4c75a597cb26 3 /* Copyright (c) Phil Wright 2008 */
jksoft 0:4c75a597cb26 4
jksoft 0:4c75a597cb26 5 #ifndef USBDC_H
jksoft 0:4c75a597cb26 6 #define USBDC_H
jksoft 0:4c75a597cb26 7
jksoft 0:4c75a597cb26 8 /* Endpoints */
jksoft 0:4c75a597cb26 9 #define EP0OUT (0) /* Control */
jksoft 0:4c75a597cb26 10 #define EP0IN (1) /* Control */
jksoft 0:4c75a597cb26 11 #define EP1OUT (2) /* Interrupt */
jksoft 0:4c75a597cb26 12 #define EP1IN (3) /* Interrupt */
jksoft 0:4c75a597cb26 13 #define EP2OUT (4) /* Bulk */
jksoft 0:4c75a597cb26 14 #define EP2IN (5) /* Bulk */
jksoft 0:4c75a597cb26 15
jksoft 0:4c75a597cb26 16 #include "mbed.h"
jksoft 0:4c75a597cb26 17
jksoft 0:4c75a597cb26 18 class usbdc : public Base
jksoft 0:4c75a597cb26 19 {
jksoft 0:4c75a597cb26 20 public:
jksoft 0:4c75a597cb26 21 usbdc();
jksoft 0:4c75a597cb26 22 void connect(void);
jksoft 0:4c75a597cb26 23 void disconnect(void);
jksoft 0:4c75a597cb26 24 protected:
jksoft 0:4c75a597cb26 25 void setAddress(unsigned char address);
jksoft 0:4c75a597cb26 26 void realiseEndpoint(unsigned char endpoint, unsigned long maxPacket);
jksoft 0:4c75a597cb26 27 void enableEndpointEvent(unsigned char endpoint);
jksoft 0:4c75a597cb26 28 void disableEndpointEvent(unsigned char endpoint);
jksoft 0:4c75a597cb26 29 void stallEndpoint(unsigned char endpoint);
jksoft 0:4c75a597cb26 30 void unstallEndpoint(unsigned char endpoint);
jksoft 0:4c75a597cb26 31 bool getEndpointStallState(unsigned char endpoint);
jksoft 0:4c75a597cb26 32 void configureDevice(void);
jksoft 0:4c75a597cb26 33 void unconfigureDevice(void);
jksoft 0:4c75a597cb26 34 unsigned long endpointRead(unsigned char endpoint, unsigned char *buffer);
jksoft 0:4c75a597cb26 35 void endpointWrite(unsigned char endpoint, unsigned char *buffer, unsigned long size);
jksoft 0:4c75a597cb26 36 void enableEvents(void);
jksoft 0:4c75a597cb26 37 void disableEvents(void);
jksoft 0:4c75a597cb26 38 virtual void deviceEventReset(void);
jksoft 0:4c75a597cb26 39 virtual void deviceEventFrame(void);
jksoft 0:4c75a597cb26 40 virtual void endpointEventEP0Setup(void);
jksoft 0:4c75a597cb26 41 virtual void endpointEventEP0In(void);
jksoft 0:4c75a597cb26 42 virtual void endpointEventEP0Out(void);
jksoft 0:4c75a597cb26 43 virtual void endpointEventEP1In(void);
jksoft 0:4c75a597cb26 44 virtual void endpointEventEP1Out(void);
jksoft 0:4c75a597cb26 45 virtual void endpointEventEP2In(void);
jksoft 0:4c75a597cb26 46 virtual void endpointEventEP2Out(void);
jksoft 0:4c75a597cb26 47 private:
jksoft 0:4c75a597cb26 48 void SIECommand(unsigned long command);
jksoft 0:4c75a597cb26 49 void SIEWriteData(unsigned char data);
jksoft 0:4c75a597cb26 50 unsigned char SIEReadData(unsigned long command);
jksoft 0:4c75a597cb26 51 void setDeviceStatus(unsigned char status);
jksoft 0:4c75a597cb26 52 void setEndpointStatus(unsigned char endpoint, unsigned char status);
jksoft 0:4c75a597cb26 53 unsigned char getDeviceStatus(void);
jksoft 0:4c75a597cb26 54 unsigned char selectEndpoint(unsigned char endpoint);
jksoft 0:4c75a597cb26 55 unsigned char selectEndpointClearInterrupt(unsigned char endpoint);
jksoft 0:4c75a597cb26 56 unsigned char clearBuffer(void);
jksoft 0:4c75a597cb26 57 void validateBuffer(void);
jksoft 0:4c75a597cb26 58 void usbisr(void);
jksoft 0:4c75a597cb26 59 unsigned long endpointStallState;
jksoft 0:4c75a597cb26 60 static void _usbisr(void);
jksoft 0:4c75a597cb26 61 static usbdc *instance;
jksoft 0:4c75a597cb26 62 };
jksoft 0:4c75a597cb26 63
jksoft 0:4c75a597cb26 64
jksoft 0:4c75a597cb26 65 #endif