Christian Lerche
/
EA_DoorPlayer
EA BaseBoard, playing wav, PC see\'s SD-card through USB port.
USBMSC.h@0:fef366d2ed20, 2011-11-22 (annotated)
- Committer:
- Lerche
- Date:
- Tue Nov 22 05:45:58 2011 +0000
- Revision:
- 0:fef366d2ed20
Thanks to those who provided EA_WavPlayer and USB_MSC
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Lerche | 0:fef366d2ed20 | 1 | |
Lerche | 0:fef366d2ed20 | 2 | #ifndef USBMSC_H |
Lerche | 0:fef366d2ed20 | 3 | #define USBMSC_H |
Lerche | 0:fef366d2ed20 | 4 | |
Lerche | 0:fef366d2ed20 | 5 | /* These headers are included for child class. */ |
Lerche | 0:fef366d2ed20 | 6 | #include "USBEndpoints.h" |
Lerche | 0:fef366d2ed20 | 7 | #include "USBDescriptor.h" |
Lerche | 0:fef366d2ed20 | 8 | #include "USBDevice_Types.h" |
Lerche | 0:fef366d2ed20 | 9 | |
Lerche | 0:fef366d2ed20 | 10 | #include "USBDevice.h" |
Lerche | 0:fef366d2ed20 | 11 | |
Lerche | 0:fef366d2ed20 | 12 | #define DEFAULT_CONFIGURATION (1) |
Lerche | 0:fef366d2ed20 | 13 | |
Lerche | 0:fef366d2ed20 | 14 | class USBMSC: public USBDevice { |
Lerche | 0:fef366d2ed20 | 15 | public: |
Lerche | 0:fef366d2ed20 | 16 | |
Lerche | 0:fef366d2ed20 | 17 | /** |
Lerche | 0:fef366d2ed20 | 18 | * Constructor |
Lerche | 0:fef366d2ed20 | 19 | * |
Lerche | 0:fef366d2ed20 | 20 | * @param vendor_id Your vendor_id |
Lerche | 0:fef366d2ed20 | 21 | * @param product_id Your product_id |
Lerche | 0:fef366d2ed20 | 22 | * @param product_release Your preoduct_release |
Lerche | 0:fef366d2ed20 | 23 | */ |
Lerche | 0:fef366d2ed20 | 24 | USBMSC(uint16_t vendor_id = 0x1FC9, uint16_t product_id = 0x1002, uint16_t product_release = 0x0100); |
Lerche | 0:fef366d2ed20 | 25 | |
Lerche | 0:fef366d2ed20 | 26 | /* |
Lerche | 0:fef366d2ed20 | 27 | * Get configuration descriptor |
Lerche | 0:fef366d2ed20 | 28 | * |
Lerche | 0:fef366d2ed20 | 29 | * @returns pointer to the configuration descriptor |
Lerche | 0:fef366d2ed20 | 30 | */ |
Lerche | 0:fef366d2ed20 | 31 | virtual uint8_t * configurationDesc(); |
Lerche | 0:fef366d2ed20 | 32 | virtual uint8_t * deviceDesc(); |
Lerche | 0:fef366d2ed20 | 33 | |
Lerche | 0:fef366d2ed20 | 34 | virtual bool USBCallback_setConfiguration(uint8_t configuration); |
Lerche | 0:fef366d2ed20 | 35 | |
Lerche | 0:fef366d2ed20 | 36 | virtual bool USBCallback_request (); |
Lerche | 0:fef366d2ed20 | 37 | |
Lerche | 0:fef366d2ed20 | 38 | void attach(void (*fptr)(uint8_t)); |
Lerche | 0:fef366d2ed20 | 39 | |
Lerche | 0:fef366d2ed20 | 40 | void setTransferData (uint8_t *buf, int len); |
Lerche | 0:fef366d2ed20 | 41 | |
Lerche | 0:fef366d2ed20 | 42 | protected: |
Lerche | 0:fef366d2ed20 | 43 | virtual bool EPBULK_OUT_callback(); |
Lerche | 0:fef366d2ed20 | 44 | virtual bool EPBULK_IN_callback(); |
Lerche | 0:fef366d2ed20 | 45 | |
Lerche | 0:fef366d2ed20 | 46 | private: |
Lerche | 0:fef366d2ed20 | 47 | void (*msc_evt)(uint8_t); |
Lerche | 0:fef366d2ed20 | 48 | |
Lerche | 0:fef366d2ed20 | 49 | }; |
Lerche | 0:fef366d2ed20 | 50 | |
Lerche | 0:fef366d2ed20 | 51 | #endif |