Browse Source

doxygen: Added documentation to led bar (my9221)

Signed-off-by: Kiveisha Yevgeniy <yevgeniy.kiveisha@intel.com>
Kiveisha Yevgeniy 10 years ago
parent
commit
d1f7df0552
2 changed files with 33 additions and 4 deletions
  1. 3
    1
      examples/led-bar.cxx
  2. 30
    3
      src/ledbar/my9221.h

+ 3
- 1
examples/led-bar.cxx View File

@@ -42,8 +42,9 @@ sig_handler(int signo)
42 42
 int
43 43
 main(int argc, char **argv)
44 44
 {
45
+    //! [Interesting]
45 46
     upm::MY9221 *bar = new upm::MY9221(8, 9);
46
-    
47
+
47 48
     signal(SIGINT, sig_handler);
48 49
 
49 50
     while (!running) {
@@ -52,6 +53,7 @@ main(int argc, char **argv)
52 53
             usleep(1000);
53 54
         }
54 55
     }
56
+    //! [Interesting]
55 57
 
56 58
     std::cout << "exiting application" << std::endl;
57 59
 

+ 30
- 3
src/ledbar/my9221.h View File

@@ -28,20 +28,47 @@
28 28
 #include <maa/gpio.h>
29 29
 
30 30
 #define MAX_BIT_PER_BLOCK     16
31
-#define CMDMODE             0x0000
31
+#define CMDMODE               0x0000
32 32
 #define BIT_HIGH              0x00ff
33
-#define BIT_LOW                0x0000
33
+#define BIT_LOW               0x0000
34 34
 
35 35
 #define HIGH                  1
36
-#define LOW                    0
36
+#define LOW                   0
37 37
 
38 38
 namespace upm {
39 39
 
40
+/**
41
+ * @brief C++ API for MY9221 led bar module
42
+ *
43
+ * This file defines the MY9221 C++ interface for libmy9221
44
+ *
45
+ * @snippet led-bar.cxx Interesting
46
+ */
40 47
 class MY9221 {
41 48
     public:
49
+         /**
50
+         * Instanciates a MY9221 object
51
+         *
52
+         * @param di data pin
53
+         * @param dcki clock pin
54
+         */
42 55
         MY9221 (uint8_t di, uint8_t dcki);
56
+
57
+        /**
58
+         * MY9221 object destructor
59
+         */
43 60
         ~MY9221 ();
61
+
62
+        /**
63
+         * Set the level bar
64
+         *
65
+         * @param level selected level for the bar (1 - 10)
66
+         */
44 67
         maa_result_t setBarLevel (uint8_t level);
68
+
69
+        /**
70
+         * Return name of the component
71
+         */
45 72
         std::string name()
46 73
         {
47 74
             return m_name;