rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
can_dash.cpp
Go to the documentation of this file.
1/**
2 * @file can_dash.cpp
3 *
4 * This file handles transmission of ECU data to various OE dashboards.
5 *
6 * @date Mar 19, 2020
7 * @author Matthew Kennedy, (c) 2020
8 */
9
10#include "pch.h"
11
12#if EFI_CAN_SUPPORT
13#include "can_dash.h"
14#include "can_dash_ms.h"
15#include "can_dash_nissan.h"
16#include "can_dash_haltech.h"
17#include "board_overrides.h"
18#include "can_bmw.h"
19#include "can_vag.h"
20#include "can_dash_honda.h"
21
22#include "rusefi_types.h"
23#include "rtc_helper.h"
24#include "fuel_math.h"
25
26// CAN Bus ID for broadcast
27#define CAN_FIAT_MOTOR_INFO 0x561
28#define CAN_MAZDA_RX_RPM_SPEED 0x201
29#define CAN_MAZDA_RX_STEERING_WARNING 0x300
30#define CAN_MAZDA_RX_STATUS_1 0x212
31#define CAN_MAZDA_RX_STATUS_2 0x420
32
33//w202 DASH
34#define W202_STAT_1 0x308 /* _20ms cycle */
35#define W202_STAT_2 0x608 /* _100ms cycle */
36#define W202_ALIVE 0x210 /* _200ms cycle */
37#define W202_STAT_3 0x310 /* _200ms cycle */
38
39//BMW E90 DASH
40#define E90_ABS_COUNTER 0x0C0
41#define E90_SEATBELT_COUNTER 0x0D7
42#define E90_T15 0x130
43#define E90_RPM 0x175
44#define E90_BRAKE_COUNTER 0x19E
45#define E90_SPEED 0x1A6
46#define E90_TEMP 0x1D0
47#define E90_GEAR 0x1D2
48#define E90_FUEL 0x349
49#define E90_EBRAKE 0x34F
50#define E90_TIME 0x39E
51
52static time_msecs_t mph_timer;
53static time_msecs_t mph_ctr;
54
55/**
56 * https://docs.google.com/spreadsheets/d/1IkP05ODpjNt-k4YQLYl58_TNlN9U4IBu5z7i0BPVEM4
57 */
58#define GENESIS_COUPLE_RPM_316 0x316
59#define GENESIS_COUPLE_COOLANT_329 0x329
60#define GENESIS_COUPLE_SENSORS_382 0x382
61// when A/C compressor is allowed to be on, these values need to be sent so the A/C panel activates the compressor
62#define GENESIS_COUPLE_AC_ENABLE_18F 0x18F
63
64
65static uint8_t rpmcounter;
66static uint8_t seatbeltcnt;
67static uint8_t abscounter = 0xF0;
68static uint8_t brakecnt_1 = 0xF0, brakecnt_2 = 0xF0;
70static uint16_t mph_counter = 0xF000;
71static bool cluster_time_set;
72
73constexpr uint8_t e90_temp_offset = 49;
74
75// todo: those forward declarations are out of overall code style
76void canDashboardFiat(CanCycle cycle);
77void canMazdaRX8(CanCycle cycle);
78void canDashboardW202(CanCycle cycle);
81void canDashboardAim(CanCycle cycle);
82
83//BMW Dashboard
84//todo: we use 50ms fixed cycle, trace is needed to check for correct period
85static void canDashboardBmwE46(CanCycle cycle) {
86
87 if (cycle.isInterval(CI::_10ms)) {
88 {
89 CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_RPM);
90 msg[0] = 0x05; // ASC message
91 msg[1] = 0x0C; // Indexed Engine Torque in % of C_TQ_STND TBD
92 msg.setShortValue((int) (Sensor::getOrZero(SensorType::Rpm) * 6.4), 2);
93 msg[4] = 0x0C;
94 msg[5] = 0x15;
95 msg[6] = 0x00;
96 msg[7] = 0x35;
97 }
98
99 {
100 CanTxMessage msg(CanCategory::NBC, CAN_BMW_E46_DME2);
101 msg[0] = 0x11;
102 msg[1] = (Sensor::getOrZero(SensorType::Clt) + 48.373) / 0.75;
103 msg[2] = 0x00; // baro sensor
104 msg[3] = 0x08;
105 msg[4] = 0x00; // TPS_VIRT_CRU_CAN, not used.
106 msg[5] = 0x00; // TPS out, but we set to 0 just in case.
107 msg[6] = 0x00; // brake system status Ok.
108 msg[7] = 0x00; // not used
109 }
110 }
111}
112
113//todo: we use 50ms fixed cycle, trace is needed to check for correct period
115 if (cycle.isInterval(CI::_50ms)) {
116 {
117 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STEERING_WARNING);
118 // todo: something needs to be set here? see http://rusefi.com/wiki/index.php?title=Vehicle:Mazda_Rx8_2004
119 }
120
121 {
122 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_RPM_SPEED);
123
125
126 // todo: LSB+SWAP? lol, that's MSB?
128 msg.setShortValue(0xFFFF, 2);
129 // todo: LSB+SWAP? lol, that's MSB?
130 msg.setShortValue(SWAP_UINT16((int )(100 * kph + 10000)), 4);
131 msg.setShortValue(0, 6);
132 }
133
134 {
135 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STATUS_1);
136 msg[0] = 0xFE; //Unknown
137 msg[1] = 0xFE; //Unknown
138 msg[2] = 0xFE; //Unknown
139 msg[3] = 0x34; //DSC OFF in combo with byte 5 Live data only seen 0x34
140 msg[4] = 0x00; // B01000000; // Brake warning B00001000; //ABS warning
141 msg[5] = 0x40; // TCS in combo with byte 3
142 msg[6] = 0x00; // Unknown
143 msg[7] = 0x00; // Unused
144 }
145
146 {
147 CanTxMessage msg(CanCategory::NBC, CAN_MAZDA_RX_STATUS_2);
149 msg[0] = (uint8_t)(clt.value_or(0) + 69); //temp gauge //~170 is red, ~165 last bar, 152 centre, 90 first bar, 92 second bar
150 // TODO: fixme!
151 //msg[1] = ((int16_t)(engine->engineState.vssEventCounter*(engineConfiguration->vehicleSpeedCoef*0.277*2.58))) & 0xff;
152 msg[2] = 0x00; // unknown
153 msg[3] = 0x00; //unknown
154 msg[4] = 0x01; //Oil Pressure (not really a gauge)
155 msg[5] = 0x00; //check engine light
156 msg[6] = 0x00; //Coolant, oil and battery
157 if ((Sensor::getOrZero(SensorType::Rpm)>0) && (Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE)<13)) {
158 msg.setBit(6, 6); // battery light
159 }
160 if (!clt.Valid || clt.Value > 105) {
161 // coolant light, 101 - red zone, light means its get too hot
162 // Also turn on the light in case of sensor failure
163 msg.setBit(6, 1);
164 }
165 //oil pressure warning lamp bit is 7
166 msg[7] = 0x00; //unused
167 }
168 }
169
170}
171
173 if (cycle.isInterval(CI::_50ms)) {
174 {
175 //Fiat Dashboard
176 CanTxMessage msg(CanCategory::NBC, CAN_FIAT_MOTOR_INFO);
177 msg.setShortValue((int) (Sensor::getOrZero(SensorType::Clt) - 40), 3); //Coolant Temp
179 }
180 }
181}
182
184 if (cycle.isInterval(CI::_10ms)) {
185 {
186 // https://github.com/commaai/opendbc/blob/57c8340a180dd8c75139b18050eb17c72c9cb6e4/vw_golf_mk4.dbc#L394
187 //VAG Dashboard
188 CanTxMessage msg(CanCategory::NBC, CAN_VAG_Motor_1);
190 }
191
193
194 {
195 CanTxMessage msg(CanCategory::NBC, CAN_VAG_Motor_2);
196 msg.setShortValue((int) ((clt + 48.373) / 0.75), 1); //Coolant Temp
197 }
198
199 {
200 CanTxMessage msg(CanCategory::NBC, CAN_VAG_CLT_V2);
201 msg.setShortValue((int) ((clt + 48.373) / 0.75), 4); //Coolant Temp
202 }
203
204 {
205 CanTxMessage msg(CanCategory::NBC, CAN_VAG_IMMO);
206 msg.setShortValue(0x80, 1);
207 }
208 }
209}
210
212 if (cycle.isInterval(CI::_20ms)) {
213 {
214 CanTxMessage msg(CanCategory::NBC, W202_STAT_1);
215 msg[0] = 0x08; // Unknown
217 msg[3] = 0x00; // 0x01 - tank blink, 0x02 - EPC
218 msg[4] = 0x00; // Unknown
219 msg[5] = 0x00; // Unknown
220 msg[6] = 0x00; // Unknown - oil info
221 msg[7] = 0x00; // Unknown - oil info
222 }
223 }
224
225 if (cycle.isInterval(CI::_100ms)) {
226 {
227 CanTxMessage msg(CanCategory::NBC, W202_STAT_2); //dlc 7
228 msg[0] = (int)(Sensor::getOrZero(SensorType::Clt) + 40); // CLT -40 offset
229 msg[1] = 0x3D; // TBD
230 msg[2] = 0x63; // Const
231 msg[3] = 0x41; // Const
232 msg[4] = 0x00; // Unknown
233 msg[5] = 0x05; // Const
234 msg[6] = 0x50; // TBD
235 msg[7] = 0x00; // Unknown
236 }
237 }
238
239 if (cycle.isInterval(CI::_200ms)) {
240 {
241 CanTxMessage msg(CanCategory::NBC, W202_ALIVE);
242 msg[0] = 0x0A; // Const
243 msg[1] = 0x18; // Const
244 msg[2] = 0x00; // Const
245 msg[3] = 0x00; // Const
246 msg[4] = 0xC0; // Const
247 msg[5] = 0x00; // Const
248 msg[6] = 0x00; // Const
249 msg[7] = 0x00; // Const
250 }
251
252 {
253 CanTxMessage msg(CanCategory::NBC, W202_STAT_3);
254 msg[0] = 0x00; // Const
255 msg[1] = 0x00; // Const
256 msg[2] = 0x6D; // TBD
257 msg[3] = 0x7B; // Const
258 msg[4] = 0x21; // TBD
259 msg[5] = 0x07; // Const
260 msg[6] = 0x33; // Const
261 msg[7] = 0x05; // Const
262 }
263 }
264}
265
267 if (cycle.isInterval(CI::_50ms)) {
268 {
269 CanTxMessage msg(CanCategory::NBC, GENESIS_COUPLE_RPM_316, 8);
270 msg.setShortValueMsb(Sensor::getOrZero(SensorType::Rpm) * 4, /*offset*/ 3);
271 }
272 {
273 CanTxMessage msg(CanCategory::NBC, GENESIS_COUPLE_COOLANT_329, 8);
275 msg[1] = clt;
276 }
277 }
278}
279
280/**
281 * https://docs.google.com/spreadsheets/d/1XMfeGlhgl0lBL54lNtPdmmFd8gLr2T_YTriokb30kJg
282 */
284 if (cycle.isInterval(CI::_50ms)) {
285
286 { // 'turn-on'
287 CanTxMessage msg(CanCategory::NBC, 0x3C0, 4);
288 // ignition ON
289 msg[2] = 3;
290 }
291
292 { //RPM
293 CanTxMessage msg(CanCategory::NBC, 0x107, 8);
294 msg.setShortValue(Sensor::getOrZero(SensorType::Rpm) / 3.5, /*offset*/ 3);
295 }
296 }
297}
298
299static void canDashboardBmwE90(CanCycle cycle) {
300
301 if (cycle.isInterval(CI::_50ms)) {
302
303 { //T15 'turn-on'
304 CanTxMessage msg(CanCategory::NBC, E90_T15, 5);
305 msg[0] = 0x45;
306 msg[1] = 0x41;
307 msg[2] = 0x61;
308 msg[3] = 0x8F;
309 msg[4] = 0xFC;
310 }
311
312 { //Ebrake light
313 CanTxMessage msg(CanCategory::OBD, E90_EBRAKE, 2);
314 msg[0] = 0xFD;
315 msg[1] = 0xFF;
316 }
317
318 { //RPM
319 rpmcounter++;
320 if (rpmcounter > 0xFE)
321 rpmcounter = 0xF0;
322 CanTxMessage msg(CanCategory::OBD, E90_RPM, 3);
323 msg[0] = rpmcounter;
325 }
326
327 { //oil & coolant temp (all in C, despite gauge being F)
328 tmp_cnt++;
329 if (tmp_cnt >= 0x0F)
330 tmp_cnt = 0x00;
331 CanTxMessage msg(CanCategory::OBD, E90_TEMP, 8);
332 msg[0] = (int)(Sensor::getOrZero(SensorType::Clt) + e90_temp_offset); //coolant
333 msg[1] = (int)(Sensor::getOrZero(SensorType::AuxTemp1) + e90_temp_offset); //oil (AuxTemp1)
334 msg[2] = tmp_cnt;
335 msg[3] = 0xC8;
336 msg[4] = 0xA7;
337 msg[5] = 0xD3;
338 msg[6] = 0x0D;
339 msg[7] = 0xA8;
340 }
341 }
342
343 if (cycle.isInterval(CI::_100ms)) {
344 {
345 //Seatbelt counter
346 seatbeltcnt++;
347 if (seatbeltcnt > 0xFE)
348 seatbeltcnt = 0x00;
349 CanTxMessage msg(CanCategory::NBC, E90_SEATBELT_COUNTER, 2);
350 msg[0] = seatbeltcnt;
351 msg[1] = 0xFF;
352 }
353
354 {
355 //Brake counter 100ms
356 brakecnt_1 += 16;
357 brakecnt_2 += 16;
358 if (brakecnt_1 > 0xEF)
359 brakecnt_1 = 0x0F;
360 if (brakecnt_2 > 0xF0)
361 brakecnt_2 = 0xA0;
362 CanTxMessage msg(CanCategory::NBC, E90_BRAKE_COUNTER, 8);
363 msg[0] = 0x00;
364 msg[1] = 0xE0;
365 msg[2] = brakecnt_1;
366 msg[3] = 0xFC;
367 msg[4] = 0xFE;
368 msg[5] = 0x41;
369 msg[6] = 0x00;
370 msg[7] = brakecnt_2;
371 }
372
373 { //ABS counter
374 abscounter++;
375 if (abscounter > 0xFE)
376 abscounter = 0xF0;
377 CanTxMessage msg(CanCategory::NBC, E90_ABS_COUNTER, 2);
378 msg[0] = abscounter;
379 msg[1] = 0xFF;
380 }
381
382 { //Fuel gauge
383 CanTxMessage msg(CanCategory::NBC, E90_FUEL, 5); //fuel gauge
384 msg[0] = 0x76;
385 msg[1] = 0x0F;
386 msg[2] = 0xBE;
387 msg[3] = 0x1A;
388 msg[4] = 0x00;
389 }
390
391 { //Gear indicator/counter
392 gear_cnt++;
393 if (gear_cnt >= 0x0F)
394 gear_cnt = 0x00;
395 CanTxMessage msg(CanCategory::NBC, E90_GEAR, 6);
396 msg[0] = 0x78;
397 msg[1] = 0x0F;
398 msg[2] = 0xFF;
399 msg[3] = (gear_cnt << 4) | 0xC;
400 msg[4] = 0xF1;
401 msg[5] = 0xFF;
402 }
403
404 { //E90_SPEED
405 auto vehicleSpeed = Sensor::getOrZero(SensorType::VehicleSpeed);
406 float mph = vehicleSpeed * 0.6213712;
407 mph_ctr = ((TIME_I2MS(chVTGetSystemTime()) - mph_timer) / 50);
408 mph_a = (mph_ctr * mph / 2);
411 mph_counter += mph_ctr * 100;
412 if(mph_counter >= 0xFFF0)
413 mph_counter = 0xF000;
414 mph_timer = TIME_I2MS(chVTGetSystemTime());
415 CanTxMessage msg(CanCategory::NBC, E90_SPEED, 8);
416 msg.setShortValue(mph_2a, 0);
417 msg.setShortValue(mph_2a, 2);
418 msg.setShortValue(mph_2a, 4);
419 msg[6] = mph_counter & 0xFF;
420 // todo: what are we packing into what exactly? note the '| 0xF0'
421 msg[7] = (mph_counter >> 8) | 0xF0;
422 }
423 }
424
425 {
426 if (!cluster_time_set) {
427#if EFI_RTC
428 efidatetime_t dateTime = getRtcDateTime();
429#else // EFI_RTC
430 efidatetime_t dateTime = {
431 .year = 0, .month = 0, .day = 0,
432 .hour = 0, .minute = 0, .second = 0,
433 };
434#endif // EFI_RTC
435 CanTxMessage msg(CanCategory::NBC, E90_TIME, 8);
436 msg[0] = dateTime.hour;
437 msg[1] = dateTime.minute;
438 msg[2] = dateTime.second;
439 msg[3] = dateTime.day;
440 msg[4] = (dateTime.month << 4) | 0x0F;
441 msg[5] = dateTime.year & 0xFF;
442 msg[6] = (dateTime.year >> 8) | 0xF0; // collides CAN dash at 4096!
443 msg[7] = 0xF2;
445 }
446 }
447}
448
449//Based on AIM can protocol
450//https://www.aimtechnologies.com/support/racingecu/AiM_CAN_101_eng.pdf
451
452struct Aim5f0 {
453 scaled_channel<uint16_t, 1> Rpm;
454 scaled_channel<uint16_t, 650> Tps;
455 scaled_channel<uint16_t, 650> Pps;
456 scaled_channel<uint16_t, 100> Vss;
457};
458
465
466struct Aim5f1 {
467 scaled_channel<uint16_t, 10> WheelSpeedFR;
468 scaled_channel<uint16_t, 10> WheelSpeedFL;
469 scaled_channel<uint16_t, 10> WheelSpeedRR;
470 scaled_channel<uint16_t, 10> WheelSpeedRL;
471};
472
473static void populateFrame(Aim5f1& msg) {
474 // We don't handle wheel speed, just set to 0?
475 msg.WheelSpeedFR = 0;
476 msg.WheelSpeedFL = 0;
477 msg.WheelSpeedRR = 0;
478 msg.WheelSpeedRL = 0;
479}
480
481struct Aim5f2 {
482 scaled_channel<uint16_t, 190> Iat;
483 scaled_channel<uint16_t, 190> Ect;
484 scaled_channel<uint16_t, 190> FuelT;
485 scaled_channel<uint16_t, 190> OilT;
486};
487
488static void populateFrame(Aim5f2& msg) {
489 msg.Iat = Sensor::getOrZero(SensorType::Iat) + 45;
490 msg.Ect = Sensor::getOrZero(SensorType::Clt) + 45;
493}
494
495struct Aim5f3 {
496 scaled_channel<uint16_t, 10> Map;
497 scaled_channel<uint16_t, 10> Baro;
498 scaled_channel<uint16_t, 1000> OilP;
499 scaled_channel<uint16_t, 20> FuelP;
500};
501
502static void populateFrame(Aim5f3& msg) {
503 // MAP/Baro are sent in millibar -> 10 millibar per kpa
504 msg.Map = 10 * Sensor::getOrZero(SensorType::Map);
506
507 // Oil/Fuel P use bar -> 100 kpa per bar
510}
511
512struct Aim5f4 {
513 scaled_channel<uint16_t, 10000> Boost;
514 scaled_channel<uint16_t, 3200> Vbat;
515 scaled_channel<uint16_t, 10> FuelConsumptionLH;
516 scaled_channel<int16_t, 1> Gear;
517};
518
519static void populateFrame(Aim5f4& msg) {
520 float deltaKpa = Sensor::getOrZero(SensorType::Map)
521 - Sensor::get(SensorType::BarometricPressure).value_or(STD_ATMOSPHERE);
522 float boostBar = deltaKpa / 100;
523
524#ifdef MODULE_ODOMETER
525 float gPerSecond = engine->module<TripOdometer>()->getConsumptionGramPerSecond();
526#else
527 float gPerSecond = 0;
528#endif // MODULE_ODOMETER
529
530 float gPerHour = gPerSecond * 3600.0f;
531 float literPerHour = gPerHour * 0.00139f;
532
533 msg.Boost = boostBar;
535 msg.FuelConsumptionLH = 10 * literPerHour;
537}
538
539struct Aim5f5 {
540 scaled_channel<uint16_t, 1> ShiftFlag;
541 scaled_channel<uint16_t, 1> GearTime;
542 scaled_channel<uint16_t, 1> TpsV;
543 scaled_channel<uint16_t, 100> FuelLevel;
544};
545
546static void populateFrame(Aim5f5& msg) {
548
549 // Dunno what to do with these
550 msg.ShiftFlag = 0;
551 msg.GearTime = 0;
552 msg.TpsV = 0;
553}
554
555struct Aim5f6 {
556 scaled_channel<uint16_t, 2000> Lambda1;
557 scaled_channel<uint16_t, 2000> Lambda2;
558 scaled_channel<uint16_t, 10> LambdaTemp1;
559 scaled_channel<uint16_t, 10> LambdaTemp2;
560};
561
562static void populateFrame(Aim5f6& msg) {
565 msg.LambdaTemp1 = 0;
566 msg.LambdaTemp2 = 0;
567}
568
569struct Aim5f7 {
570 scaled_channel<uint16_t, 10> LambdaErr1;
571 scaled_channel<uint16_t, 10> LambdaErr2;
572 scaled_channel<uint16_t, 2000> LambdaTarget1;
573 scaled_channel<uint16_t, 2000> LambdaTarget2;
574};
575
576static void populateFrame(Aim5f7& msg) {
577#if EFI_ENGINE_CONTROL
578 // We don't handle wheel speed, just set to 0?
579 msg.LambdaErr1 = 0;
580 msg.LambdaErr2 = 0;
581 // both targets are the same for now
582 msg.LambdaTarget1 = (float)engine->fuelComputer.targetLambda;
583 msg.LambdaTarget2 = (float)engine->fuelComputer.targetLambda;
584#endif // EFI_ENGINE_CONTROL
585}
586
588 if (!cycle.isInterval(CI::_10ms)) {
589 return;
590 }
591
593
594 transmitStruct<Aim5f0>(CanCategory::NBC, 0x5f0, false, canChannel);
595 transmitStruct<Aim5f1>(CanCategory::NBC, 0x5f1, false, canChannel);
596 transmitStruct<Aim5f2>(CanCategory::NBC, 0x5f2, false, canChannel);
597 transmitStruct<Aim5f3>(CanCategory::NBC, 0x5f3, false, canChannel);
598 transmitStruct<Aim5f4>(CanCategory::NBC, 0x5f4, false, canChannel);
599 transmitStruct<Aim5f5>(CanCategory::NBC, 0x5f5, false, canChannel);
600 transmitStruct<Aim5f6>(CanCategory::NBC, 0x5f6, false, canChannel);
601 transmitStruct<Aim5f7>(CanCategory::NBC, 0x5f7, false, canChannel);
602
603 // there are more, but less important for us
604 // transmitStruct<Aim5f8>(0x5f8, false);
605 // transmitStruct<Aim5f9>(0x5f9, false);
606 // transmitStruct<Aim5fa>(0x5fa, false);
607 // transmitStruct<Aim5fb>(0x5fb, false);
608 // transmitStruct<Aim5fc>(0x5fc, false);
609 // transmitStruct<Aim5fd>(0x5fd, false);
610}
611
612std::optional<board_can_update_dash_type> custom_board_update_dash;
613
614PUBLIC_API_WEAK void boardUpdateDash(CanCycle cycle) { UNUSED(cycle); }
615
616void updateDash(CanCycle cycle) {
617 if (custom_board_update_dash.has_value()) {
618 custom_board_update_dash.value()(cycle);
619 }
620
621 boardUpdateDash(cycle);
622
623 // Transmit dash data, if enabled
625 case CAN_BUS_NBC_NONE:
626 break;
627 case CAN_BUS_BMW_E46:
628 canDashboardBmwE46(cycle);
629 break;
630 case CAN_BUS_Haltech:
631 canDashboardHaltech(cycle);
632 break;
633 case CAN_BUS_NBC_FIAT:
634 canDashboardFiat(cycle);
635 break;
636 case CAN_BUS_NBC_VAG:
637 canDashboardVAG(cycle);
638 break;
639 case CAN_BUS_MAZDA_RX8:
640 canMazdaRX8(cycle);
641 break;
642 case CAN_BUS_W202_C180:
643 canDashboardW202(cycle);
644 break;
645 case CAN_BUS_BMW_E90:
646 canDashboardBmwE90(cycle);
647 break;
648 case CAN_BUS_MQB:
649 canDashboardVagMqb(cycle);
650 break;
651 case CAN_BUS_NISSAN_VQ:
653 break;
654 case CAN_BUS_GENESIS_COUPE:
656 break;
657 case CAN_BUS_HONDA_K:
658 canDashboardHondaK(cycle);
659 break;
660 case CAN_AIM_DASH:
661 canDashboardAim(cycle);
662 break;
663 case CAN_BUS_MS_SIMPLE_BROADCAST:
664 canDashboardTS(cycle);
665 break;
666 default:
667 criticalError("Nothing for canNbcType %d/%s", engineConfiguration->canNbcType, getCan_nbc_e(engineConfiguration->canNbcType));
668 break;
669 }
670}
671
672#endif // EFI_CAN_SUPPORT
const char * getCan_nbc_e(can_nbc_e value)
static uint8_t mph_last
Definition can_dash.cpp:69
static uint8_t brakecnt_2
Definition can_dash.cpp:68
static uint8_t tmp_cnt
Definition can_dash.cpp:69
static void canDashboardBmwE46(CanCycle cycle)
Definition can_dash.cpp:85
std::optional< board_can_update_dash_type > custom_board_update_dash
Definition can_dash.cpp:612
void canMazdaRX8(CanCycle cycle)
Definition can_dash.cpp:114
static void canDashboardBmwE90(CanCycle cycle)
Definition can_dash.cpp:299
constexpr uint8_t e90_temp_offset
Definition can_dash.cpp:73
PUBLIC_API_WEAK void boardUpdateDash(CanCycle cycle)
Definition can_dash.cpp:614
void canDashboardW202(CanCycle cycle)
Definition can_dash.cpp:211
static time_msecs_t mph_ctr
Definition can_dash.cpp:53
static uint8_t rpmcounter
Definition can_dash.cpp:65
static uint8_t gear_cnt
Definition can_dash.cpp:69
static uint16_t mph_counter
Definition can_dash.cpp:70
void canDashboardAim(CanCycle cycle)
Definition can_dash.cpp:587
void canDashboardVAG(CanCycle cycle)
Definition can_dash.cpp:183
static uint8_t abscounter
Definition can_dash.cpp:67
void canDashboardGenesisCoupe(CanCycle cycle)
Definition can_dash.cpp:266
void canDashboardFiat(CanCycle cycle)
Definition can_dash.cpp:172
static uint8_t mph_2a
Definition can_dash.cpp:69
static uint8_t brakecnt_1
Definition can_dash.cpp:68
static uint8_t seatbeltcnt
Definition can_dash.cpp:66
static uint8_t mph_a
Definition can_dash.cpp:69
static void populateFrame(Aim5f0 &msg)
Definition can_dash.cpp:459
static bool cluster_time_set
Definition can_dash.cpp:71
void canDashboardVagMqb(CanCycle cycle)
Definition can_dash.cpp:283
void updateDash(CanCycle cycle)
Definition can_dash.cpp:616
static time_msecs_t mph_timer
Definition can_dash.cpp:52
void canDashboardHaltech(CanCycle cycle)
void canDashboardHondaK(CanCycle cycle)
void canDashboardTS(CanCycle cycle)
void canDashboardNissanVQ(CanCycle cycle)
Definition can.h:83
bool isInterval(CanInterval interval)
Definition can.h:90
void setBit(size_t byteIdx, size_t bitIdx)
Set a single bit in the transmit buffer. Useful for single-bit flags.
void setShortValueMsb(uint16_t value, size_t offset)
void setShortValue(uint16_t value, size_t offset)
Write a 16-bit short value to the buffer. Note: this writes in Intel little endian byte order.
FuelComputer fuelComputer
Definition engine.h:139
constexpr auto & module()
Definition engine.h:200
virtual SensorResult get() const =0
static float getOrZero(SensorType type)
Definition sensor.h:83
uint16_t SWAP_UINT16(uint16_t x)
Definition efilib.h:22
static EngineAccessor engine
Definition engine.h:413
static constexpr engine_configuration_s * engineConfiguration
static CCM_OPTIONAL FunctionalSensor clt(SensorType::Clt, MS2NT(10))
UNUSED(samplingTimeSeconds)
efidatetime_t getRtcDateTime()
Real Time Clock helper.
@ FuelPressureInjector
@ BarometricPressure
uint32_t year
scaled_channel< uint16_t, 10000, 1 > targetLambda
static CanTsChannel canChannel