revive MC33816 driver, also support bus sharing #6781

only:alphax-4k-gdi
This commit is contained in:
rusefi 2024-08-11 15:16:57 -04:00
parent f5ba5a834c
commit bacedbb65e
2 changed files with 10 additions and 4 deletions

View File

@ -67,7 +67,8 @@ static const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT] = {
},
.resn = Gpio::Unassigned,
.en = Gpio::Unassigned
},
}
/* ,
{
.spi_bus = &SPID2,
.spi_config = {
@ -119,7 +120,9 @@ static const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT] = {
},
.resn = Gpio::Unassigned,
.en = Gpio::Unassigned
}};
}
*/
};
/*PUBLIC_API_WEAK*/ void boardInitHardware() {
setHellenMegaEnPin();
@ -164,7 +167,7 @@ static const tle9104_config tle9104_cfg[BOARD_TLE9104_COUNT] = {
csDcAux.setValue(1);
}
initAll9104(tle9104_cfg);
// initAll9104(tle9104_cfg);
}
static Gpio OUTPUTS[] = {

View File

@ -33,7 +33,7 @@ static SPIConfig spiCfg = {
.data_cb = NULL,
.error_cb = NULL,
#endif
.ssport = NULL,
.ssport = nullptr,
.sspad = 0,
.cr1 =
SPI_CR1_16BIT_MODE |
@ -49,6 +49,8 @@ public:
protected:
void select() override {
// revive MC33816 driver, also support bus sharing #6781
// should be somewhere but not here spiStart(driver, &spiCfg);
spiSelect(driver);
}
@ -181,6 +183,7 @@ void Pt2001::init() {
}
chipSelect.initPin("mc33 CS", engineConfiguration->mc33816_cs /*, &engineConfiguration->csPinMode*/);
chipSelect.setValue(1);
// Initialize the chip via ResetB
resetB.initPin("mc33 RESTB", engineConfiguration->mc33816_rstb);