speeduino/speeduino/comms_CAN.h

37 lines
1001 B
C
Raw Normal View History

2023-10-12 18:25:05 -07:00
#ifndef COMMS_CAN_H
#define COMMS_CAN_H
#if defined(NATIVE_CAN_AVAILABLE)
//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
Add support for RusEFI CAN Wideband based on STM32F042 (#1146) * CAN WBO Support * fix typo * Change data handling * add source repo information * Added heater functionality and fixed value handling * Missed 0 * Better condition handling and minor fixes to multiplication * Remove code duplication * fix * Error fixing and correct address of controller for outgoing frames * Page layout adjustment * fix * Second WBO added to be used in TS / MLV * Add extended flag to out frame * Functional test and fixes * typo * CAN WBO Support fix typo Change data handling add source repo information Added heater functionality and fixed value handling Missed 0 Better condition handling and minor fixes to multiplication Remove code duplication fix Error fixing and correct address of controller for outgoing frames Page layout adjustment fix Second WBO added to be used in TS / MLV Add extended flag to out frame Add support for BlitzBox hardware in speeduino firmware (#1148) * Add support for BlitzBox in init.cpp added case 42 for BlitzBox support * Added support for Blitzbox to speeduino.ini Added support for Blitzbox to speeduino.ini to get an ECU entry in Tunerstudio * Enabled spare pins in pin layout Functional test and fixes typo Fix issue with LED indicator not working when MC33810 was in use Resolve issue with Teensy not sending CAN msgs Fix regression on MC33810 units from af2815d818668d45d7fc271c195c03f0d9c7582e Added check for AFR greater than 25.5 Added overflow check of O2 value Code clean up Bump actions/upload-artifact from 3 to 4 (#1149) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Spelling and typo correction missing space * Fix possible overflow * Allow for future CAN based WBO modules to be added * rusEFI case as requested. * fix * CAN WBO Support * fix typo * Change data handling * add source repo information * Added heater functionality and fixed value handling * Missed 0 * Better condition handling and minor fixes to multiplication * Remove code duplication * fix * Error fixing and correct address of controller for outgoing frames * Page layout adjustment * fix * Second WBO added to be used in TS / MLV * Add extended flag to out frame * Functional test and fixes * typo * Allow for future CAN based WBO modules to be added * CAN WBO Support fix typo Change data handling add source repo information Added heater functionality and fixed value handling Missed 0 Better condition handling and minor fixes to multiplication Remove code duplication fix Error fixing and correct address of controller for outgoing frames Page layout adjustment fix Second WBO added to be used in TS / MLV Add extended flag to out frame Add support for BlitzBox hardware in speeduino firmware (#1148) * Add support for BlitzBox in init.cpp added case 42 for BlitzBox support * Added support for Blitzbox to speeduino.ini Added support for Blitzbox to speeduino.ini to get an ECU entry in Tunerstudio * Enabled spare pins in pin layout Functional test and fixes typo Fix issue with LED indicator not working when MC33810 was in use Resolve issue with Teensy not sending CAN msgs Fix regression on MC33810 units from af2815d818668d45d7fc271c195c03f0d9c7582e Added check for AFR greater than 25.5 Added overflow check of O2 value Code clean up Bump actions/upload-artifact from 3 to 4 (#1149) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Spelling and typo correction missing space * rusEFI case as requested. * Revert "Merge branch 'master' of https://github.com/dynfer/speeduino" This reverts commit 49dc0eab0814cd9e55435178ab0cbb74741b473a, reversing changes made to 56abc790086ba1b5f0d2efdbc7947c60c6b34f9a. * fix merge * fixes * Added overflow prevention * Final --------- Co-authored-by: Josh Stewart <josh@noisymime.org>
2024-02-04 02:34:29 -08:00
#define CAN_WBO_RUSEFI 1
#define TS_CAN_OFFSET 0x100
void initCAN();
int CAN_read();
void CAN_write();
void sendBMWCluster();
void sendVAGCluster();
Add support for RusEFI CAN Wideband based on STM32F042 (#1146) * CAN WBO Support * fix typo * Change data handling * add source repo information * Added heater functionality and fixed value handling * Missed 0 * Better condition handling and minor fixes to multiplication * Remove code duplication * fix * Error fixing and correct address of controller for outgoing frames * Page layout adjustment * fix * Second WBO added to be used in TS / MLV * Add extended flag to out frame * Functional test and fixes * typo * CAN WBO Support fix typo Change data handling add source repo information Added heater functionality and fixed value handling Missed 0 Better condition handling and minor fixes to multiplication Remove code duplication fix Error fixing and correct address of controller for outgoing frames Page layout adjustment fix Second WBO added to be used in TS / MLV Add extended flag to out frame Add support for BlitzBox hardware in speeduino firmware (#1148) * Add support for BlitzBox in init.cpp added case 42 for BlitzBox support * Added support for Blitzbox to speeduino.ini Added support for Blitzbox to speeduino.ini to get an ECU entry in Tunerstudio * Enabled spare pins in pin layout Functional test and fixes typo Fix issue with LED indicator not working when MC33810 was in use Resolve issue with Teensy not sending CAN msgs Fix regression on MC33810 units from af2815d818668d45d7fc271c195c03f0d9c7582e Added check for AFR greater than 25.5 Added overflow check of O2 value Code clean up Bump actions/upload-artifact from 3 to 4 (#1149) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Spelling and typo correction missing space * Fix possible overflow * Allow for future CAN based WBO modules to be added * rusEFI case as requested. * fix * CAN WBO Support * fix typo * Change data handling * add source repo information * Added heater functionality and fixed value handling * Missed 0 * Better condition handling and minor fixes to multiplication * Remove code duplication * fix * Error fixing and correct address of controller for outgoing frames * Page layout adjustment * fix * Second WBO added to be used in TS / MLV * Add extended flag to out frame * Functional test and fixes * typo * Allow for future CAN based WBO modules to be added * CAN WBO Support fix typo Change data handling add source repo information Added heater functionality and fixed value handling Missed 0 Better condition handling and minor fixes to multiplication Remove code duplication fix Error fixing and correct address of controller for outgoing frames Page layout adjustment fix Second WBO added to be used in TS / MLV Add extended flag to out frame Add support for BlitzBox hardware in speeduino firmware (#1148) * Add support for BlitzBox in init.cpp added case 42 for BlitzBox support * Added support for Blitzbox to speeduino.ini Added support for Blitzbox to speeduino.ini to get an ECU entry in Tunerstudio * Enabled spare pins in pin layout Functional test and fixes typo Fix issue with LED indicator not working when MC33810 was in use Resolve issue with Teensy not sending CAN msgs Fix regression on MC33810 units from af2815d818668d45d7fc271c195c03f0d9c7582e Added check for AFR greater than 25.5 Added overflow check of O2 value Code clean up Bump actions/upload-artifact from 3 to 4 (#1149) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Spelling and typo correction missing space * rusEFI case as requested. * Revert "Merge branch 'master' of https://github.com/dynfer/speeduino" This reverts commit 49dc0eab0814cd9e55435178ab0cbb74741b473a, reversing changes made to 56abc790086ba1b5f0d2efdbc7947c60c6b34f9a. * fix merge * fixes * Added overflow prevention * Final --------- Co-authored-by: Josh Stewart <josh@noisymime.org>
2024-02-04 02:34:29 -08:00
void receiveCANwbo();
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();
extern CAN_message_t outMsg;
extern CAN_message_t inMsg;
#endif
2023-10-12 18:25:05 -07:00
#endif // COMMS_CAN_H