Engravity-CDU / CDU_Mbed_35

Dependencies:   4DGL-UC MODSERIAL mbed mbos

Fork of CDU_Mbed_30 by Engravity-CDU

USB_setup.cpp

Committer:
LvdK
Date:
2012-12-08
Revision:
5:99594f4ab659
Parent:
0:6f71ca095e78

File content as of revision 5:99594f4ab659:

// 
#include "mbed.h"

Serial USB(USBTX, USBRX); // : declare USB communication defined by Mbed USB TX and RX lines

void char_received();

void init_USB()
{   // -- This function is the setup for the USB communication --
    // Function char_received() is attached to Rx interrupt.

    USB.baud(38400); // set initial baudrate to 38400
    
    USB.attach(&char_received);    // : attach function
}