2015-07-10 06:01:56 -07:00
|
|
|
/**
|
|
|
|
* @file can_hw.h
|
|
|
|
*
|
|
|
|
* @date Dec 11, 2013
|
2018-12-31 13:00:41 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2019
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
|
2019-11-06 17:01:53 -08:00
|
|
|
#pragma once
|
2015-07-10 06:01:56 -07:00
|
|
|
|
2019-01-03 20:51:29 -08:00
|
|
|
#include "efifeatures.h"
|
|
|
|
#if EFI_TUNER_STUDIO
|
2018-01-29 16:41:39 -08:00
|
|
|
#include "tunerstudio_configuration.h"
|
2019-01-03 20:51:29 -08:00
|
|
|
#endif /* EFI_TUNER_STUDIO */
|
2018-01-29 16:41:39 -08:00
|
|
|
|
2015-07-10 06:01:56 -07:00
|
|
|
// CAN Bus ID for broadcast
|
|
|
|
/**
|
|
|
|
* e46 data is from http://forums.bimmerforums.com/forum/showthread.php?1887229
|
|
|
|
*
|
|
|
|
* Same for Mini Cooper? http://vehicle-reverse-engineering.wikia.com/wiki/MINI
|
2018-10-21 08:27:19 -07:00
|
|
|
*
|
|
|
|
* All the below packets are using 500kb/s
|
|
|
|
*
|
2015-07-10 06:01:56 -07:00
|
|
|
*/
|
|
|
|
#define CAN_BMW_E46_SPEED 0x153
|
|
|
|
#define CAN_BMW_E46_RPM 0x316
|
|
|
|
#define CAN_BMW_E46_DME2 0x329
|
|
|
|
#define CAN_BMW_E46_CLUSTER_STATUS 0x613
|
|
|
|
#define CAN_BMW_E46_CLUSTER_STATUS_2 0x615
|
|
|
|
#define CAN_FIAT_MOTOR_INFO 0x561
|
|
|
|
#define CAN_MAZDA_RX_RPM_SPEED 0x201
|
2017-06-11 14:39:35 -07:00
|
|
|
#define CAN_MAZDA_RX_STEERING_WARNING 0x300
|
2015-07-10 06:01:56 -07:00
|
|
|
#define CAN_MAZDA_RX_STATUS_1 0x212
|
|
|
|
#define CAN_MAZDA_RX_STATUS_2 0x420
|
2019-04-30 15:33:29 -07:00
|
|
|
// https://wiki.openstreetmap.org/wiki/VW-CAN
|
2015-07-10 06:01:56 -07:00
|
|
|
#define CAN_VAG_RPM 0x280
|
2019-04-30 15:33:29 -07:00
|
|
|
#define CAN_VAG_CLT 0x288
|
2019-05-04 19:11:05 -07:00
|
|
|
#define CAN_VAG_CLT_V2 0x420
|
2019-07-21 05:17:09 -07:00
|
|
|
#define CAN_VAG_IMMO 0x3D0
|
2015-07-10 06:01:56 -07:00
|
|
|
|
|
|
|
void initCan(void);
|
|
|
|
void commonTxInit(int eid);
|
2017-06-11 14:39:35 -07:00
|
|
|
void sendCanMessage();
|
2017-01-11 18:04:22 -08:00
|
|
|
void setCanType(int type);
|
2015-07-10 06:01:56 -07:00
|
|
|
void setTxBit(int offset, int index);
|
2019-01-03 20:51:29 -08:00
|
|
|
|
2019-04-12 17:52:51 -07:00
|
|
|
#if EFI_CAN_SUPPORT
|
2019-01-03 20:51:29 -08:00
|
|
|
void stopCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
|
|
|
void startCanPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2017-05-15 20:33:22 -07:00
|
|
|
void enableFrankensoCan(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
2019-11-07 12:22:17 -08:00
|
|
|
#if EFI_TUNER_STUDIO
|
2018-01-29 16:41:39 -08:00
|
|
|
void postCanState(TunerStudioOutputChannels *tsOutputChannels);
|
2019-11-06 17:01:53 -08:00
|
|
|
#endif /* EFI_TUNER_STUDIO */
|
|
|
|
#endif /* EFI_CAN_SUPPORT */
|