amt102-vのライブラリです

Committer:
taisyou
Date:
Thu Feb 20 08:59:27 2020 +0000
Revision:
0:60d903b5752f
release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
taisyou 0:60d903b5752f 1 #ifndef INCLDUED_incenc_h_
taisyou 0:60d903b5752f 2 #define INCLDUED_incenc_h_
taisyou 0:60d903b5752f 3 #include "mbed.h"
taisyou 0:60d903b5752f 4 #define INCENC_GET_VAL(__ENCODER__, __NUMBER__) \
taisyou 0:60d903b5752f 5 (((__ENCODER__)+ (__NUMBER__))->read_buf)
taisyou 0:60d903b5752f 6
taisyou 0:60d903b5752f 7 #define INCENC_GET_DEGREE(__MD_DATA__, __NUMBER__)\
taisyou 0:60d903b5752f 8 (((__MD_DATA__) + (__NUMBER__))->degree)
taisyou 0:60d903b5752f 9 #define enc_MAX 2//使う個数を書いてね
taisyou 0:60d903b5752f 10
taisyou 0:60d903b5752f 11 class incEnc
taisyou 0:60d903b5752f 12 {
taisyou 0:60d903b5752f 13 public:
taisyou 0:60d903b5752f 14 InterruptIn A;
taisyou 0:60d903b5752f 15 InterruptIn B;
taisyou 0:60d903b5752f 16 incEnc(PinName p1,PinName p2);
taisyou 0:60d903b5752f 17 int16_t degree;
taisyou 0:60d903b5752f 18 int32_t read_buf;
taisyou 0:60d903b5752f 19 };
taisyou 0:60d903b5752f 20 void Ar_f();
taisyou 0:60d903b5752f 21 void Af_f();
taisyou 0:60d903b5752f 22 void Br_f();
taisyou 0:60d903b5752f 23 void Bf_f();
taisyou 0:60d903b5752f 24 void Ar(incEnc *e,uint8_t);
taisyou 0:60d903b5752f 25 void Af(incEnc *e,uint8_t);
taisyou 0:60d903b5752f 26 void Br(incEnc *e,uint8_t);
taisyou 0:60d903b5752f 27 void Bf(incEnc *e,uint8_t);
taisyou 0:60d903b5752f 28
taisyou 0:60d903b5752f 29 extern incEnc incenc[enc_MAX];
taisyou 0:60d903b5752f 30
taisyou 0:60d903b5752f 31 #endif //INCLDUED_incenc_h_