Dependencies:   mbed

Committer:
okini3939
Date:
Tue Nov 08 15:46:25 2011 +0000
Revision:
0:d644bf01b0cb
Child:
1:e5b352a3e0a9

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
okini3939 0:d644bf01b0cb 1
okini3939 0:d644bf01b0cb 2 #ifndef USBCDC_H
okini3939 0:d644bf01b0cb 3 #define USBCDC_H
okini3939 0:d644bf01b0cb 4
okini3939 0:d644bf01b0cb 5 /* These headers are included for child class. */
okini3939 0:d644bf01b0cb 6 #include "USBEndpoints.h"
okini3939 0:d644bf01b0cb 7 #include "USBDescriptor.h"
okini3939 0:d644bf01b0cb 8 #include "USBDevice_Types.h"
okini3939 0:d644bf01b0cb 9
okini3939 0:d644bf01b0cb 10 #include "USBDevice.h"
okini3939 0:d644bf01b0cb 11
okini3939 0:d644bf01b0cb 12 #define DEFAULT_CONFIGURATION (1)
okini3939 0:d644bf01b0cb 13
okini3939 0:d644bf01b0cb 14 class USBCDC: public USBDevice {
okini3939 0:d644bf01b0cb 15 public:
okini3939 0:d644bf01b0cb 16
okini3939 0:d644bf01b0cb 17 /**
okini3939 0:d644bf01b0cb 18 * Constructor
okini3939 0:d644bf01b0cb 19 *
okini3939 0:d644bf01b0cb 20 * @param vendor_id Your vendor_id
okini3939 0:d644bf01b0cb 21 * @param product_id Your product_id
okini3939 0:d644bf01b0cb 22 * @param product_release Your preoduct_release
okini3939 0:d644bf01b0cb 23 */
okini3939 0:d644bf01b0cb 24 USBCDC(uint16_t vendor_id = 0xFFFF, uint16_t product_id = 0x0005, uint16_t product_release = 0x0100);
okini3939 0:d644bf01b0cb 25
okini3939 0:d644bf01b0cb 26 /*
okini3939 0:d644bf01b0cb 27 * Get string product descriptor
okini3939 0:d644bf01b0cb 28 *
okini3939 0:d644bf01b0cb 29 * @returns pointer to the string product descriptor
okini3939 0:d644bf01b0cb 30 */
okini3939 0:d644bf01b0cb 31 virtual uint8_t * stringIproductDesc();
okini3939 0:d644bf01b0cb 32
okini3939 0:d644bf01b0cb 33 /*
okini3939 0:d644bf01b0cb 34 * Get string interface descriptor
okini3939 0:d644bf01b0cb 35 *
okini3939 0:d644bf01b0cb 36 * @returns pointer to the string interface descriptor
okini3939 0:d644bf01b0cb 37 */
okini3939 0:d644bf01b0cb 38 virtual uint8_t * stringIinterfaceDesc();
okini3939 0:d644bf01b0cb 39
okini3939 0:d644bf01b0cb 40 /*
okini3939 0:d644bf01b0cb 41 * Get configuration descriptor
okini3939 0:d644bf01b0cb 42 *
okini3939 0:d644bf01b0cb 43 * @returns pointer to the configuration descriptor
okini3939 0:d644bf01b0cb 44 */
okini3939 0:d644bf01b0cb 45 virtual uint8_t * configurationDesc();
okini3939 0:d644bf01b0cb 46
okini3939 0:d644bf01b0cb 47 virtual bool USBCallback_setConfiguration(uint8_t configuration);
okini3939 0:d644bf01b0cb 48
okini3939 0:d644bf01b0cb 49 virtual bool USBCallback_request ();
okini3939 0:d644bf01b0cb 50
okini3939 0:d644bf01b0cb 51 void attach(void (*fptr)(char*, int));
okini3939 0:d644bf01b0cb 52
okini3939 0:d644bf01b0cb 53 protected:
okini3939 0:d644bf01b0cb 54 virtual bool EPBULK_OUT_callback();
okini3939 0:d644bf01b0cb 55
okini3939 0:d644bf01b0cb 56 private:
okini3939 0:d644bf01b0cb 57 void (*cdc_evt)(char*, int);
okini3939 0:d644bf01b0cb 58
okini3939 0:d644bf01b0cb 59 };
okini3939 0:d644bf01b0cb 60
okini3939 0:d644bf01b0cb 61 #endif