|
@@ -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;
|