Browse Source

doxygen: Added documentation for servo base and es08a

Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
Kiveisha Yevgeniy 10 years ago
parent
commit
814cc4a0e8
3 changed files with 53 additions and 0 deletions
  1. 2
    0
      examples/es08a.cxx
  2. 17
    0
      src/servo/es08a.h
  3. 34
    0
      src/servo/servo.h

+ 2
- 0
examples/es08a.cxx View File

@@ -43,6 +43,7 @@ sig_handler(int signo)
43 43
 int
44 44
 main(int argc, char **argv)
45 45
 {
46
+    //! [Interesting]
46 47
     upm::ES08A *servo = new upm::ES08A(5);
47 48
 
48 49
     signal(SIGINT, sig_handler);
@@ -59,6 +60,7 @@ main(int argc, char **argv)
59 60
             clock -= 10;
60 61
         }
61 62
     }
63
+    //! [Interesting]
62 64
 
63 65
     std::cout << "exiting application" << std::endl;
64 66
 

+ 17
- 0
src/servo/es08a.h View File

@@ -31,9 +31,26 @@ namespace upm {
31 31
 #define MIN_PULSE_WIDTH      600
32 32
 #define MAX_PULSE_WIDTH      2500
33 33
 
34
+/**
35
+ * @brief C++ API for ES08A servo component
36
+ *
37
+ * This file defines the ES08A C++ interface for libes08a
38
+ *
39
+ * @snippet es08a.cxx Interesting
40
+ *
41
+ */
34 42
 class ES08A : public Servo {
35 43
     public:
44
+        /**
45
+         * Instanciates a ES08A object
46
+         *
47
+         * @param pin servo pin number
48
+         */
36 49
         ES08A (int pin);
50
+
51
+        /**
52
+         * ES08A object destructor.
53
+         */
37 54
         ~ES08A ();
38 55
 };
39 56
 

+ 34
- 0
src/servo/servo.h View File

@@ -35,12 +35,46 @@ namespace upm {
35 35
 #define HIGH                  1
36 36
 #define LOW                   0
37 37
 
38
+/**
39
+ * @brief Base class for other servo components
40
+ *
41
+ * PMOD pins for MAX44000PMB1 board
42
+ *
43
+ */
38 44
 class Servo {
39 45
     public:
46
+        /**
47
+         * Instanciates a servo object
48
+         *
49
+         * @param pin servo pin number
50
+         */
40 51
         Servo (int pin);
52
+
53
+        /**
54
+         * Servo object destructor.
55
+         */
41 56
         ~Servo();
57
+
58
+        /**
59
+         * Set the of the servo engine.
60
+         *
61
+         * X = between (MIN_PULSE_WIDTH , MAX_PULSE_WIDTH)
62
+         *
63
+         * X usec
64
+         * _______
65
+         *        |_______________________________________
66
+         *                      20000 usec
67
+         *
68
+         * Max period can be only 7968750(nses) which is ~8(msec)
69
+         * so the servo will not work as expected.
70
+         *
71
+         * @param angle number between 0 and 180
72
+         */
42 73
         maa_result_t setAngle (int angle);
43 74
 
75
+        /**
76
+         * Return name of the component
77
+         */
44 78
         std::string name()
45 79
         {
46 80
             return m_name;