amt102-vのライブラリです
Diff: incenc.h
- Revision:
- 0:60d903b5752f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/incenc.h Thu Feb 20 08:59:27 2020 +0000 @@ -0,0 +1,31 @@ +#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_ \ No newline at end of file