SBUSのcppとhppだけ(フォーク)

Dependents:   optWingforHAPS_Eigen hexaTest_Eigen

SBUS.hpp

Committer:
NaotoMorita
Date:
2021-03-03
Revision:
2:3241f9311a0e
Parent:
1:b2a305158f89

File content as of revision 2:3241f9311a0e:

#ifndef _SBUS_
#define _SBUS_
#define _SBUS_

#include "mbed.h"

class SBUS
{
public:
    SBUS(PinName tx, PinName rx);
    int16_t getData(uint8_t ch);
    int getStickVal(int axis);
    int getSwitchVal(int parm);
    bool failSafe;

private:
    RawSerial sbus_;
    void sbusIrqRx ();
    int sbusIndex;
    unsigned int rcChannel[18];
    long map(long x, long in_min, long in_max, long out_min, long out_max); // From:Arduino.h
};

#endif