UART baud rate test for LPC11U35

Dependencies:   USBDevice mbed

Fork of UranusTest by Siwei Xu

Files at this revision

API Documentation at this revision

Comitter:
swxu
Date:
Fri May 19 17:48:11 2017 +0000
Parent:
2:626c243adc03
Commit message:
add doc string

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 626c243adc03 -r 98e614fc55c5 main.cpp
--- a/main.cpp	Fri May 19 17:37:27 2017 +0000
+++ b/main.cpp	Fri May 19 17:48:11 2017 +0000
@@ -3,6 +3,34 @@
 
 #include <time.h>
 
+/**
+* Python script for high baud rate test on Host PC
+*
+* @code
+* #!/usr/bin/env python
+*
+* import os
+* import sys
+* import serial
+*
+* PORT = '/dev/ttyUSB0'
+* BAUD = 9600
+*
+* def main(args):
+*     port = len(args) > 1 and args[1] or PORT
+*     baud = len(args) > 2 and args[2] or BAUD
+*     count = 0
+*     with serial.Serial(port, baud) as s:
+*         while True:
+*             b = s.read()
+*             count += 1
+*             sys.stdout.write('%x ' % b)
+*             sys.stdout.flush()
+* if __name__ == '__main__':
+*     main(sys.argv)
+* @endcode
+*/
+
 DigitalOut led0(P0_20);
 DigitalOut led1(P0_21);
 DigitalOut led2(P0_11);