client
pigpio
EXAMPLES
CPP
WIEGAND_CODE
wiegand.hpp
Go to the documentation of this file.
1
#ifndef WIEGAND_HPP
2
#define WIEGAND_HPP
3
4
#include <stdint.h>
5
6
typedef
void (*
WiegandCB_t
)(int, uint32_t);
7
8
class
Wiegand
9
{
10
int
mygpio_0
,
mygpio_1
,
mytimeout
,
in_code
,
bits
;
11
12
WiegandCB_t
mycallback
;
13
14
uint32_t
num
;
15
16
uint32_t
code_timeout
;
17
18
void
_cb
(
int
gpio,
int
level, uint32_t tick);
19
20
/* Need a static callback to link with C. */
21
static
void
_cbEx
(
int
gpio,
int
level, uint32_t tick,
void
*user);
22
23
public
:
24
25
Wiegand
(
int
gpio_0,
int
gpio_1,
WiegandCB_t
callback
,
int
timeout=5);
26
/*
27
This function establishes a Wiegand decoder on gpio_0 and gpio_1.
28
29
A gap of timeout milliseconds without a new bit indicates
30
the end of a code.
31
32
When the code is ended the callback function is called with the code
33
bit length and value.
34
*/
35
36
void
cancel
(
void
);
37
/*
38
This function releases the resources used by the decoder.
39
*/
40
};
41
42
#endif
43
Wiegand::_cbEx
static void _cbEx(int gpio, int level, uint32_t tick, void *user)
Definition:
wiegand.cpp:95
Wiegand::mycallback
WiegandCB_t mycallback
Definition:
wiegand.hpp:12
Wiegand::mytimeout
int mytimeout
Definition:
wiegand.hpp:10
Wiegand::mygpio_1
int mygpio_1
Definition:
wiegand.hpp:10
Wiegand::code_timeout
uint32_t code_timeout
Definition:
wiegand.hpp:16
Wiegand::in_code
int in_code
Definition:
wiegand.hpp:10
Wiegand
Definition:
wiegand.hpp:8
callback
void callback(uint32_t hash)
Definition:
test_ir_hasher.c:23
Wiegand::mygpio_0
int mygpio_0
Definition:
wiegand.hpp:10
Wiegand::bits
int bits
Definition:
wiegand.hpp:10
Wiegand::cancel
void cancel(void)
Definition:
wiegand.cpp:107
WiegandCB_t
void(* WiegandCB_t)(int, uint32_t)
Definition:
wiegand.hpp:6
Wiegand::_cb
void _cb(int gpio, int level, uint32_t tick)
Definition:
wiegand.cpp:34
Wiegand::Wiegand
Wiegand(int gpio_0, int gpio_1, WiegandCB_t callback, int timeout=5)
Definition:
wiegand.cpp:5
Wiegand::num
uint32_t num
Definition:
wiegand.hpp:14
cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Fri Aug 2 2024 09:40:57