Go to the documentation of this file.00001 #ifndef IR_RX_HASHER_HPP
00002 #define IR_RX_HASHER_HPP
00003
00004 #include <stdint.h>
00005
00006 typedef void (*HasherCB_t)(uint32_t);
00007
00008 class Hasher
00009 {
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 int mygpio, mytimeout;
00026 HasherCB_t mycallback;
00027 int in_code;
00028 uint32_t hash_val;
00029 int edges;
00030 uint32_t t1, t2, t3, t4;
00031
00032 void _hash(int old_val, int new_val);
00033 void _callback(int gpio, int level, uint32_t tick);
00034
00035
00036 static void _callbackExt(int gpio, int level, uint32_t tick, void *user);
00037
00038 public:
00039
00040 Hasher(int gpio, HasherCB_t callback, int timeout=5);
00041 };
00042
00043 #endif
00044