インタープラン製無線モジュールIM920と通信を行うライブラリです
Diff: IM920.h
- Revision:
- 0:4d4bdea0e93d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/IM920.h Sat Mar 11 03:30:34 2017 +0000 @@ -0,0 +1,43 @@ +#ifndef IM920_H +#define IM920_H + +#include "mbed.h" + +#define BAUD_1200 0 +#define BAUD_2400 1 +#define BAUD_4800 2 +#define BAUD_9600 3 +#define BAUD_19200 4 +#define BAUD_38400 5 + +#define POWER_0_1MW 1 +#define POWER_1MW 2 +#define POWER_10MW 3 + +#define HSPEED 1 //50kbps 高速通信モード +#define LSPEED 2//1.25kbps 長距離通信モード + +#define BAUD_LATE BAUD_38400//通信時ボーレート +#define POWER POWER_10MW //送信出力 +#define ID "0DCB"//相手方の固有ID +#define FREQ "02"//通信チャンネル(01~15) +#define SPEED HSPEED //通信モード + + +class IM920{ + public: + IM920(PinName RadioTx,PinName RadioRx,PinName Busy); + void RadioInit();//初期設定 不揮発メモリは書き込み禁止で行う + void SendCommand(char* data);//データ送信 + void SendBufClear(char* buf); + bool SendData(char* data); + + private: + + Serial _Radio; + DigitalIn _Busy; +}; + + + +#endif