amt102-vのライブラリです

incenc.h

Committer:
taisyou
Date:
2020-02-20
Revision:
0:60d903b5752f

File content as of revision 0:60d903b5752f:

#ifndef INCLDUED_incenc_h_
#define INCLDUED_incenc_h_
#include "mbed.h"
#define INCENC_GET_VAL(__ENCODER__, __NUMBER__) \
(((__ENCODER__)+ (__NUMBER__))->read_buf)

#define INCENC_GET_DEGREE(__MD_DATA__, __NUMBER__)\
(((__MD_DATA__) + (__NUMBER__))->degree)
#define enc_MAX 2//使う個数を書いてね

class incEnc
{
public:
    InterruptIn A;
    InterruptIn B;
    incEnc(PinName p1,PinName p2);
    int16_t             degree;
    int32_t            read_buf;
};
void Ar_f();
void Af_f();
void Br_f();
void Bf_f();
void Ar(incEnc *e,uint8_t);
void Af(incEnc *e,uint8_t);
void Br(incEnc *e,uint8_t);
void Bf(incEnc *e,uint8_t);

extern incEnc incenc[enc_MAX];

#endif //INCLDUED_incenc_h_