2023-10-12 18:25:05 -07:00
|
|
|
#ifndef COMMS_CAN_H
|
|
|
|
#define COMMS_CAN_H
|
2022-04-20 23:33:10 -07:00
|
|
|
|
|
|
|
//For BMW e46/e39/e38, rover and mini other CAN instrument clusters
|
|
|
|
#define CAN_BMW_ASC1 0x153 //Rx message from ACS unit that includes speed
|
|
|
|
#define CAN_BMW_DME1 0x316 //Tx message that includes RPM
|
|
|
|
#define CAN_BMW_DME2 0x329 //Tx message that includes CLT and TPS
|
|
|
|
#define CAN_BMW_DME4 0x545 //Tx message that includes CLT and TPS
|
|
|
|
#define CAN_BMW_ICL2 0x613
|
|
|
|
#define CAN_BMW_ICL3 0x615
|
|
|
|
|
|
|
|
//For VAG CAN instrument clusters
|
|
|
|
#define CAN_VAG_RPM 0x280
|
|
|
|
#define CAN_VAG_VSS 0x5A0
|
|
|
|
|
2024-08-07 20:45:49 -07:00
|
|
|
//For Haltech IC-7 and IC-10 digital dashes
|
|
|
|
#define CAN_HALTECH_DATA1 0x360 //RPM, MAP, TPS, Coolant Pressure. 50Hz
|
|
|
|
#define CAN_HALTECH_DATA2 0x361 //Fuel Pressure, Oil Pressure, Load, Wastegate Pressure. 50Hz
|
|
|
|
#define CAN_HALTECH_DATA3 0x362 //Advance, INJ Stage 1/2 duty cycles. 50Hz
|
|
|
|
#define CAN_HALTECH_PW 0x364 //Pulsewidth 1-4. 50Hz
|
|
|
|
#define CAN_HALTECH_LAMBDA 0x368 //Lambda 1-4. 20Hz
|
|
|
|
#define CAN_HALTECH_TRIGGER 0x369 //Trigger Counter, sync level, sync error count. 20Hz
|
2024-09-08 20:09:42 -07:00
|
|
|
#define CAN_HALTECH_VSS 0x370 //VSS, current gear and inlet cam angles. 20Hz
|
2024-08-07 20:45:49 -07:00
|
|
|
#define CAN_HALTECH_DATA4 0x372 //Baro, BatteryV, Target boost. 10Hz
|
|
|
|
#define CAN_HALTECH_DATA5 0x3E0 //IAT, CLT, Fuel Temp, Oil Temp. 10Hz
|
|
|
|
|
|
|
|
#define CAN_BROADCAST_PROTOCOL_OFF 0
|
|
|
|
#define CAN_BROADCAST_PROTOCOL_BMW 1
|
|
|
|
#define CAN_BROADCAST_PROTOCOL_VAG 2
|
|
|
|
#define CAN_BROADCAST_PROTOCOL_HALTECH 3
|
|
|
|
|
|
|
|
|
2024-02-04 02:34:29 -08:00
|
|
|
#define CAN_WBO_RUSEFI 1
|
2024-08-22 13:57:29 -07:00
|
|
|
#define CAN_WBO_AEM 2
|
2024-02-04 02:34:29 -08:00
|
|
|
|
2023-11-02 21:22:11 -07:00
|
|
|
#define TS_CAN_OFFSET 0x100
|
|
|
|
|
2024-08-07 21:09:17 -07:00
|
|
|
#if defined(NATIVE_CAN_AVAILABLE)
|
|
|
|
|
2023-12-20 18:40:36 -08:00
|
|
|
void initCAN();
|
|
|
|
int CAN_read();
|
|
|
|
void CAN_write();
|
2024-08-07 20:45:49 -07:00
|
|
|
void sendCANBroadcast(uint8_t);
|
2024-02-04 02:34:29 -08:00
|
|
|
void receiveCANwbo();
|
2022-04-20 23:33:10 -07:00
|
|
|
void DashMessages(uint16_t DashMessageID);
|
2023-10-12 18:25:05 -07:00
|
|
|
void can_Command(void);
|
|
|
|
void obd_response(uint8_t therequestedPID , uint8_t therequestedPIDlow, uint8_t therequestedPIDhigh);
|
|
|
|
void readAuxCanBus();
|
|
|
|
|
2023-11-02 21:22:11 -07:00
|
|
|
extern CAN_message_t outMsg;
|
|
|
|
extern CAN_message_t inMsg;
|
|
|
|
|
2022-04-20 23:33:10 -07:00
|
|
|
#endif
|
2023-10-12 18:25:05 -07:00
|
|
|
#endif // COMMS_CAN_H
|