Interplan IM920 library, 920MHz module
Dependents: IM920_sample IM920_SDlog IM920_sample IM920_sample3 ... more
IM920 ライブラリ
データモード、低速、長距離 の設定で通信するライブラリです。
920MHz無線モジュール
- mbedとモジュールとは、シリアル(TX,RX)、BUSY、RESET端子を接続します。
- モジュールはあらかじめ、コマンドでノード番号などを設定しておきます。
Diff: IM920.h
- Revision:
- 4:ba939555ed35
- Parent:
- 3:db269462ad1c
--- a/IM920.h Thu Jan 08 13:25:46 2015 +0000 +++ b/IM920.h Thu Jan 29 06:16:10 2015 +0000 @@ -28,7 +28,7 @@ #include <string.h> //Debug is disabled by default -#if defined(DEBUG) and (!defined(TARGET_LPC11U24)) +#if defined(DEBUG) #define DBG(x, ...) std::printf("[DBG]" x "\r\n", ##__VA_ARGS__); #define WARN(x, ...) std::printf("[WARN]" x "\r\n", ##__VA_ARGS__); #define ERR(x, ...) std::printf("[ERR]" x "\r\n", ##__VA_ARGS__); @@ -62,8 +62,9 @@ IM920 (PinName tx, PinName rx, PinName busy, PinName reset, int baud = IM920_BAUD); int init (); - int setNode (int node); - int getNode (); + void poll (); + int send (char *buf, int len); + int recv (char *buf, int len); void attach (void(*fptr)() = NULL) { _func.attach(fptr); @@ -75,15 +76,16 @@ } } - void poll (); - - int send (char *buf, int len); - int recv (char *buf, int len); - + // ----- IM920_util.cpp ----- + int setNode (int node); + int getNode (); int setCh (int ch); + int setPower (int pwr); + int setSpeed (int spd); int getRssi (); int sleep (); int wakeup (); + int test (); // ----- IM920_cmd.cpp ----- int sendCommand(const char * cmd, Response res = RES_NULL, int timeout = DEFAULT_WAIT_RESP_TIMEOUT); @@ -142,6 +144,8 @@ int cmdSBRT (int n); int cmdDSRX (); int cmdENRX (); + int cmdEGRX (); + int cmdDGRX (); // ----- IM920_hal.cpp ----- void setReset (bool flg);