MSCAN Updated

Dependents:   FBRLogger

Fork of MSCAN by Vesko Karadzhov

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MSCANHeader.h Source File

MSCANHeader.h

00001 #ifndef FBRDASH_MSCANHEADER_H
00002 #define FBRDASH_MSCANHEADER_H
00003 
00004 #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
00005 #define MSCAN_REQ   1   //a request for data, i.e., the value of a specific variable (and where to store the reply)
00006 #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,
00007 #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
00008 #define MSCAN_BURN  4   //a message to burn RAM data table into flash data table.
00009 
00010 #define MSCAN_ID_MS   0
00011 #define MSCAN_ID_DASH 1
00012 
00013 #define MSCAN_BLOCK_OUTPC   7
00014 
00015 class MSCANHeader
00016 {
00017     public:
00018         MSCANHeader();
00019         MSCANHeader(char to, char from, char type, char block, short offset);
00020         
00021         void parse(int id);
00022         int build();
00023         
00024         short var_offset;
00025         char msg_type;
00026         char from_id;
00027         char to_id;
00028         char var_blk;        
00029 };
00030 
00031 #endif