test ir controller for carozzeria audio

Dependencies:   mbed

IR test program for carozzeria audio

USB HID&赤外線ステアリングコントローラー

https://zeus3110.wordpress.com/2015/08/08/usb-hid%E8%B5%A4%E5%A4%96%E7%B7%9A%E3%82%B9%E3%83%86%E3%82%A2%E3%83%AA%E3%83%B3%E3%82%B0%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC/

回路図

https://zeus3110.wordpress.com/2015/08/13/usb-hid%E8%B5%A4%E5%A4%96%E7%B7%9A%E3%82%B9%E3%83%86%E3%82%A2%E3%83%AA%E3%83%B3%E3%82%B0%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9%E3%83%BC-%E5%9B%9E%E8%B7%AF%E5%9B%B3/

Revision:
0:e606807a2d4a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DEH970Ctrl.h	Sat Aug 15 11:05:11 2015 +0000
@@ -0,0 +1,43 @@
+#ifndef _DEH970_CTRL_H_
+#define _DEH970_CTRL_H_
+
+#include "mbed.h"
+
+#define DATA_LENGTH 4
+#define IR_ON 0.5
+#define IR_OFF 0
+
+const int BurstPeriod=26;
+const timestamp_t LeaderOn=8628;
+const timestamp_t LeaderOff=4137;
+const timestamp_t DataOn=626;    
+const timestamp_t DataOff1=1488;
+const timestamp_t DataOff0=424;
+const timestamp_t TrailerOn=626;
+const timestamp_t TrailerOff=25395;
+
+class DEH970Controller {
+protected:    
+private:
+    bool Locked;
+    PwmOut *IRPort;
+    int DataBitPos,DataBytePos;
+    unsigned char *Data;
+    bool DataBit;
+    Timeout *TimeOutIR;
+
+
+public:
+    bool IsLocked();  
+    DEH970Controller(PwmOut *Port);
+    ~DEH970Controller();
+    void PwmPortInit();
+    void SendSignal(unsigned char *Dp);
+    void SendLeaderOn();
+    void SendData();
+    
+    void SendVolPlus();
+    void SendVolMinus();
+};
+
+#endif
\ No newline at end of file