Go to the documentation of this file.00001 #ifndef ROTARY_ENCODER_HPP
00002 #define ROTARY_ENCODER_HPP
00003
00004 #include <stdint.h>
00005
00006 typedef void (*re_decoderCB_t)(int);
00007
00008 class re_decoder
00009 {
00010 int mygpioA, mygpioB, levA, levB, lastGpio;
00011
00012 re_decoderCB_t mycallback;
00013
00014 void _pulse(int gpio, int level, uint32_t tick);
00015
00016
00017 static void _pulseEx(int gpio, int level, uint32_t tick, void *user);
00018
00019
00020 public:
00021
00022 re_decoder(int gpioA, int gpioB, re_decoderCB_t callback);
00023
00024
00025
00026
00027
00028
00029 void re_cancel(void);
00030
00031
00032
00033 };
00034
00035 #endif