-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathebus-common.h
65 lines (50 loc) · 1.78 KB
/
ebus-common.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
58
59
60
61
62
63
64
65
/*
* Copyright (C) Roland Jax 2012-2013 <[email protected]>
* crc calculations from http://www.mikrocontroller.net/topic/75698
*
* This file is part of ebusd.
*
* ebusd is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ebusd is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ebusd. If not, see http://www.gnu.org/licenses/.
*/
/**
* @file ebus-common.h
* @brief ebus common defines
* @author [email protected]
* @version 0.1
*/
#ifndef EBUS_COMMON_H_
#define EBUS_COMMON_H_
#define EBUS_SYN 0xAA
#define EBUS_SYN_ESC_A9 0xA9
#define EBUS_SYN_ESC_01 0x01
#define EBUS_SYN_ESC_00 0x00
#define EBUS_ACK 0x00
#define EBUS_NAK 0xFF
#define EBUS_QQ 0xFF
#define EBUS_GET_RETRY 3
#define EBUS_GET_RETRY_MAX 10
#define EBUS_SKIP_ACK 1
#define EBUS_MAX_WAIT 4000
#define EBUS_SEND_RETRY 2
#define EBUS_SEND_RETRY_MAX 10
#define EBUS_PRINT_SIZE 30
#define EBUS_MSG_BROADCAST 1
#define EBUS_MSG_MASTER_MASTER 2
#define EBUS_MSG_MASTER_SLAVE 3
#define SERIAL_DEVICE "/dev/ttyUSB0"
#define SERIAL_BAUDRATE B2400
#define SERIAL_BUFSIZE 100
#define CMD_DATA_SIZE 50 /* 5+16+3+16+2 = 42 || 256 */
enum enum_bool {UNSET = -1, NO, YES};
#endif /* EBUS_COMMON_H_ */