rotary_encoder.hpp
Go to the documentation of this file.
1 #ifndef ROTARY_ENCODER_HPP
2 #define ROTARY_ENCODER_HPP
3 
4 #include <stdint.h>
5 
6 typedef void (*re_decoderCB_t)(int);
7 
8 class re_decoder
9 {
11 
13 
14  void _pulse(int gpio, int level, uint32_t tick);
15 
16  /* Need a static callback to link with C. */
17  static void _pulseEx(int gpio, int level, uint32_t tick, void *user);
18 
19 
20  public:
21 
22  re_decoder(int gpioA, int gpioB, re_decoderCB_t callback);
23  /*
24  This function establishes a rotary encoder on gpioA and gpioB.
25 
26  When the encoder is turned the callback function is called.
27  */
28 
29  void re_cancel(void);
30  /*
31  This function releases the resources used by the decoder.
32  */
33 };
34 
35 #endif
void callback(uint32_t hash)
re_decoderCB_t mycallback
re_decoder(int gpioA, int gpioB, re_decoderCB_t callback)
void _pulse(int gpio, int level, uint32_t tick)
void re_cancel(void)
void(* re_decoderCB_t)(int)
static void _pulseEx(int gpio, int level, uint32_t tick, void *user)


cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Tue Oct 20 2020 03:35:57