12-Channel LED Driver With Gray scale Adaptive Pulse Density Modulation Control IC Library. maker MY-Semi

Dependents:   Library_MY9221

Revision:
3:2131a24e5489
Parent:
2:4d9aee0bd724
--- a/MY9221.h	Sun Oct 22 12:08:22 2017 +0000
+++ b/MY9221.h	Sun Oct 22 22:59:19 2017 +0000
@@ -1,14 +1,51 @@
 #ifndef MBED_MY9221_H
 #define MBED_MY9221_H
 
+/**
+ * MY9221 Library
+ * IC name : MY9221
+ * maker : http://www.my-semi.com/content/products/product_mean.aspx?id=4
+ * 12-Channel LED Driver With Grayscale Adaptive Pulse Density Modulation Control
+ * data sheet : http://akizukidenshi.com/download/ds/mysemi/MY9221_DS1_0.pdf
+ */
+
+/** Example
+ * @code
+*  #include "mbed.h"
+*#include "MY9221.h"
+*MY9221 MY9221(p5, p10, 2);  // di, clk, number
+*
+*uint16_t D_gray[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+*float D_gray2[12] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
+*
+*int main()
+*{
+*
+*    MY9221.commandSet(MY9221::fast, MY9221::bit16, MY9221::freq1, MY9221::waveApdm, MY9221::internal, MY9221::workLed, MY9221::free, MY9221::repeat);
+*
+*
+*   while(1) {
+*
+*        for(int i=0; i < 12; i++) {
+*            D_gray[i] += 0x100;
+*            D_gray2[i] += 0.01;
+*            if(D_gray2[i] > 1)D_gray2[i] = 0;
+*        }
+*        MY9221.dataRawSet(D_gray, 1);
+*        MY9221.dataSet(D_gray2, 2);
+*        wait_ms(20);                            // Image refresh Rate [s] < led gray data update cycle [s]
+*        MY9221.refresh();
+*
+*    }
+*}
+ * @endcode
+*/
+
+
 #include "mbed.h"
 #include "MY9221.h"
 
 
-/**
- * LED driver MY9221
- */
-
 
 /**
  *  @class MY9221
@@ -150,7 +187,7 @@
      * @param uint16_t hardware manual 16-bit COmmand Data Description CMD[15:0] = D[207:192]
      */
     void commandRawSet(uint16_t command);
-    
+
     /** command nomalization set
      * @param hspd_t    hspd    fast,   slow
      * @param bs_t      bs      bit8,   bit12,  bit14,  bit16
@@ -168,11 +205,16 @@
      * @param uint8_t number MY9221 number (1 to 10)
      */
     void dataRawSet(uint16_t *data, uint8_t number);
+
+    /** gray data set
+     * @param float *data (0.0 to 1.0) [0]=OUTA[0], [1]=OUTB[0], [2]=OUTC[0], ... [9]=OUTA[3], [10]=OUTB[3], [11]=OUTC[3]
+     * @param uint8_t number MY9221 number (1 to 10)
+     */
     void dataSet(float *data, uint8_t number);
 
     /** MY9221 send data and latch
      *
-     */ 
+     */
     void refresh(void);
 
 //----------------------------------------------------------
@@ -214,5 +256,4 @@
 
 
 };
-//#undef _MY9221_C
-#endif  //  MBED_PCA9547_H
\ No newline at end of file
+#endif  //  MBED_MY9221_H
\ No newline at end of file