This library assign registar and send 4bytes data in serial. Auto attachment interruption.

Dependents:   WRS_mechanamu_test

Revision:
2:ea92ff9abc8c
Parent:
1:ee6809d3cee3
diff -r ee6809d3cee3 -r ea92ff9abc8c PacketSerail.cpp
--- a/PacketSerail.cpp	Fri Jun 29 08:37:27 2018 +0000
+++ b/PacketSerail.cpp	Fri Jun 29 12:50:08 2018 +0000
@@ -36,10 +36,10 @@
 *********************************************************/
 
 
-PacketSerial::PacketSerial(PinName tx, PinName rx, int32_t* registar) : Serial(tx, rx)
+PacketSerial::PacketSerial(PinName tx, PinName rx, int32_t* registar, int baudrate) : Serial(tx, rx)
 {
     _registar = registar;
-    Serial::baud(9600);
+    Serial::baud(baudrate);
     Serial::attach(this, &PacketSerial::readData, Serial::RxIrq);
 }