From 2b39c732e4313d846c3635da356c6d6b6471d958 Mon Sep 17 00:00:00 2001 From: rusefi Date: Thu, 7 Nov 2024 17:10:58 -0500 Subject: [PATCH] enable ETB SPI for hellen154hyundai #7050 only:hellen154hyundai_f7 --- .../board_configuration.cpp | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/firmware/config/boards/hellen/hellen154hyundai_f7/board_configuration.cpp b/firmware/config/boards/hellen/hellen154hyundai_f7/board_configuration.cpp index 756475de3f..023632124e 100644 --- a/firmware/config/boards/hellen/hellen154hyundai_f7/board_configuration.cpp +++ b/firmware/config/boards/hellen/hellen154hyundai_f7/board_configuration.cpp @@ -46,6 +46,19 @@ static void setupDefaultSensorInputs() { engineConfiguration->iat.adcChannel = H144_IN_IAT; } +static struct tle9201_config tle9201 = { + .spi_bus = &SPID3, + .spi_config = { + .circular = false, + .end_cb = NULL, + // H_SPI3_CS + .ssport = GPIOA, + .sspad = 15, + .cr1 = TLE9201_CONFIG_CR1, + .cr2 = TLE9201_CONFIG_CR2 + } +}; + void setBoardConfigOverrides() { /* Force 3.3V PWR_EN as MC33810 is powered from this power line */ setHellenMegaEnPin(); @@ -169,11 +182,8 @@ static const struct mc33810_config mc33810 = { }; /*PUBLIC_API_WEAK*/ void boardInitHardware() { - static OutputPin spi3CsEtb; static OutputPin spi3CsWastegate; - spi3CsEtb.initPin("spi3-cs-etb", H_SPI3_CS); - spi3CsEtb.setValue(1); spi3CsWastegate.initPin("spi3-cs-wg", Gpio::H144_GP_IO6); spi3CsWastegate.setValue(1); // mc33810 takes care of the CS on it's own @@ -181,6 +191,11 @@ static const struct mc33810_config mc33810 = { // spi3CsMc33810.initPin("spi3-cs-mc33810", Gpio::H144_OUT_PWM1); // spi3CsMc33810.setValue(1); + gpio_pin_markUsed(tle9201.spi_config.ssport, tle9201.spi_config.sspad, "TLE9201 ETB CS"); + palSetPadMode(tle9201.spi_config.ssport, tle9201.spi_config.sspad, PAL_MODE_OUTPUT_PUSHPULL); + int retTle = tle9201_add(0, &tle9201); + efiPrintf("*****************+ tle9201_add %d +*******************", retTle); + #if (BOARD_MC33810_COUNT > 0) gpio_pin_markUsed(mc33810.spi_config.ssport, mc33810.spi_config.sspad, "mc33810 CS"); palSetPadMode(mc33810.spi_config.ssport, mc33810.spi_config.sspad, PAL_MODE_OUTPUT_PUSHPULL);