![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
aaa
Dependencies: mbed-STM32F103C8T6 mbed
Fork of STM32F103C8T6_USBSerial by
main.cpp@4:00ccc80cbeb8, 2016-08-14 (annotated)
- Committer:
- hudakz
- Date:
- Sun Aug 14 09:57:58 2016 +0000
- Revision:
- 4:00ccc80cbeb8
- Parent:
- 3:dd01afd4f893
- Child:
- 5:0be85f1bdb35
Updated.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 0:0279e8c1f111 | 1 | #include "stm32f103c8t6.h" |
hudakz | 0:0279e8c1f111 | 2 | #include "mbed.h" |
hudakz | 0:0279e8c1f111 | 3 | #include "USBSerial.h" |
hudakz | 0:0279e8c1f111 | 4 | |
hudakz | 0:0279e8c1f111 | 5 | DigitalOut myled(LED1); |
hudakz | 0:0279e8c1f111 | 6 | |
hudakz | 0:0279e8c1f111 | 7 | int main() { |
hudakz | 3:dd01afd4f893 | 8 | confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) |
hudakz | 4:00ccc80cbeb8 | 9 | |
hudakz | 4:00ccc80cbeb8 | 10 | Serial pc(PA_2, PA_3); |
hudakz | 0:0279e8c1f111 | 11 | USBSerial usbSerial; |
hudakz | 0:0279e8c1f111 | 12 | |
hudakz | 0:0279e8c1f111 | 13 | while(1) { |
hudakz | 0:0279e8c1f111 | 14 | myled = !myled; |
hudakz | 2:2c819b99d216 | 15 | pc.printf("I am a serial port\r\n"); // 9600 bit/s |
hudakz | 3:dd01afd4f893 | 16 | usbSerial.printf("I am a USB serial port\r\n"); // 12 Mbit/s (USB full-speed) |
hudakz | 0:0279e8c1f111 | 17 | wait_ms(1000); |
hudakz | 0:0279e8c1f111 | 18 | } |
hudakz | 0:0279e8c1f111 | 19 | } |
hudakz | 0:0279e8c1f111 | 20 |