export board-specific macro for stm32 pins based on board yaml #3298

This commit is contained in:
rusefi 2023-09-03 22:56:30 -04:00
parent beb304ecb6
commit 6a4f514cdd
9 changed files with 39 additions and 59 deletions

View File

@ -4,7 +4,7 @@
#define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144 #define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144
#define TRIGGER_SCOPE_PIN_CH1 H144_IN_RES3 #define TRIGGER_SCOPE_PIN_CH1 Gpio::H144_IN_RES3
#define TRIGGER_SCOPE_ADC_CH1 H144_ADC_IN_RES3 #define TRIGGER_SCOPE_ADC_CH1 H144_ADC_IN_RES3
#define TRIGGER_SCOPE_HAS_CH2 false #define TRIGGER_SCOPE_HAS_CH2 false

View File

@ -4,9 +4,9 @@
#define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144 #define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144
#define TRIGGER_SCOPE_PIN_CH1 H144_IN_RES2 #define TRIGGER_SCOPE_PIN_CH1 Gpio::H144_IN_RES2
#define TRIGGER_SCOPE_ADC_CH1 H144_ADC_IN_RES2 #define TRIGGER_SCOPE_ADC_CH1 H144_ADC_IN_RES2
#define TRIGGER_SCOPE_HAS_CH2 true #define TRIGGER_SCOPE_HAS_CH2 true
#define TRIGGER_SCOPE_PIN_CH2 H144_IN_RES3 #define TRIGGER_SCOPE_PIN_CH2 Gpio::H144_IN_RES3
#define TRIGGER_SCOPE_ADC_CH2 H144_ADC_IN_RES3 #define TRIGGER_SCOPE_ADC_CH2 H144_ADC_IN_RES3

View File

@ -4,9 +4,9 @@
#define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144 #define TRIGGER_SCOPE_SAMPLE_TIME ADC_SAMPLE_144
#define TRIGGER_SCOPE_PIN_CH1 H144_IN_RES3 #define TRIGGER_SCOPE_PIN_CH1 Gpio::H144_IN_RES3
#define TRIGGER_SCOPE_ADC_CH1 H144_ADC_IN_RES3 #define TRIGGER_SCOPE_ADC_CH1 H144_ADC_IN_RES3
#define TRIGGER_SCOPE_HAS_CH2 true #define TRIGGER_SCOPE_HAS_CH2 true
#define TRIGGER_SCOPE_PIN_CH2 H144_IN_RES2 #define TRIGGER_SCOPE_PIN_CH2 Gpio::H144_IN_RES2
#define TRIGGER_SCOPE_ADC_CH2 H144_ADC_IN_RES2 #define TRIGGER_SCOPE_ADC_CH2 H144_ADC_IN_RES2

View File

@ -121,7 +121,7 @@ void setBoardDefaultConfiguration() {
engineConfiguration->luaOutputPins[0] = Gpio::H144_OUT_IO6; // starter relay engineConfiguration->luaOutputPins[0] = Gpio::H144_OUT_IO6; // starter relay
engineConfiguration->boostControlPin = Gpio::H144_OUT_PWM5; engineConfiguration->boostControlPin = Gpio::H144_OUT_PWM5;
engineConfiguration->brakePedalPin = H144_IN_RES2; engineConfiguration->brakePedalPin = Gpio::H144_IN_RES2;
// engineConfiguration->acSwitch = // engineConfiguration->acSwitch =
// engineConfiguration->acRelayPin = // engineConfiguration->acRelayPin =
engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO5; engineConfiguration->fuelPumpPin = Gpio::H144_OUT_IO5;

View File

@ -72,10 +72,10 @@ void setBoardConfigOverrides() {
engineConfiguration->clt.config.bias_resistor = 4700; engineConfiguration->clt.config.bias_resistor = 4700;
engineConfiguration->iat.config.bias_resistor = 4700; engineConfiguration->iat.config.bias_resistor = 4700;
engineConfiguration->triggerInputPins[0] = H144_IN_RES1; engineConfiguration->triggerInputPins[0] = Gpio::H144_IN_RES1;
engineConfiguration->camInputs[0] = H144_IN_RES3; engineConfiguration->camInputs[0] = Gpio::H144_IN_RES3;
// ex or in? // ex or in?
engineConfiguration->camInputs[1] = H144_IN_RES2; engineConfiguration->camInputs[1] = Gpio::H144_IN_RES2;
// //ETB1 // //ETB1

View File

@ -154,9 +154,9 @@ void setBoardDefaultConfiguration() {
engineConfiguration->mainRelayPin = Gpio::H144_OUT_IO3; // pin: 111a engineConfiguration->mainRelayPin = Gpio::H144_OUT_IO3; // pin: 111a
engineConfiguration->malfunctionIndicatorPin = Gpio::H144_OUT_PWM8; engineConfiguration->malfunctionIndicatorPin = Gpio::H144_OUT_PWM8;
engineConfiguration->brakePedalPin = H144_IN_RES3; engineConfiguration->brakePedalPin = Gpio::H144_IN_RES3;
engineConfiguration->clutchUpPin = H144_IN_RES2; engineConfiguration->clutchUpPin = Gpio::H144_IN_RES2;
engineConfiguration->acSwitch = H144_IN_RES1; engineConfiguration->acSwitch = Gpio::H144_IN_RES1;
// "required" hardware is done - set some reasonable defaults // "required" hardware is done - set some reasonable defaults
setupDefaultSensorInputs(); setupDefaultSensorInputs();

View File

@ -21,8 +21,7 @@ pins:
type: gnd type: gnd
- pin: K2 - pin: K2
# VIGN PA5 meta: H144_IN_VBATT
id: EFI_ADC_5
class: analog_inputs class: analog_inputs
ts_name: K2 Ignition Key Voltage ts_name: K2 Ignition Key Voltage
function: V ign function: V ign
@ -43,8 +42,7 @@ pins:
- pin: K10 - pin: K10
function: K10 presure sensor function: K10 presure sensor
# IN_MAP2 meta: H144_IN_MAP2
id: EFI_ADC_11
class: analog_inputs class: analog_inputs
ts_name: K10 Sensor ts_name: K10 Sensor
@ -62,8 +60,7 @@ pins:
function: Analog Ground function: Analog Ground
- pin: K15 - pin: K15
# cam2 IN_AUX4 meta: H144_IN_D_AUX4
id: [A7]
function: 'Cam Sensor (2014: yellow)' function: 'Cam Sensor (2014: yellow)'
class: [event_inputs] class: [event_inputs]
ts_name: Cam - K15 ts_name: Cam - K15
@ -74,21 +71,18 @@ pins:
- pin: K17b - pin: K17b
function: Crank Sensor function: Crank Sensor
# IN_CRANK AIN24 A24 meta: H144_IN_CRANK
id: [B1]
class: [event_inputs] class: [event_inputs]
ts_name: Crank - K17 rev B ts_name: Crank - K17 rev B
- pin: K17c - pin: K17c
function: "Crank Sensor (2014: pink)" function: "Crank Sensor (2014: pink)"
# H144_IN_SENS2 meta: H144_IN_SENS2
id: [F4]
class: [event_inputs] class: [event_inputs]
ts_name: Crank - K17 rev C ts_name: Crank - K17 rev C
- pin: K21 - pin: K21
# H144_IN_O2S meta: H144_IN_O2S
id: EFI_ADC_0
class: analog_inputs class: analog_inputs
ts_name: K21 Ambient Temperature ts_name: K21 Ambient Temperature
function: Ambient Temperature function: Ambient Temperature
@ -129,22 +123,19 @@ pins:
type: 5v type: 5v
- pin: K31 - pin: K31
# IN_MAP1 AIN9 meta: H144_IN_MAP1
id: EFI_ADC_10
class: analog_inputs class: analog_inputs
ts_name: Map Sensor K31 ts_name: Map Sensor K31
function: Manifold Pressure Sensor function: Manifold Pressure Sensor
- pin: K32 - pin: K32
# IN_AUX1 AIN23 PB0 meta: H144_IN_AUX1
id: EFI_ADC_8
class: analog_inputs class: analog_inputs
ts_name: TPS 2 ts_name: TPS 2
function: TPS 2 sensor input function: TPS 2 sensor input
- pin: K33 - pin: K33
# IN_CLT AIN11 meta: H144_IN_CLT
id: EFI_ADC_12
class: analog_inputs class: analog_inputs
ts_name: CLT ts_name: CLT
function: CLT function: CLT
@ -153,8 +144,7 @@ pins:
function: Analog Ground function: Analog Ground
- pin: K35 - pin: K35
# IN_AUX2 AIN21 PC4 meta: H144_IN_AUX2
id: EFI_ADC_14
class: analog_inputs class: analog_inputs
ts_name: PPS 2 ts_name: PPS 2
function: PPS 2 sensor input function: PPS 2 sensor input
@ -170,8 +160,7 @@ pins:
function: Analog Ground function: Analog Ground
- pin: K40 - pin: K40
# H144_IN_VSS meta: H144_IN_VSS
id: F11
class: event_inputs class: event_inputs
ts_name: K40 VSS ts_name: K40 VSS
function: Vehicle Speed Sensor function: Vehicle Speed Sensor
@ -190,15 +179,13 @@ pins:
function: BK1 Wastegate Solenoid function: BK1 Wastegate Solenoid
- pin: K53 - pin: K53
# IN_IAT AIN14 PC3 meta: H144_IN_IAT
id: EFI_ADC_13
class: analog_inputs class: analog_inputs
ts_name: IAT ts_name: IAT
function: 'IAT (2014: green)' function: 'IAT (2014: green)'
- pin: K54 - pin: K54
# IN_MAP3 meta: H144_IN_MAP3
id: EFI_ADC_2
class: analog_inputs class: analog_inputs
ts_name: K54 A/C pressure ts_name: K54 A/C pressure
function: A/C pressure function: A/C pressure
@ -207,8 +194,7 @@ pins:
function: 'Analog Ground (2014: green)' function: 'Analog Ground (2014: green)'
- pin: K58 - pin: K58
# IN_O2S2 AIN12 PA1 EFI_ADC_1 meta: H144_IN_O2S2
id: EFI_ADC_1
class: analog_inputs class: analog_inputs
ts_name: K58 Oil Temp ts_name: K58 Oil Temp
function: 'Oil Temperature (2014: blue/orange)' function: 'Oil Temperature (2014: blue/orange)'
@ -224,17 +210,15 @@ pins:
function: 'Analog Ground (2014: yellow)' function: 'Analog Ground (2014: yellow)'
- pin: K62b - pin: K62b
# cam1 IN_CAM meta: H144_IN_CAM
id: [A6]
function: Cam Sensor function: Cam Sensor
class: [event_inputs] class: event_inputs
ts_name: Cam - K62 rev B ts_name: Cam - K62 rev B
- pin: K62c - pin: K62c
# H144_IN_SENS3 meta: H144_IN_SENS3
id: [F5]
function: "Cam Sensor (2014: white)" function: "Cam Sensor (2014: white)"
class: [event_inputs] class: event_inputs
ts_name: Cam - K62 rev C ts_name: Cam - K62 rev C
- pin: K63 - pin: K63
@ -294,14 +278,13 @@ pins:
function: Analog Ground function: Analog Ground
- pin: K80 - pin: K80
# IN_TPS AIN17 PA4 meta: H144_IN_TPS
id: EFI_ADC_4
class: analog_inputs class: analog_inputs
ts_name: TPS 1 ts_name: TPS 1
function: TPS 1 sensor input function: TPS 1 sensor input
- pin: K82 - pin: K82
id: EFI_ADC_3 meta: H144_IN_PPS
class: analog_inputs class: analog_inputs
ts_name: PPS 1 ts_name: PPS 1
function: PPS 1 sensor input function: PPS 1 sensor input
@ -355,8 +338,7 @@ pins:
type: ign type: ign
- pin: A29 - pin: A29
# H144_IN_RES3 meta: H144_IN_RES3
id: F8
class: switch_inputs class: switch_inputs
ts_name: A29 Brake Input ts_name: A29 Brake Input
function: Brake Switch function: Brake Switch
@ -370,8 +352,7 @@ pins:
type: ign type: ign
- pin: A43 - pin: A43
# H144_IN_RES2 meta: H144_IN_RES2
id: F10
class: switch_inputs class: switch_inputs
ts_name: A43 Clutch Input ts_name: A43 Clutch Input
function: Clutch Input function: Clutch Input
@ -387,8 +368,7 @@ pins:
type: ign type: ign
- pin: A57 - pin: A57
# H144_IN_RES1 meta: H144_IN_RES1
id: F9
class: switch_inputs class: switch_inputs
ts_name: A57 AC Request ts_name: A57 AC Request
function: AC Request Switch function: AC Request Switch

View File

@ -102,7 +102,7 @@ void setBoardDefaultConfiguration() {
engineConfiguration->acSwitchMode = PI_PULLUP; engineConfiguration->acSwitchMode = PI_PULLUP;
engineConfiguration->vehicleSpeedSensorInputPin = Gpio::H144_IN_VSS; engineConfiguration->vehicleSpeedSensorInputPin = Gpio::H144_IN_VSS;
engineConfiguration->clutchDownPin = H144_IN_RES3; engineConfiguration->clutchDownPin = Gpio::H144_IN_RES3;
engineConfiguration->clutchDownPinInverted = true; engineConfiguration->clutchDownPinInverted = true;
engineConfiguration->fuelPumpPin = Gpio::G2; // OUT_IO9 engineConfiguration->fuelPumpPin = Gpio::G2; // OUT_IO9

View File

@ -163,14 +163,14 @@ void detectHellenBoardType();
#define H144_IN_MAP3_DIGITAL Gpio::A2 #define H144_IN_MAP3_DIGITAL Gpio::A2
// AIN7 // AIN7
#define H144_IN_RES1 Gpio::F9 #define H144_IN_RES1 F9
// AIN16 // AIN16
#define H144_IN_RES2 Gpio::F10 #define H144_IN_RES2 F10
#define H144_ADC_IN_RES2 ADC_CHANNEL_IN8 #define H144_ADC_IN_RES2 ADC_CHANNEL_IN8
// AIN8 // AIN8
#define H144_IN_RES3 Gpio::F8 #define H144_IN_RES3 F8
#define H144_ADC_IN_RES3 ADC_CHANNEL_IN6 #define H144_ADC_IN_RES3 ADC_CHANNEL_IN6