USBMSD SD card Hello World for Mbed platforms

Dependencies:   mbed USBMSD_SD USBDevice

Revision:
10:cf8fd2b6ca23
Parent:
9:9c343b9ee6d8
Child:
11:a26e7b7a1221
--- a/USBMSD/USBMSD.h	Tue Nov 15 09:16:25 2011 +0000
+++ b/USBMSD/USBMSD.h	Wed Nov 16 11:06:27 2011 +0000
@@ -16,6 +16,7 @@
 #include "USBDevice_Types.h"
 
 #include "USBDevice.h"
+#include "USBHID.h"
 
 #define DEFAULT_CONFIGURATION (1)
 
@@ -59,7 +60,31 @@
     * @param product_id Your product_id
     * @param product_release Your preoduct_release
     */
-    USBMSD(uint16_t vendor_id = 0x0703, uint16_t product_id = 0x0104, uint16_t product_release = 0x0001);
+    USBMSD(uint16_t vendor_id = 0x0843, uint16_t product_id = 0x0154, uint16_t product_release = 0x0001);
+    
+    /**
+    * Send a Report
+    *
+    * @param report Report which will be sent (a report is defined by all data and the length)
+    * @returns true if successful
+    */
+    bool send(HID_REPORT *report);
+    
+    /**
+    * Read a report: blocking
+    *
+    * @param report pointer to the report to fill
+    * @returns true if successful
+    */
+    bool read(HID_REPORT * report);
+    
+    /**
+    * Read a report: non blocking
+    *
+    * @param report pointer to the report to fill
+    * @returns true if successful
+    */
+    bool readNB(HID_REPORT * report);
     
     /*
     * read a block on a storage chip
@@ -99,6 +124,20 @@
     virtual uint32_t memorySize(){return 0;};
     
     /*
+    * Get the Report descriptor
+    *
+    * @returns pointer to the report descriptor
+    */
+    virtual uint8_t * reportDesc();
+
+    /*
+    * Get the length of the report descriptor
+    *
+    * @returns the length of the report descriptor
+    */
+    virtual uint16_t reportDescLength();
+    
+    /*
     * Connect the USB MSD device. Establish disk initialization before really connect the device.
     *
     * @returns
@@ -107,6 +146,7 @@
     
     
 protected:
+    uint16_t reportLength;
 
 
     /*
@@ -199,6 +239,8 @@
     void memoryWrite (uint8_t * buf, uint16_t size);
     void reset();
     void fail();
+    
+    HID_REPORT outputReport;
 };
 
 #endif