![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
aaa
Dependencies: mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_USBSerial by
main.cpp
- Committer:
- hudakz
- Date:
- 2017-04-26
- Revision:
- 5:0be85f1bdb35
- Parent:
- 4:00ccc80cbeb8
- Child:
- 6:d3175b589df4
File content as of revision 5:0be85f1bdb35:
#include "stm32f103c8t6.h" #include "mbed.h" #include "USBSerial.h" DigitalOut myled(LED1); int main() { confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) Serial pc(PA_2, PA_3); //USBSerial usbSerial; // connection must be blocked when USB is not plugged in USBSerial usbSerial(0x1f00, 0x2012, 0x0001, false); // connection is not blocked when USB is not plugged in while(1) { myled = !myled; pc.printf("I am a serial port\r\n"); // 9600 bit/s usbSerial.printf("I am a USB serial port\r\n"); // 12 Mbit/s (USB full-speed) wait_ms(1000); } }