feat(can): Add CAN ID definitions
This commit introduces the CAN ID definitions for the irrigation system. It defines the structure of the CAN IDs and macros for priority and function. Signed-off-by: Eduard Iten <eduard@iten.pro>
This commit is contained in:
parent
d92a1d9533
commit
0c4a728c17
|
|
@ -0,0 +1,41 @@
|
||||||
|
#ifndef CAN_IDS_H
|
||||||
|
#define CAN_IDS_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
CAN ID structure for the irrigation system.
|
||||||
|
PPP FFFF NNNN
|
||||||
|
|
||||||
|
PPP: Priority
|
||||||
|
000: Network segment
|
||||||
|
001: Critical error
|
||||||
|
010: Commands
|
||||||
|
100: Status messages
|
||||||
|
110: measurements
|
||||||
|
111: Info messages
|
||||||
|
|
||||||
|
FFFF: Function
|
||||||
|
0001: Valve Commands
|
||||||
|
0010: Valve States
|
||||||
|
0011: IO Commands
|
||||||
|
0100: IO States
|
||||||
|
0101: Measurements
|
||||||
|
0111: Sysem Functions (e.g. reset, firmware update)
|
||||||
|
|
||||||
|
NNNN: Node ID
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define CAN_ID_PRIORITY_NETWORK 0x000
|
||||||
|
#define CAN_ID_PRIORITY_CRITICAL_ERROR 0x100
|
||||||
|
#define CAN_ID_PRIORITY_COMMANDS 0x200
|
||||||
|
#define CAN_ID_PRIORITY_STATUS 0x400
|
||||||
|
#define CAN_ID_PRIORITY_MEASUREMENTS 0x600
|
||||||
|
#define CAN_ID_PRIORITY_INFO 0x700
|
||||||
|
|
||||||
|
#define CAN_ID_FUNCTION_VALVE_COMMANDS 0x010
|
||||||
|
#define CAN_ID_FUNCTION_VALVE_STATES 0x020
|
||||||
|
#define CAN_ID_FUNCTION_IO_COMMANDS 0x030
|
||||||
|
#define CAN_ID_FUNCTION_IO_STATES 0x040
|
||||||
|
#define CAN_ID_FUNCTION_MEASUREMENTS 0x050
|
||||||
|
#define CAN_ID_FUNCTION_SYSTEM_FUNCTIONS 0x070
|
||||||
|
|
||||||
|
#endif // CAN_IDS_H
|
||||||
Loading…
Reference in New Issue