NagaokaRoboticsClub_mbedTeam / FEP_TX22

Dependents:   2022_FEPTX-PS4 2022_FEPTX-TokiPS4

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FEP_TX22.h Source File

FEP_TX22.h

Go to the documentation of this file.
00001 /**
00002  *  @file   FEP_TX22.h
00003  *  @brief  送信用FEPライブラリ
00004  *  @author 安澤瑠
00005  *  @date   22/10/6
00006  */
00007 #ifndef FEP_TX22_H
00008 #define FEP_TX22_H
00009 
00010 #include "mbed.h"
00011 
00012 /**
00013  *  @class class for FEP using FEP-01, FEP-02
00014  *  @note  RawSerialクラスを使用しているため mbed-os 6 では使えません。  Not compatible with mbed-os 6
00015  */
00016 class FEP_TX22 : public RawSerial {
00017 public :
00018     /** constructor
00019      *  @param tx   FEPと接続するSerialTX pin
00020      *  @param rx   FEPと接続するSerialRX pin
00021      *  @param addr 通信相手のアドレス
00022      *  @param baud 通信速度(デフォルト115200)
00023      */
00024     FEP_TX22(PinName tx, PinName rx, uint8_t addr_, int baud=115200);
00025 
00026     /** send message
00027      *  @brief BusInの値とstickの値が入った配列を送信する
00028      *  @param data   送るデータ配列のアドレス
00029      *  @param length 送るデータのバイト数
00030      *
00031      *  @return 0  通信成功
00032      *  @return 2  コマンドエラー
00033      *  @return 3  通信相手からのレスポンス無し
00034      *  @return 4  通信相手が受け取りに失敗
00035      *  @return -1 可否不明
00036      */
00037     int8_t SendData(uint8_t *data, uint8_t datalen);
00038 
00039     /** Get response
00040      *  @return 0  通信成功
00041      *  @return 2  コマンドエラー
00042      *  @return 3  通信相手からのレスポンス無し
00043      *  @return 4  通信相手が受け取りに失敗
00044      *  @return -1 可否不明
00045      *  @note getc()を他のループで回している場合に不具合確認 SerialArduinoと共存不可
00046      */
00047     int8_t GetResponse();
00048 
00049 private :
00050 
00051     uint8_t addr;  //! 通信相手のアドレス
00052 };
00053 
00054 #endif