Philips Philips / UsbReverseAudioguitarspeaker

Description: 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.

Embed: (wiki syntax)

« Back to documentation index

USBHID Class Reference

USBHID Class Reference

USBHID example. More...

#include <USBHID.h>

Inherits USBDevice.

Inherited by USBKeyboard, USBMouse, and USBMouseKeyboard.

Public Member Functions

 USBHID (uint8_t output_report_length=64, uint8_t input_report_length=64, uint16_t vendor_id=0x1234, uint16_t product_id=0x0006, uint16_t product_release=0x0001, bool connect=true)
 Constructor.
bool send (HID_REPORT *report)
 Send a Report.
bool sendNB (HID_REPORT *report)
 Send a Report.
bool read (HID_REPORT *report)
 Read a report: blocking.
bool readNB (HID_REPORT *report)
 Read a report: non blocking.

Detailed Description

USBHID example.

 #include "mbed.h"
 #include "USBHID.h"

 USBHID hid;
 HID_REPORT recv;
 BusOut leds(LED1,LED2,LED3,LED4);

 int main(void) {
    while (1) {
        hid.read(&recv);
        leds = recv.data[0];
    }
 }

Definition at line 50 of file USBHID.h.


Constructor & Destructor Documentation

USBHID ( uint8_t  output_report_length = 64,
uint8_t  input_report_length = 64,
uint16_t  vendor_id = 0x1234,
uint16_t  product_id = 0x0006,
uint16_t  product_release = 0x0001,
bool  connect = true 
)

Constructor.

Parameters:
output_report_lengthMaximum length of a sent report (up to 64 bytes) (default: 64 bytes)
input_report_lengthMaximum length of a received report (up to 64 bytes) (default: 64 bytes)
vendor_idYour vendor_id
product_idYour product_id
product_releaseYour preoduct_release
connectConnect the device

Definition at line 10 of file USBHID.cpp.


Member Function Documentation

bool read ( HID_REPORT *  report )

Read a report: blocking.

Parameters:
reportpointer to the report to fill
Returns:
true if successful

Definition at line 31 of file USBHID.cpp.

bool readNB ( HID_REPORT *  report )

Read a report: non blocking.

Parameters:
reportpointer to the report to fill
Returns:
true if successful

Definition at line 43 of file USBHID.cpp.

bool send ( HID_REPORT *  report )

Send a Report.

warning: blocking

Parameters:
reportReport which will be sent (a report is defined by all data and the length)
Returns:
true if successful

Definition at line 20 of file USBHID.cpp.

bool sendNB ( HID_REPORT *  report )

Send a Report.

warning: non blocking

Parameters:
reportReport which will be sent (a report is defined by all data and the length)
Returns:
true if successful

Definition at line 25 of file USBHID.cpp.