TLC5940 library which supports SWSPI, has API to specify grayscale PWM period and has API like Arduino library.

Fork of TLC5940 by Stefan Nielsen

Revision:
0:bdf7a64b89a7
Child:
1:b188393f5b49
diff -r 000000000000 -r bdf7a64b89a7 TLC5940.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TLC5940.h	Sun Mar 24 16:23:29 2013 +0000
@@ -0,0 +1,22 @@
+#ifndef TLC5940_H_
+#define TLC5940_H_
+
+#include "mbed.h"
+
+class TLC5940 {
+private:
+    SPI * _spi;
+    PwmOut * _gsclk;
+    DigitalOut * _xlat;
+    DigitalOut * _blank; 
+    Ticker * _t;
+    int gs_data[16]; 
+public:
+    TLC5940(PinName mosi, PinName miso, PinName sck, PinName xlat, PinName blank, PinName gsclk);
+    void setServo(int ch, int val);
+    void flush();
+    void run();
+    void refresh();
+};
+
+#endif /* TLC5940_H_ */
\ No newline at end of file