Gabor Feher
/
BMWE90-InstrumentCluster
Making a BMW E90 instrument cluster alive for demonstration purposes
Embed:
(wiki syntax)
Show/hide line numbers
T15Msg.h
00001 #ifndef T15MSG_H 00002 #define T15MSG_H 00003 00004 #include "mbed.h" 00005 00006 class T15Msg { 00007 00008 char counter1; 00009 char counter2; 00010 00011 bool enginerun; 00012 bool ignition; 00013 bool clutch; 00014 00015 char enginestate; 00016 int statecounter; 00017 bool sstart; 00018 bool sstop; 00019 00020 char data[5]; 00021 00022 void updateData(char resetc1 = 0x10); 00023 void updateState(); 00024 00025 public: 00026 T15Msg(); 00027 00028 bool sendMessage(CAN *can); 00029 bool start(); 00030 bool stop(); 00031 }; 00032 00033 #endif 00034 00035 // About T15 00036 00037 /* 00038 00039 uint8_t t15_counter; // a counter, where hi and low part counts separately, and one number is missing 00040 // E.g: 64, 75, 86, 97, A8, B9, CA, DB, FC, 0D, 1E, 20, 31, 42, 53, 64 ... 00041 // high bit counter tends to jump on key/ignition 'events' 00042 // T15 00043 00044 0: 00h engine off, 40h engine off (key is being inserted), 41h engine off (key in position 1 also this value when engine is stopped) 00045 45h engine running. (also key to position 2), 55h engine is turning on (from key or auto stop start) 00046 1: 00h key not in slot, 40h key in slot 00047 2[8765]: key||engine: clutch: 0x6/0x2, no key,no engine: 0xD 00048 2[4321]: 1: engine running, 2: ignition 00049 3[8]: engine running 00050 3[4321]: 1111 00051 4: timer (1.4 sec) 00052 00053 Sent in every 100ms 00054 */
Generated on Sat Jul 23 2022 09:24:36 by 1.7.2