This is early stages of my project, the idea of this project is to be able to mix a guitar with windows sounds in reverse such as instrumental background music or trance music perhaps or maybe another fellow guitarist you may have downloaded from the internet. Microphone or guitar pin is p19 I would use a microphone for drums:) and that it for the moment, the code makes the mbed act as usb speaker that excepts a guitar or microphone input, but with a twist it all in reverse like a guitar reverse effects pedal but only you can mix anything you can get from the internet or any windows sound.

Dependencies:   mbed

Committer:
mbed2f
Date:
Sun Jan 08 17:28:24 2012 +0000
Revision:
0:7610d342c76e

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed2f 0:7610d342c76e 1 /* Copyright (c) 2010-2011 mbed.org, MIT License
mbed2f 0:7610d342c76e 2 *
mbed2f 0:7610d342c76e 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
mbed2f 0:7610d342c76e 4 * and associated documentation files (the "Software"), to deal in the Software without
mbed2f 0:7610d342c76e 5 * restriction, including without limitation the rights to use, copy, modify, merge, publish,
mbed2f 0:7610d342c76e 6 * distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
mbed2f 0:7610d342c76e 7 * Software is furnished to do so, subject to the following conditions:
mbed2f 0:7610d342c76e 8 *
mbed2f 0:7610d342c76e 9 * The above copyright notice and this permission notice shall be included in all copies or
mbed2f 0:7610d342c76e 10 * substantial portions of the Software.
mbed2f 0:7610d342c76e 11 *
mbed2f 0:7610d342c76e 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
mbed2f 0:7610d342c76e 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
mbed2f 0:7610d342c76e 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
mbed2f 0:7610d342c76e 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
mbed2f 0:7610d342c76e 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
mbed2f 0:7610d342c76e 17 */
mbed2f 0:7610d342c76e 18
mbed2f 0:7610d342c76e 19 #ifndef USBCDC_H
mbed2f 0:7610d342c76e 20 #define USBCDC_H
mbed2f 0:7610d342c76e 21
mbed2f 0:7610d342c76e 22 /* These headers are included for child class. */
mbed2f 0:7610d342c76e 23 #include "USBEndpoints.h"
mbed2f 0:7610d342c76e 24 #include "USBDescriptor.h"
mbed2f 0:7610d342c76e 25 #include "USBDevice_Types.h"
mbed2f 0:7610d342c76e 26
mbed2f 0:7610d342c76e 27 #include "USBDevice.h"
mbed2f 0:7610d342c76e 28
mbed2f 0:7610d342c76e 29
mbed2f 0:7610d342c76e 30
mbed2f 0:7610d342c76e 31 class USBCDC: public USBDevice {
mbed2f 0:7610d342c76e 32 public:
mbed2f 0:7610d342c76e 33
mbed2f 0:7610d342c76e 34 /*
mbed2f 0:7610d342c76e 35 * Constructor
mbed2f 0:7610d342c76e 36 *
mbed2f 0:7610d342c76e 37 * @param vendor_id Your vendor_id
mbed2f 0:7610d342c76e 38 * @param product_id Your product_id
mbed2f 0:7610d342c76e 39 * @param product_release Your preoduct_release
mbed2f 0:7610d342c76e 40 */
mbed2f 0:7610d342c76e 41 USBCDC(uint16_t vendor_id, uint16_t product_id, uint16_t product_release);
mbed2f 0:7610d342c76e 42
mbed2f 0:7610d342c76e 43 protected:
mbed2f 0:7610d342c76e 44
mbed2f 0:7610d342c76e 45 /*
mbed2f 0:7610d342c76e 46 * Get device descriptor. Warning: this method has to store the length of the report descriptor in reportLength.
mbed2f 0:7610d342c76e 47 *
mbed2f 0:7610d342c76e 48 * @returns pointer to the device descriptor
mbed2f 0:7610d342c76e 49 */
mbed2f 0:7610d342c76e 50 virtual uint8_t * deviceDesc();
mbed2f 0:7610d342c76e 51
mbed2f 0:7610d342c76e 52 /*
mbed2f 0:7610d342c76e 53 * Get string product descriptor
mbed2f 0:7610d342c76e 54 *
mbed2f 0:7610d342c76e 55 * @returns pointer to the string product descriptor
mbed2f 0:7610d342c76e 56 */
mbed2f 0:7610d342c76e 57 virtual uint8_t * stringIproductDesc();
mbed2f 0:7610d342c76e 58
mbed2f 0:7610d342c76e 59 /*
mbed2f 0:7610d342c76e 60 * Get string interface descriptor
mbed2f 0:7610d342c76e 61 *
mbed2f 0:7610d342c76e 62 * @returns pointer to the string interface descriptor
mbed2f 0:7610d342c76e 63 */
mbed2f 0:7610d342c76e 64 virtual uint8_t * stringIinterfaceDesc();
mbed2f 0:7610d342c76e 65
mbed2f 0:7610d342c76e 66 /*
mbed2f 0:7610d342c76e 67 * Get configuration descriptor
mbed2f 0:7610d342c76e 68 *
mbed2f 0:7610d342c76e 69 * @returns pointer to the configuration descriptor
mbed2f 0:7610d342c76e 70 */
mbed2f 0:7610d342c76e 71 virtual uint8_t * configurationDesc();
mbed2f 0:7610d342c76e 72
mbed2f 0:7610d342c76e 73 /*
mbed2f 0:7610d342c76e 74 * Send a buffer
mbed2f 0:7610d342c76e 75 *
mbed2f 0:7610d342c76e 76 * @param endpoint endpoint which will be sent the buffer
mbed2f 0:7610d342c76e 77 * @param buffer buffer to be sent
mbed2f 0:7610d342c76e 78 * @param size length of the buffer
mbed2f 0:7610d342c76e 79 * @returns true if successful
mbed2f 0:7610d342c76e 80 */
mbed2f 0:7610d342c76e 81 bool send(uint8_t * buffer, uint16_t size);
mbed2f 0:7610d342c76e 82
mbed2f 0:7610d342c76e 83 /*
mbed2f 0:7610d342c76e 84 * Read a buffer from a certain endpoint. Warning: blocking
mbed2f 0:7610d342c76e 85 *
mbed2f 0:7610d342c76e 86 * @param endpoint endpoint to read
mbed2f 0:7610d342c76e 87 * @param buffer buffer where will be stored bytes
mbed2f 0:7610d342c76e 88 * @param size the number of bytes read will be stored in *size
mbed2f 0:7610d342c76e 89 * @param maxSize the maximum length that can be read
mbed2f 0:7610d342c76e 90 * @returns true if successful
mbed2f 0:7610d342c76e 91 */
mbed2f 0:7610d342c76e 92 bool readEP(uint8_t * buffer, uint16_t * size);
mbed2f 0:7610d342c76e 93
mbed2f 0:7610d342c76e 94 /*
mbed2f 0:7610d342c76e 95 * Read a buffer from a certain endpoint. Warning: non blocking
mbed2f 0:7610d342c76e 96 *
mbed2f 0:7610d342c76e 97 * @param endpoint endpoint to read
mbed2f 0:7610d342c76e 98 * @param buffer buffer where will be stored bytes
mbed2f 0:7610d342c76e 99 * @param size the number of bytes read will be stored in *size
mbed2f 0:7610d342c76e 100 * @param maxSize the maximum length that can be read
mbed2f 0:7610d342c76e 101 * @returns true if successful
mbed2f 0:7610d342c76e 102 */
mbed2f 0:7610d342c76e 103 bool readEP_NB(uint8_t * buffer, uint16_t * size);
mbed2f 0:7610d342c76e 104
mbed2f 0:7610d342c76e 105 virtual bool USBCallback_request();
mbed2f 0:7610d342c76e 106 virtual bool USBCallback_setConfiguration(uint8_t configuration);
mbed2f 0:7610d342c76e 107
mbed2f 0:7610d342c76e 108 };
mbed2f 0:7610d342c76e 109
mbed2f 0:7610d342c76e 110 #endif