rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
honda_k_dbc.cpp
Go to the documentation of this file.
1/*
2 * honda_k_dbc.cpp
3 *
4 * @date Oct 2, 2021
5 * @author Andrey Belomutskiy, (c) 2012-2021
6 */
7
8#include "honda_k_dbc.h"
9#include "table_helper.h"
10
11#if HW_PROTEUS & EFI_PROD_CODE
12#include "proteus_meta.h"
13#endif // HW_PROTEUS
14
15void setHondaK() {
18 engineConfiguration->firingOrder = FO_1_3_4_2;
19 engineConfiguration->engineSyncCam = SC_Exhaust_First;
22 int magic = 0; // note that offset and VVT are related
24
25 // VVT is here just single tooth? and we do not even use it!?
26 engineConfiguration->vvtMode[0] = VVT_HONDA_K_INTAKE;
27 // also known as 'CAM sync'? i am pretty confused at this point
28 engineConfiguration->vvtMode[1] = VVT_HONDA_K_EXHAUST;
30 engineConfiguration->vvtOffsets[1] = 183 + magic;
31
32 // set cranking_fuel 15
34
35 engineConfiguration->map.sensor.type = MT_DENSO183;
36// todo: quote some source?
39 engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
40 engineConfiguration->fuelReferencePressure = 350; // TODO: what is real value?!
41
42 engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
44 engineConfiguration->injectionMode = IM_SEQUENTIAL;
45
47#if CRANKING_ENRICH_COUNT == 6
48 static const uint16_t defaultPostCrankinDurationBins[] = {
49 0, 65, 100, 125, 150, 250
50 };
51 copyArray(config->postCrankingDurationBins, defaultPostCrankinDurationBins);
52#endif // CRANKING_ENRICH_COUNT
55
56 strcpy(engineConfiguration->engineMake, ENGINE_MAKE_HONDA);
57 strcpy(engineConfiguration->engineCode, "K24");
58
61
63
64 gppwm_channel *vtsControl = &engineConfiguration->gppwm[0];
65 vtsControl->pwmFrequency = 0;
66#if EFI_SIMULATOR
67 // simulator canned config XML toolset cares to see perfect empty memory region
68 memset(engineConfiguration->gpPwmNote[0], 0, sizeof(gppwm_note_t));
69#endif
70 strcpy(engineConfiguration->gpPwmNote[0], "VTS");
71
72/**
73 * K24A4 engine
74 * HONDA_K
75 */
76
77#if HW_PROTEUS & EFI_PROD_CODE
78 strcpy(engineConfiguration->vehicleName, "test");
79// engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_2; // crank
80// engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_4; // intake
81// engineConfiguration->camInputs[1 * CAMS_PER_BANK] = PROTEUS_DIGITAL_1; // exhaust
82
83 engineConfiguration->triggerInputPins[0] = PROTEUS_DIGITAL_1; // exhaust
84 engineConfiguration->camInputs[0] = PROTEUS_DIGITAL_4; // intake
85// inverted
86 // offset -41
87
88
89 engineConfiguration->injectionPins[0] = Gpio::PROTEUS_LS_8;
90 engineConfiguration->injectionPins[1] = Gpio::PROTEUS_LS_7;
91 engineConfiguration->injectionPins[2] = Gpio::PROTEUS_LS_6;
92 engineConfiguration->injectionPins[3] = Gpio::PROTEUS_LS_5;
93
94 vtsControl->pin = Gpio::PROTEUS_HS_1;
95 engineConfiguration->vvtPins[0] = Gpio::PROTEUS_HS_2;
96
97 engineConfiguration->malfunctionIndicatorPin = Gpio::PROTEUS_LS_10;
98 engineConfiguration->idle.solenoidPin = Gpio::PROTEUS_LS_15;
99 engineConfiguration->fanPin = Gpio::PROTEUS_LS_1;
100
101 engineConfiguration->iat.adcChannel = PROTEUS_IN_ANALOG_TEMP_1;
102 engineConfiguration->clt.adcChannel = PROTEUS_IN_ANALOG_TEMP_2;
103 engineConfiguration->tps1_1AdcChannel = PROTEUS_IN_ANALOG_VOLT_3;
104 engineConfiguration->map.sensor.hwChannel = PROTEUS_IN_ANALOG_VOLT_6;
106
107 engineConfiguration->mainRelayPin = Gpio::PROTEUS_LS_9;
108 engineConfiguration->fuelPumpPin = Gpio::PROTEUS_LS_11;
109
110#endif // HW_PROTEUS
111}
112
114
115}
@ Unassigned
static constexpr persistent_config_s * config
static constexpr engine_configuration_s * engineConfiguration
void setProteusHondaOBD2A()
void setHondaK()
char[GPPWM_NOTE_SIZE] gppwm_note_t
brain_input_pin_e triggerInputPins[TRIGGER_INPUT_PIN_COUNT]
float crankingCycleBaseFuel[CRANKING_CYCLE_CLT_SIZE][CRANKING_CURVE_SIZE]
float postCrankingFactor[CRANKING_ENRICH_CLT_COUNT][CRANKING_ENRICH_COUNT]
constexpr void setTable(TElement(&dest)[N][M], const VElement value)
void setArrayValues(TValue(&array)[TSize], float value)