Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: IZU2020_GROUND_STATION IZU2020_AVIONICS IZU2020_AVIONICS
ES920LR Class Reference
ES920LRのライブラリ More...
#include <PQES920LR.h>
Public Member Functions | |
| ES920LR (Serial &es_serial) | |
| void | send (char *data, int size) |
| void | attach (void(*func_ptr)(char *)) |
Detailed Description
ES920LRのライブラリ
- Note:
- 内部でシリアル受信割り込みを使用しています
- 適切な送信時間間隔を取ること
-
attachで受信イベントハンドラを設定すること
#include "mbed.h" #include "PQES920LR.h" Serial pc(USBTX, USBRX, 115200); Serial es_serial(p9, p10, 115200); ES920LR es(es_serial); char data[50]; void on_receive(char *buff) { for(int i = 0; i < 50; i++) { pc.printf("%x ", buff[i]); } } int main() { es.attach(&on_receive); for(int i = 0; i < 50; i++) { data[i] = 0xFF; } while(1) { es.send(data, 50); wait(1); } }
Definition at line 41 of file PQES920LR.h.
Constructor & Destructor Documentation
| ES920LR | ( | Serial & | es_serial ) |
- Parameters:
-
es_serial Serialのインスタンスへの参照
Definition at line 4 of file PQES920LR.cpp.
Member Function Documentation
| void attach | ( | void(*)(char *) | func_ptr ) |
- Parameters:
-
func_ptr 受信時に呼ばれる関数へのポインタ、引数に受信データを受け取る
Definition at line 33 of file PQES920LR.cpp.
| void send | ( | char * | data, |
| int | size | ||
| ) |
- Parameters:
-
data 送信するバイナリデータの配列(最大50バイト) size 送信するバイナリデータのサイズ
Definition at line 15 of file PQES920LR.cpp.
Generated on Wed Jul 13 2022 11:31:18 by
1.7.2