FreeEMS  0.2.0-SNAPSHOT-282-g9efc524
packetTypes.h
Go to the documentation of this file.
1 /* FreeEMS - the open source engine management system
2  *
3  * Copyright 2008-2014 Fred Cooke
4  *
5  * This file is part of the FreeEMS project.
6  *
7  * FreeEMS software is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * FreeEMS software is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with any FreeEMS software. If not, see http://www.gnu.org/licenses/
19  *
20  * We ask that if you make any changes to this file you email them upstream to
21  * us at admin(at)diyefi(dot)org or, even better, fork the code on github.com!
22  *
23  * Thank you for choosing FreeEMS to run your engine!
24  */
25 
26 
27 /** @file
28  *
29  * @ingroup allHeaders
30  */
31 
32 
33 /* Header file multiple inclusion protection courtesy eclipse Header Template */
34 /* and http://gcc.gnu.org/onlinedocs/gcc-3.1.1/cpp/ C pre processor manual */
35 #ifndef FILE_PACKET_TYPES_H_SEEN
36 #define FILE_PACKET_TYPES_H_SEEN
37 
38 
39 /*&&&&&&&&&&&&&&&&&&&& Payload Type ID Name Value Pairs &&&&&&&&&&&&&&&&&&&&*/
40 
41 /* Please note, requests use even ID numbers and their matching responses use */
42 /* the odd number immediately above the original request ID. There are a few */
43 /* examples where either a request is not required or a response not sent. In */
44 /* such cases the odd ID may be used for an packet asyncronously sent from */
45 /* the EMS to the PC. These will be well commented when present. */
46 
47 
48 /*&&&&&&&&&&&&&&&&&&&&&&&& Protocol Payload Type IDs &&&&&&&&&&&&&&&&&&&&&&&*/
49 
50 /* Firmware Independent functions */
51 #define requestInterfaceVersion 0x0000
52 #define requestFirmwareVersion 0x0002
53 #define requestMaxPacketSize 0x0004
54 #define requestEchoPacketReturn 0x0006
55 #define requestSoftSystemReset 0x0008 /* System comes up fresh, so no response */
56 //efine replytoSoftSystemReset 0x0009 /* This is reserved */
57 #define requestHardSystemReset 0x000A /* System comes up fresh, so no response */
58 //efine replytoHardSystemReset 0x000B /* This is reserved */
59 #define requestReInitOfSystem 0x000C /* EXPERIMENTAL, currently responds like normal */
60 //efine replytoReInitOfSystem 0x000D /* This is reserved */
61 
62 
63 //efine requestAsyncDebugInfo 0x000E /* This is reserved */
64 #define asyncDebugInfoPacket 0x000F /* NOTE : Unrequested debug information packet */
65 //efine requestAsyncErrorCode 0x0010 /* This is reserved */
66 #define asyncErrorCodePacket 0x0011 /* NOTE : Unrequested error event code packet */
67 
68 
69 /*&&&&&&&&&&&&&&&&&&&&&&&& Firmware Payload Type IDs &&&&&&&&&&&&&&&&&&&&&&&*/
70 
71 /* Data block manipulation */
72 #define updateBlockInRAM 0x0100
73 #define updateBlockInFlash 0x0102
74 #define retrieveBlockFromRAM 0x0104
75 #define retrieveBlockFromFlash 0x0106
76 #define burnBlockFromRamToFlash 0x0108
77 
78 /* Datalog request packets */
79 #define requestDatalogPacket 0x0190
80 #define responseBasicDatalog 0x0191 /* Defined because it can be used both synchronously and asynchronously */
81 #define requestByteLADatalog 0x0196 // logic analyser
82 #define responseByteLADatalog 0x0197 // logic analyser
83 
84 /* Generic memory grabber for debugging */
85 #define retrieveArbitraryMemory 0x0258
86 
87 /* Experimental unit testing interface */
88 #define requestUnitTestOverSerial 0x6666
89 
90 // Bench testing init calls
91 #define startBenchTestSequence 0x8888
92 
93 // Data interrogation gold
94 #define retrieveListOfLocationIDs 0xDA5E ///< Retrieves a list of all LocationIDs available for interrogation
95 #define retrieveLocationIDDetails 0xF8E0 ///< Retrieves the object containing details for a LocationID
96 #define requestDecoderName 0xEEEE ///< Makes interrogation unique within a single build @see decoderName
97 #define requestFirmwareBuildDate 0xEEF0 ///< @copydoc buildTimeAndDate
98 #define requestCompilerVersion 0xEEF2 ///< @copydoc compilerVersion
99 #define requestOperatingSystem 0xEEF4 ///< @copydoc operatingSystem
100 #define requestBuiltByName 0xEEF6 ///< @copydoc builtByName
101 #define requestSupportEmail 0xEEF8 ///< @copydoc supportEmail
102 #define clearCountersAndFlagsToZero 0xFFF0 ///< Clean slate to perform tests of any type. Clears various flags too, should not affect running
103 
104 // DEPRECATED TODO Remove once certain no users exist
105 #define adjustMainTableCell 0x012C
106 #define adjustMainTableRPMAxis 0x012E
107 #define adjustMainTableLoadAxis 0x0130
108 #define adjust2dTableAxis 0x0132
109 #define adjust2dTableCell 0x0134
110 #define setAsyncDatalogType 0x0194
111 
112 #else
113  /* let us know if we are being untidy with headers */
114  #warning "Header file PACKET_TYPES_H seen before, sort it out!"
115 /* end of the wrapper ifdef from the very top */
116 #endif