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 /* USBBusInterface.h */
mbed2f 0:7610d342c76e 2 /* USB Bus Interface */
mbed2f 0:7610d342c76e 3 /* Copyright (c) 2011 ARM Limited. All rights reserved. */
mbed2f 0:7610d342c76e 4
mbed2f 0:7610d342c76e 5 #ifndef USBBUSINTERFACE_H
mbed2f 0:7610d342c76e 6 #define USBBUSINTERFACE_H
mbed2f 0:7610d342c76e 7
mbed2f 0:7610d342c76e 8 #include "mbed.h"
mbed2f 0:7610d342c76e 9 #include "USBEndpoints.h"
mbed2f 0:7610d342c76e 10
mbed2f 0:7610d342c76e 11 class USBHAL {
mbed2f 0:7610d342c76e 12 public:
mbed2f 0:7610d342c76e 13 /* Configuration */
mbed2f 0:7610d342c76e 14 USBHAL();
mbed2f 0:7610d342c76e 15 ~USBHAL();
mbed2f 0:7610d342c76e 16 void connect(void);
mbed2f 0:7610d342c76e 17 void disconnect(void);
mbed2f 0:7610d342c76e 18 void configureDevice(void);
mbed2f 0:7610d342c76e 19 void unconfigureDevice(void);
mbed2f 0:7610d342c76e 20 void setAddress(uint8_t address);
mbed2f 0:7610d342c76e 21 void remoteWakeup(void);
mbed2f 0:7610d342c76e 22
mbed2f 0:7610d342c76e 23 /* Endpoint 0 */
mbed2f 0:7610d342c76e 24 void EP0setup(uint8_t *buffer);
mbed2f 0:7610d342c76e 25 void EP0read(void);
mbed2f 0:7610d342c76e 26 uint32_t EP0getReadResult(uint8_t *buffer);
mbed2f 0:7610d342c76e 27 void EP0write(uint8_t *buffer, uint32_t size);
mbed2f 0:7610d342c76e 28 void EP0getWriteResult(void);
mbed2f 0:7610d342c76e 29 void EP0stall(void);
mbed2f 0:7610d342c76e 30
mbed2f 0:7610d342c76e 31 /* Other endpoints */
mbed2f 0:7610d342c76e 32 EP_STATUS endpointRead(uint8_t endpoint, uint32_t maximumSize);
mbed2f 0:7610d342c76e 33 EP_STATUS endpointReadResult(uint8_t endpoint, uint8_t *data, uint32_t *bytesRead);
mbed2f 0:7610d342c76e 34 EP_STATUS endpointWrite(uint8_t endpoint, uint8_t *data, uint32_t size);
mbed2f 0:7610d342c76e 35 EP_STATUS endpointWriteResult(uint8_t endpoint);
mbed2f 0:7610d342c76e 36 void stallEndpoint(uint8_t endpoint);
mbed2f 0:7610d342c76e 37 void unstallEndpoint(uint8_t endpoint);
mbed2f 0:7610d342c76e 38 bool realiseEndpoint(uint8_t endpoint, uint32_t maxPacket, uint32_t options);
mbed2f 0:7610d342c76e 39 bool getEndpointStallState(unsigned char endpoint);
mbed2f 0:7610d342c76e 40 uint32_t endpointReadcore(uint8_t endpoint, uint8_t *buffer);
mbed2f 0:7610d342c76e 41
mbed2f 0:7610d342c76e 42 protected:
mbed2f 0:7610d342c76e 43 virtual void busReset(void){};
mbed2f 0:7610d342c76e 44 virtual void EP0setupCallback(void){};
mbed2f 0:7610d342c76e 45 virtual void EP0out(void){};
mbed2f 0:7610d342c76e 46 virtual void EP0in(void){};
mbed2f 0:7610d342c76e 47 virtual void connectStateChanged(unsigned int connected){};
mbed2f 0:7610d342c76e 48 virtual void suspendStateChanged(unsigned int suspended){};
mbed2f 0:7610d342c76e 49 virtual void SOF(int frameNumber){};
mbed2f 0:7610d342c76e 50 virtual bool EP1_OUT_callback(){return false;};
mbed2f 0:7610d342c76e 51 virtual bool EP1_IN_callback(){return false;};
mbed2f 0:7610d342c76e 52 virtual bool EP2_OUT_callback(){return false;};
mbed2f 0:7610d342c76e 53 virtual bool EP2_IN_callback(){return false;};
mbed2f 0:7610d342c76e 54 virtual bool EP3_OUT_callback(){return false;};
mbed2f 0:7610d342c76e 55 virtual bool EP3_IN_callback(){return false;};
mbed2f 0:7610d342c76e 56
mbed2f 0:7610d342c76e 57 private:
mbed2f 0:7610d342c76e 58 void usbisr(void);
mbed2f 0:7610d342c76e 59 static void _usbisr(void);
mbed2f 0:7610d342c76e 60 static USBHAL * instance;
mbed2f 0:7610d342c76e 61 };
mbed2f 0:7610d342c76e 62 #endif
mbed2f 0:7610d342c76e 63
mbed2f 0:7610d342c76e 64