Manchester

Files at this revision

API Documentation at this revision

Comitter:
hudakz
Date:
Wed May 17 08:17:13 2017 +0000
Parent:
0:d5c75b0e5708
Child:
2:de778df5892c
Commit message:
Updated.

Changed in this revision

Manchester.cpp Show annotated file Show diff for this revision Revisions of this file
Manchester.h Show annotated file Show diff for this revision Revisions of this file
--- a/Manchester.cpp	Wed May 17 07:52:15 2017 +0000
+++ b/Manchester.cpp	Wed May 17 08:17:13 2017 +0000
@@ -35,7 +35,7 @@
  * @param   txPin Pin name of transmitter line
  *          rxPin Pin name of receiver line
  *          speed Communication bit rate in bits per second
- *          tol Pulse width tolerance in %
+ *          tol   Pulse width tolerance (+/-) in %
  * @retval
  */
 Manchester::Manchester
@@ -147,7 +147,7 @@
 /**
  * @brief   Receives message
  * @note
- * @param   msg A container to store the received message
+ * @param   msg   Container to store the received message
  * @retval  true  On success
  *          false Otherwise
  */
@@ -187,7 +187,7 @@
 
 /**
  * @brief   ISR to handle reception
- * @note    Called on rise or fall on receiver line 
+ * @note    Called on signal rise or fall on receiver line 
  * @param
  * @retval
  */
@@ -270,3 +270,4 @@
         _state = ERROR; // Incomplete transmission
 }
 
+
--- a/Manchester.h	Wed May 17 07:52:15 2017 +0000
+++ b/Manchester.h	Wed May 17 08:17:13 2017 +0000
@@ -4,7 +4,7 @@
  * @author  Zoltan Hudak
  * @version 
  * @date    16-May-2017
- * @brief   Manchester code for ARMmbed
+ * @brief   Manchester code for mbed
  ******************************************************************************
  * @attention
  *
@@ -51,10 +51,10 @@
 public:
     Manchester
     (
-        PinName txPin,          /* transmitter pin name */
-        PinName rxPin,          /* receiver pin name */
-        uint32_t speed = 1500   /* speed in bits per second */, 
-        uint8_t tol = 20        /* pulse width tolerance (+/-) in % */ 
+        PinName     txPin,          /* transmitter pin name */
+        PinName     rxPin,          /* receiver pin name */
+        uint32_t    speed = 1200    /* speed in bits per second */, 
+        uint8_t     tol = 20        /* pulse width tolerance (+/-) in % */ 
     );
     ~Manchester(void) { };
     void    transmit(ManchesterMsg& msg);
@@ -66,8 +66,8 @@
     Ticker      _txTicker;      // transmitter ticker
     Timeout     _rxTimeout;     // receiver timeout
     uint32_t    _midBitTime;    // mid-bit time [us]
-    uint32_t    _minPulseWidth; // minimum pulse width
-    uint32_t    _maxPulseWidth; // maximum pulse width
+    uint32_t    _minPulseWidth; // minimum pulse width [us]
+    uint32_t    _maxPulseWidth; // maximum pulse width [us]
     State       _state;         // state
     char*       _data;          // data array
     uint8_t     _len;           // data length in bytes