B. H. / Mbed 2 deprecated trolololol

Dependencies:   mbed

Revision:
0:505207de8566
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice/USBMIDI/.svn/text-base/USB_MIDI.h.svn-base	Tue Nov 29 21:26:20 2011 +0000
@@ -0,0 +1,77 @@
+/* USB_MIDI.h */
+/* MIDI device example */
+/* Copyright (c) 2011 ARM Limited. All rights reserved. */
+
+#ifndef USB_MIDI_H
+#define USB_MIDI_H
+
+/* These headers are included for child class. */
+#include "USBEndpoints.h"
+#include "USBDescriptor.h"
+#include "USBDevice_Types.h"
+
+#include "USBDevice.h"
+#include "MIDIMessage.h"
+
+#define DEFAULT_CONFIGURATION (1)
+
+
+class USB_MIDI: public USBDevice {
+public:
+
+    /**
+    * Constructor
+    *
+    * @param vendor_id Your vendor_id
+    * @param product_id Your product_id
+    * @param product_release Your preoduct_release
+    */
+    USB_MIDI(uint16_t vendor_id = 0x0768, uint16_t product_id = 0x0100, uint16_t product_release = 0x0001);
+
+    virtual bool USBCallback_setConfiguration(uint8_t configuration);
+    
+    /**
+    * Get string product descriptor
+    *
+    * @returns pointer to the string product descriptor
+    */
+    virtual uint8_t * stringIproductDesc();
+    
+    /**
+    * Get string interface descriptor
+    *
+    * @returns pointer to the string interface descriptor
+    */
+    virtual uint8_t * stringIinterfaceDesc();
+    
+    /**
+    * Get configuration descriptor
+    *
+    * @returns pointer to the configuration descriptor
+    */
+    virtual uint8_t * configurationDesc();
+    
+    /**
+     * Send a MIDIMessage
+     *
+     * @param m The MIDIMessage to send
+     */    
+    void write(MIDIMessage m);
+
+    /**
+     * Attach a callback for when a MIDIEvent is received
+     *
+     * @param fptr function pointer
+     */
+    void attach(void (*fptr)(MIDIMessage));
+    
+protected:
+    virtual bool EPBULK_OUT_callback();
+
+private:
+    void (*midi_evt)(MIDIMessage);
+
+};
+
+#endif
+