MSCAN Updated

Dependents:   FBRLogger

Fork of MSCAN by Vesko Karadzhov

Committer:
intrinseca
Date:
Sun Feb 17 18:41:27 2013 +0000
Revision:
0:4bd0966a0718
move CAN comms from FBRDash to library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
intrinseca 0:4bd0966a0718 1 #ifndef FBRDASH_MSCANHEADER_H
intrinseca 0:4bd0966a0718 2 #define FBRDASH_MSCANHEADER_H
intrinseca 0:4bd0966a0718 3
intrinseca 0:4bd0966a0718 4 #define MSCAN_CMD 0 //a command to set a variable on the receiving processor to the value in the subsequent data part of the message, or
intrinseca 0:4bd0966a0718 5 #define MSCAN_REQ 1 //a request for data, i.e., the value of a specific variable (and where to store the reply)
intrinseca 0:4bd0966a0718 6 #define MSCAN_RSP 2 //a push-type message in reply to the destination processor's request for a variable value, the requested values are in the data buffer (&CAN_RB_DSR0) in the received message,
intrinseca 0:4bd0966a0718 7 #define MSCAN_XSUB 3 //a message to this processor from device 1 to execute subroutine immediately here (set flag if can execute in main loop), or
intrinseca 0:4bd0966a0718 8 #define MSCAN_BURN 4 //a message to burn RAM data table into flash data table.
intrinseca 0:4bd0966a0718 9
intrinseca 0:4bd0966a0718 10 #define MSCAN_ID_MS 0
intrinseca 0:4bd0966a0718 11 #define MSCAN_ID_DASH 1
intrinseca 0:4bd0966a0718 12
intrinseca 0:4bd0966a0718 13 #define MSCAN_BLOCK_OUTPC 7
intrinseca 0:4bd0966a0718 14
intrinseca 0:4bd0966a0718 15 class MSCANHeader
intrinseca 0:4bd0966a0718 16 {
intrinseca 0:4bd0966a0718 17 public:
intrinseca 0:4bd0966a0718 18 MSCANHeader();
intrinseca 0:4bd0966a0718 19 MSCANHeader(char to, char from, char type, char block, short offset);
intrinseca 0:4bd0966a0718 20
intrinseca 0:4bd0966a0718 21 void parse(int id);
intrinseca 0:4bd0966a0718 22 int build();
intrinseca 0:4bd0966a0718 23
intrinseca 0:4bd0966a0718 24 short var_offset;
intrinseca 0:4bd0966a0718 25 char msg_type;
intrinseca 0:4bd0966a0718 26 char from_id;
intrinseca 0:4bd0966a0718 27 char to_id;
intrinseca 0:4bd0966a0718 28 char var_blk;
intrinseca 0:4bd0966a0718 29 };
intrinseca 0:4bd0966a0718 30
intrinseca 0:4bd0966a0718 31 #endif