Rotary Encoder handling library for mbed

Dependents:   MIDI_CW Gemphet8

Revision:
6:abd0d8d58fed
Parent:
5:3e6931797218
--- a/REnc.h	Tue Aug 12 01:56:59 2014 +0000
+++ b/REnc.h	Tue Aug 12 02:59:22 2014 +0000
@@ -1,8 +1,3 @@
-#ifndef MBED_RENC_H
-#define MBED_RENC_H
-
-#include "mbed.h"
-
 /**
  *  @file       REnc.h
  *  Project     Rotary Encoder handling Library
@@ -11,8 +6,27 @@
  *  @author     Chuck Timber
  *  @date       12/08/2014
  */
-/** class to handle a rotary encoder 
- *   The class use DigitalIn and Ticker
+
+#ifndef MBED_RENC_H
+#define MBED_RENC_H
+
+#include "mbed.h"
+
+/**
+ *  @define
+ *
+ */
+#define RENC_SAMPLING_PERIOD 0.002
+#define RENC_EXECUTION_DELAY 300
+
+namespace mbed {
+
+    enum { STOP, CLOCKWISE, COUNTERCLOCKWISE };
+//    enum { STOP, CC,        CCW              };
+
+/** Class: REnc
+ *  A class to handle a rotary encoder 
+ *   This class uses DigitalIn and Ticker
  *
  * Refered to: http://elm-chan.org/docs/tec/te04.html
  *
@@ -50,33 +64,17 @@
  * }
  * @endcode
  */
-
-/**
- *  @define
- *
- */
-#define RENC_SAMPLING_PERIOD 0.002
-#define RENC_EXECUTION_DELAY 300
-
-namespace mbed {
-
-    enum { STOP, CLOCKWISE, COUNTERCLOCKWISE };
-//    enum { STOP, CC,        CCW              };
-
-/** class to handle a rotary encoder 
- *   The class uses DigitalIn and Ticker
- */
 class REnc {
 
 public:
-    unsigned char CMD;    /*!< @brief CMD represents the state of rotation
+    unsigned char CMD;    /*!< CMD represents the state of rotation
                            *   @retval STOP
                            *   @retval CLOCKWISE
                            *   @retval COUNTERCLOCKWISE
                            */
-    unsigned char STABLE; /*!< @brief STABLE represents the rotation stability,
-                           *  @brief raises RENC_EXECUTION_DELAY counts after REnc STOPping
-                           *  @retval 1 - stable
+    unsigned char STABLE; /*!< STABLE represents the rotation stability,
+                           *   raises RENC_EXECUTION_DELAY counts after REnc STOPping
+                           *   @retval 1 - stable
                            */ 
 
     /** set callback function to Clockwise TURN */