only:bench test 33810 module #5745

This commit is contained in:
rusefi 2023-11-22 21:06:00 -05:00
parent 17d0a24bc1
commit 2dd2a6f42e
4 changed files with 58 additions and 3 deletions

View File

@ -147,3 +147,45 @@ void setBoardDefaultConfiguration() {
engineConfiguration->is_enabled_spi_2 = false;
engineConfiguration->is_enabled_spi_3 = true;
}
void boardInitHardware() {
#if HW_FRANKENSO
static const struct mc33810_config mc33810 = {
.spi_bus = &SPID3,
.spi_config = {
.circular = false,
.end_cb = NULL,
.ssport = GPIOF,
.sspad = 1,
.cr1 =
//SPI_CR1_16BIT_MODE |
SPI_CR1_SSM |
SPI_CR1_SSI |
((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | /* div = 16 */
SPI_CR1_MSTR |
/* SPI_CR1_CPOL | */ // = 0
SPI_CR1_CPHA | // = 1
0,
.cr2 = //SPI_CR2_16BIT_MODE |
0//SPI_CR2_DS_3 | SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0
},
.direct_io = {
/* injector drivers */
[0] = {.port = GPIOI, .pad = 6}, /* INJ 1 */
[1] = {.port = GPIOI, .pad = 5}, /* INJ 3 */
[2] = {.port = GPIOI, .pad = 4}, /* INJ 5 */
[3] = {.port = GPIOB, .pad = 9}, /* INJ 7 */
/* ignition pre-drivers */
[4] = {.port = GPIOB, .pad = 3}, /* IGN 4 */
[5] = {.port = GPIOB, .pad = 4}, /* IGN 3 */
[6] = {.port = GPIOB, .pad = 5}, /* IGN 7 */
[7] = {.port = GPIOB, .pad = 8}, /* IGN 5 */
},
.en = {.port = GPIOI, .pad = 7}
};
if (engineConfiguration->engineType == engine_type_e::FRANKENSO_TEST_33810) {
mc33810_add(Gpio::MC33810_0_OUT_0, 0, &mc33810);
}
#endif // HW_FRANKENSO
}

View File

@ -89,7 +89,7 @@ static struct l9779_config l9779_cfg = {
.cr2 = SPI_CR2_16BIT_MODE
},
.direct_gpio = {
/* ignition pre-dirvers */
/* ignition pre-drivers */
[0] = {.port = GPIOF, .pad = 12},
[1] = {.port = GPIOF, .pad = 13},
[2] = {.port = GPIOF, .pad = 14},

View File

@ -255,7 +255,7 @@ static const struct mc33810_config mc33810_odd = {
[1] = {.port = GPIOI, .pad = 5}, /* INJ 3 */
[2] = {.port = GPIOI, .pad = 4}, /* INJ 5 */
[3] = {.port = GPIOB, .pad = 9}, /* INJ 7 */
/* ignition pre-dirvers */
/* ignition pre-drivers */
[4] = {.port = GPIOB, .pad = 3}, /* IGN 4 */
[5] = {.port = GPIOB, .pad = 4}, /* IGN 3 */
[6] = {.port = GPIOB, .pad = 5}, /* IGN 7 */
@ -291,7 +291,7 @@ static const struct mc33810_config mc33810_even = {
[1] = {.port = GPIOE, .pad = 4}, /* INJ 4 */
[2] = {.port = GPIOE, .pad = 5}, /* INJ 6 */
[3] = {.port = GPIOE, .pad = 6}, /* INJ 8 */
/* ignition pre-dirvers */
/* ignition pre-drivers */
[4] = {.port = GPIOI, .pad = 9}, /* IGN 8 */
[5] = {.port = GPIOC, .pad = 15}, /* IGN 6 */
[6] = {.port = GPIOC, .pad = 14}, /* IGN 2 */

View File

@ -20,6 +20,9 @@
#include "odometer.h"
#include "defaults.h"
#include "../board_id/qc_stim_meta.h"
#if EFI_PROD_CODE
#include "drivers/gpio/mc33810.h"
#endif /* EFI_PROD_CODE */
static_assert(libPROTEUS_STIM_QC == (int)engine_type_e::PROTEUS_STIM_QC);
static_assert(libHELLEN_2CHAN_STIM_QC == (int)engine_type_e::HELLEN_2CHAN_STIM_QC);
@ -71,7 +74,17 @@ void setDiscoveryPdm() {
}
#if HW_FRANKENSO
void setDiscovery33810Test() {
engineConfiguration->injectionPins[0] = Gpio::MC33810_0_OUT_0;
engineConfiguration->injectionPins[1] = Gpio::Unassigned;
engineConfiguration->injectionPins[2] = Gpio::Unassigned;
engineConfiguration->injectionPins[3] = Gpio::Unassigned;
engineConfiguration->ignitionPins[0] = Gpio::MC33810_0_GD_0;
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
engineConfiguration->ignitionPins[2] = Gpio::Unassigned;
engineConfiguration->ignitionPins[3] = Gpio::Unassigned;
}
#endif // HW_FRANKENSO