JRC 3714 library. serial 2 parallel(24bit).

Files at this revision

API Documentation at this revision

Comitter:
muraguchi
Date:
Sat Feb 25 18:12:11 2012 +0000
Commit message:

Changed in this revision

IO3714.cpp Show annotated file Show diff for this revision Revisions of this file
IO3714.h Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 7d09d9914030 IO3714.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IO3714.cpp	Sat Feb 25 18:12:11 2012 +0000
@@ -0,0 +1,20 @@
+#include "IO3714.h"
+
+IO3714::IO3714(PinName mosi, PinName sclk, PinName clr_n, PinName stb_n)
+        : _spi(mosi,NC,sclk), _clr_n(clr_n), _stb_n(stb_n) {
+    _clr_n=0;
+    _stb_n=0;
+    _spi.format(12,0);
+    _spi.frequency(48000000);
+    _clr_n=1;
+}
+
+void IO3714::write(unsigned int data) {
+
+
+    _spi.write((data>>12) & 0xFFF  );
+    _spi.write(data & 0xFFF );
+    _stb_n=0;
+    _stb_n=1;
+
+}
diff -r 000000000000 -r 7d09d9914030 IO3714.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/IO3714.h	Sat Feb 25 18:12:11 2012 +0000
@@ -0,0 +1,18 @@
+
+#ifndef MBED_IO3714_H
+#define MBED_IO3714_H
+
+#include "mbed.h"
+
+class IO3714 {
+public:
+    IO3714(PinName mosi, PinName sclk, PinName clr_n, PinName stb_n);
+    void write(unsigned int data);
+private:
+    SPI _spi;
+    DigitalOut _clr_n;
+    DigitalOut _stb_n;
+
+};
+
+#endif
\ No newline at end of file