irrigation_system/software/include/lib/can_ids.h

41 lines
972 B
C

#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