-
Notifications
You must be signed in to change notification settings - Fork 0
/
iocard.h
58 lines (54 loc) · 1.31 KB
/
iocard.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef IOCARD_H
#define IOCARD_H
typedef struct {
uint8_t sirene1:1;
uint8_t flash1:1;
uint8_t sirene2:1;
uint8_t flash2:1;
uint8_t door_lock1:1;
uint8_t door_lock2:1;
uint8_t keypad:1;
uint8_t ir_detector:1;
} __attribute__ ((__packed__)) iocard_output_t;
typedef struct {
uint8_t version; /* Version of this struct, for future use */
uint8_t dip_switch; /* DIP switch value */
union {
struct {
uint8_t door1:1;
uint8_t door2:1;
uint8_t balcony:1;
uint8_t _unused:5;
} digital_in;
uint8_t digital_in_byte;
};
union {
iocard_output_t digital_out;
uint8_t digital_out_byte;
};
union {
iocard_output_t over_current;
uint8_t over_current_byte;
};
union {
struct {
uint16_t sirene1;
uint16_t flash1;
uint16_t sirene2;
uint16_t flash2;
uint16_t door_lock2;
uint16_t door_lock1;
uint16_t keypad_pwr;
uint16_t ir_detector_pwr;
uint16_t supply_12v;
uint16_t tamper_loop;
uint16_t ir_loop1;
uint16_t ir_loop2;
uint16_t int_temp; /* Internal CPU temperature */
uint16_t int_voltage; /* Internal VCC voltage */
uint16_t int_bandgap; /* Internal bandgap voltage */
} analog_in;
uint16_t analog_in_array[15];
};
} __attribute__ ((__packed__)) iocard_data_t;
#endif/*IOCARD_H*/