2019-04-13 07:58:52 -07:00
|
|
|
/*
|
|
|
|
* @file smart_gpio.cpp
|
|
|
|
*
|
|
|
|
* @date Apr 13, 2019
|
2020-01-07 21:02:40 -08:00
|
|
|
* @author Andrey Belomutskiy, (c) 2012-2020
|
2019-04-13 07:58:52 -07:00
|
|
|
*/
|
|
|
|
|
2021-07-25 22:05:17 -07:00
|
|
|
#include "pch.h"
|
2019-04-13 08:22:40 -07:00
|
|
|
|
|
|
|
#if EFI_PROD_CODE
|
2019-04-13 07:58:52 -07:00
|
|
|
#include "smart_gpio.h"
|
2019-04-13 16:32:46 -07:00
|
|
|
#include "hardware.h"
|
2019-04-14 10:35:30 -07:00
|
|
|
#include "mpu_util.h"
|
2019-04-13 07:58:52 -07:00
|
|
|
#include "gpio_ext.h"
|
|
|
|
#include "drivers/gpio/tle6240.h"
|
|
|
|
#include "drivers/gpio/mc33972.h"
|
2020-01-07 04:55:50 -08:00
|
|
|
#include "drivers/gpio/mc33810.h"
|
2019-04-13 07:58:52 -07:00
|
|
|
#include "drivers/gpio/tle8888.h"
|
2020-09-09 14:16:51 -07:00
|
|
|
#include "drivers/gpio/drv8860.h"
|
2022-01-10 16:15:04 -08:00
|
|
|
#include "drivers/gpio/l9779.h"
|
2019-04-13 07:58:52 -07:00
|
|
|
|
2021-01-06 15:29:47 -08:00
|
|
|
#if (BOARD_TLE6240_COUNT > 0)
|
2019-04-15 05:40:12 -07:00
|
|
|
// todo: migrate to TS or board config
|
|
|
|
#ifndef TLE6240_RESET_PORT
|
|
|
|
#define TLE6240_RESET_PORT GPIOG
|
|
|
|
#endif /* TLE6240_RESET_PORT */
|
|
|
|
#ifndef TLE6240_RESET_PAD
|
|
|
|
#define TLE6240_RESET_PAD 3U
|
|
|
|
#endif /* TLE6240_RESET_PAD */
|
|
|
|
#ifndef TLE6240_DIRECT_IO
|
|
|
|
#define TLE6240_DIRECT_IO \
|
|
|
|
/* IN1 - D_TACH_OUT */ \
|
|
|
|
[0] = {.port = GPIOG, .pad = 2}, \
|
|
|
|
/* IN2..4 grounded */ \
|
|
|
|
[1] = {.port = NULL, .pad = 0}, \
|
|
|
|
[2] = {.port = NULL, .pad = 0}, \
|
|
|
|
[3] = {.port = NULL, .pad = 0}, \
|
|
|
|
/* IN9 - D_INJ_5 */ \
|
|
|
|
[4] = {.port = GPIOD, .pad = 15}, \
|
|
|
|
/* IN10 - D_WASTGATE */ \
|
|
|
|
[5] = {.port = GPIOD, .pad = 14}, \
|
|
|
|
/* IN11 - D_IDLE_OPEN */ \
|
|
|
|
[6] = {.port = GPIOC, .pad = 6}, \
|
|
|
|
/* IN12 - D_IDLE_CLOSE */ \
|
|
|
|
[7] = {.port = GPIOC, .pad = 7},
|
|
|
|
#endif /* TLE6240_DIRECT_IO */
|
|
|
|
|
2021-01-06 15:29:47 -08:00
|
|
|
static OutputPin tle6240Cs;
|
2019-04-13 16:32:46 -07:00
|
|
|
struct tle6240_config tle6240 = {
|
2021-01-06 15:29:47 -08:00
|
|
|
.spi_bus = NULL,
|
2019-04-13 07:58:52 -07:00
|
|
|
.spi_config = {
|
|
|
|
.circular = false,
|
|
|
|
.end_cb = NULL,
|
2019-04-20 20:39:06 -07:00
|
|
|
.ssport = NULL,
|
|
|
|
.sspad = 0,
|
2019-04-13 07:58:52 -07:00
|
|
|
.cr1 =
|
2019-04-14 10:35:30 -07:00
|
|
|
SPI_CR1_16BIT_MODE |
|
2019-04-13 07:58:52 -07:00
|
|
|
SPI_CR1_SSM |
|
|
|
|
SPI_CR1_SSI |
|
|
|
|
/* SPI_CR1_LSBFIRST | */
|
|
|
|
((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
|
|
|
|
},
|
|
|
|
.direct_io = {
|
2019-04-15 05:40:12 -07:00
|
|
|
TLE6240_DIRECT_IO
|
2019-04-13 07:58:52 -07:00
|
|
|
},
|
2019-04-15 05:40:12 -07:00
|
|
|
.reset = {.port = TLE6240_RESET_PORT, .pad = TLE6240_RESET_PAD}
|
2019-04-13 07:58:52 -07:00
|
|
|
};
|
2019-04-13 08:22:40 -07:00
|
|
|
#endif /* (BOARD_TLE6240_COUNT > 0) */
|
2019-04-13 07:58:52 -07:00
|
|
|
|
2019-04-13 08:22:40 -07:00
|
|
|
#if (BOARD_MC33972_COUNT > 0)
|
2021-01-06 15:29:47 -08:00
|
|
|
static OutputPin mc33972Cs;
|
2019-04-13 16:32:46 -07:00
|
|
|
struct mc33972_config mc33972 = {
|
2021-01-06 15:29:47 -08:00
|
|
|
.spi_bus = NULL,
|
2019-04-13 07:58:52 -07:00
|
|
|
.spi_config = {
|
|
|
|
.circular = false,
|
|
|
|
.end_cb = NULL,
|
2019-04-20 20:39:06 -07:00
|
|
|
.ssport = NULL,
|
|
|
|
.sspad = 0,
|
2019-04-13 07:58:52 -07:00
|
|
|
.cr1 =
|
2021-04-28 15:29:35 -07:00
|
|
|
SPI_CR1_8BIT_MODE |
|
2019-04-13 07:58:52 -07:00
|
|
|
SPI_CR1_SSM |
|
|
|
|
SPI_CR1_SSI |
|
|
|
|
/* SPI_CR1_LSBFIRST | */
|
|
|
|
((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | /* div = 16 */
|
|
|
|
SPI_CR1_MSTR |
|
|
|
|
/* SPI_CR1_CPOL | */ /* = 0 */
|
|
|
|
SPI_CR1_CPHA | /* = 1 */
|
|
|
|
0,
|
2021-04-28 15:29:35 -07:00
|
|
|
.cr2 = SPI_CR2_8BIT_MODE
|
2019-04-13 07:58:52 -07:00
|
|
|
},
|
|
|
|
};
|
2019-04-13 08:22:40 -07:00
|
|
|
#endif /* (BOARD_MC33972_COUNT > 0) */
|
2019-04-13 07:58:52 -07:00
|
|
|
|
2022-01-10 16:15:04 -08:00
|
|
|
#if (BOARD_L9779_COUNT > 0)
|
|
|
|
static OutputPin l9779Cs;
|
|
|
|
struct l9779_config l9779_cfg = {
|
|
|
|
.spi_bus = NULL,
|
2022-02-06 06:47:18 -08:00
|
|
|
.spi_config = {
|
|
|
|
.circular = false,
|
|
|
|
.end_cb = NULL,
|
|
|
|
.ssport = NULL,
|
|
|
|
.sspad = 0,
|
|
|
|
.cr1 =
|
|
|
|
SPI_CR1_16BIT_MODE |
|
|
|
|
SPI_CR1_SSM |
|
|
|
|
SPI_CR1_SSI |
|
|
|
|
//SPI_CR1_LSBFIRST | //MSB first
|
|
|
|
((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16, up to 8 MHz
|
|
|
|
SPI_CR1_MSTR |
|
|
|
|
SPI_CR1_CPHA |
|
|
|
|
0,
|
|
|
|
.cr2 = SPI_CR2_16BIT_MODE
|
|
|
|
},
|
2022-02-06 08:39:37 -08:00
|
|
|
.direct_gpio = {
|
|
|
|
/* IGNI1..IGNI4 */
|
|
|
|
[0] = {.port = NULL, .pad = 0},
|
|
|
|
[1] = {.port = NULL, .pad = 0},
|
|
|
|
[2] = {.port = NULL, .pad = 0},
|
|
|
|
[3] = {.port = NULL, .pad = 0},
|
|
|
|
/* IN1..IN7 */
|
|
|
|
[4] = {.port = NULL, .pad = 0},
|
|
|
|
[5] = {.port = NULL, .pad = 0},
|
|
|
|
[6] = {.port = NULL, .pad = 0},
|
|
|
|
[7] = {.port = NULL, .pad = 0},
|
|
|
|
[8] = {.port = NULL, .pad = 0},
|
|
|
|
[9] = {.port = NULL, .pad = 0},
|
|
|
|
[10] = {.port = NULL, .pad = 0},
|
|
|
|
},
|
|
|
|
/* PWM (IN8) */
|
|
|
|
.pwm_gpio = {.port = NULL, .pad = 0},
|
2022-01-10 16:15:04 -08:00
|
|
|
};
|
|
|
|
#endif /* (BOARD_L9779_COUNT > 0) */
|
|
|
|
|
2019-04-16 06:23:24 -07:00
|
|
|
#if (BOARD_TLE8888_COUNT > 0)
|
2021-01-06 15:29:47 -08:00
|
|
|
static OutputPin tle8888Cs;
|
2019-04-20 20:39:06 -07:00
|
|
|
struct tle8888_config tle8888_cfg = {
|
2019-04-16 06:23:24 -07:00
|
|
|
.spi_bus = NULL,
|
|
|
|
.spi_config = {
|
|
|
|
.circular = false,
|
|
|
|
.end_cb = NULL,
|
2019-04-20 20:49:26 -07:00
|
|
|
.ssport = NULL,
|
|
|
|
.sspad = 0,
|
2019-04-16 06:23:24 -07:00
|
|
|
.cr1 =
|
|
|
|
SPI_CR1_16BIT_MODE |
|
|
|
|
SPI_CR1_SSM |
|
|
|
|
SPI_CR1_SSI |
|
|
|
|
SPI_CR1_LSBFIRST | //LSB first
|
|
|
|
((3 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | // div = 16
|
|
|
|
SPI_CR1_MSTR |
|
|
|
|
SPI_CR1_CPHA |
|
|
|
|
0,
|
|
|
|
.cr2 = SPI_CR2_16BIT_MODE
|
|
|
|
},
|
2019-04-18 22:42:24 -07:00
|
|
|
.reset = {.port = NULL, .pad = 0},
|
2020-10-23 09:25:30 -07:00
|
|
|
.direct_gpio = {
|
|
|
|
/* IN1..4 -> OUT1..OUT4 (Injectors) */
|
|
|
|
[0] = {.port = GPIOE, .pad = 14},
|
|
|
|
[1] = {.port = GPIOE, .pad = 13},
|
|
|
|
[2] = {.port = GPIOE, .pad = 12},
|
|
|
|
[3] = {.port = GPIOE, .pad = 11},
|
|
|
|
/* IN5..8 -> IGN1..IGN4 (Ignotors) */
|
|
|
|
/* Not used */
|
|
|
|
[4] = {.port = NULL, .pad = 0},
|
|
|
|
[5] = {.port = NULL, .pad = 0},
|
|
|
|
[6] = {.port = NULL, .pad = 0},
|
|
|
|
[7] = {.port = NULL, .pad = 0},
|
|
|
|
/* Remapable IN9..12 */
|
|
|
|
[8] = {.port = GPIOE, .pad = 10},
|
|
|
|
[9] = {.port = GPIOE, .pad = 9},
|
|
|
|
[10] = {.port = GPIOE, .pad = 8},
|
|
|
|
[11] = {.port = GPIOE, .pad = 7},
|
|
|
|
},
|
|
|
|
.direct_maps = {
|
|
|
|
[0] = {.output = 5},
|
|
|
|
[1] = {.output = 6},
|
|
|
|
[2] = {.output = 21},
|
|
|
|
[3] = {.output = 22},
|
2019-04-16 06:23:24 -07:00
|
|
|
},
|
2020-05-08 14:47:41 -07:00
|
|
|
.ign_en = {.port = GPIOD, .pad = 10},
|
|
|
|
.inj_en = {.port = GPIOD, .pad = 11},
|
2020-04-23 16:49:22 -07:00
|
|
|
.mode = TL_AUTO,
|
2020-11-10 11:16:46 -08:00
|
|
|
.stepper = false
|
2019-04-16 06:23:24 -07:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2020-09-09 14:16:51 -07:00
|
|
|
#if (BOARD_DRV8860_COUNT > 0)
|
2021-01-06 15:29:47 -08:00
|
|
|
static OutputPin drv8860Cs;
|
2020-09-09 14:16:51 -07:00
|
|
|
struct drv8860_config drv8860 = {
|
2021-01-06 15:29:47 -08:00
|
|
|
.spi_bus = NULL,
|
2020-09-09 14:16:51 -07:00
|
|
|
.spi_config = {
|
|
|
|
.circular = false,
|
|
|
|
.end_cb = NULL,
|
|
|
|
.ssport = NULL,
|
|
|
|
.sspad = 0,
|
|
|
|
.cr1 =
|
|
|
|
SPI_CR1_16BIT_MODE |
|
|
|
|
SPI_CR1_SSM |
|
|
|
|
SPI_CR1_SSI |
|
|
|
|
((7 << SPI_CR1_BR_Pos) & SPI_CR1_BR) | /* div = 32 */
|
|
|
|
SPI_CR1_MSTR |
|
|
|
|
SPI_CR1_CPOL |
|
|
|
|
0,
|
|
|
|
.cr2 = SPI_CR2_16BIT_MODE
|
|
|
|
},
|
|
|
|
.reset = {.port = DRV8860_RESET_PORT, .pad = DRV8860_RESET_PAD}
|
|
|
|
};
|
|
|
|
#endif /* (BOARD_DRV8860_COUNT > 0) */
|
|
|
|
|
2019-04-13 07:58:52 -07:00
|
|
|
void initSmartGpio() {
|
2019-04-20 20:39:06 -07:00
|
|
|
startSmartCsPins();
|
2019-04-13 07:58:52 -07:00
|
|
|
|
|
|
|
#if (BOARD_TLE6240_COUNT > 0)
|
2021-01-08 17:01:26 -08:00
|
|
|
if (isBrainPinValid(engineConfiguration->tle6240_cs)) {
|
2019-04-21 07:35:13 -07:00
|
|
|
tle6240.spi_config.ssport = getHwPort("tle6240 CS", engineConfiguration->tle6240_cs);
|
|
|
|
tle6240.spi_config.sspad = getHwPin("tle6240 CS", engineConfiguration->tle6240_cs);
|
2019-04-20 20:39:06 -07:00
|
|
|
tle6240.spi_bus = getSpiDevice(engineConfiguration->tle6240spiDevice);
|
2022-04-28 14:32:39 -07:00
|
|
|
int ret = tle6240_add(Gpio::TLE6240_PIN_1, 0, &tle6240);
|
2021-01-06 15:29:47 -08:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
efiAssertVoid(OBD_PCM_Processor_Fault, ret == (int)Gpio::TLE6240_PIN_1, "tle6240");
|
2019-04-20 20:39:06 -07:00
|
|
|
}
|
2020-09-09 14:16:51 -07:00
|
|
|
#endif /* (BOARD_TLE6240_COUNT > 0) */
|
2019-04-13 07:58:52 -07:00
|
|
|
|
|
|
|
#if (BOARD_MC33972_COUNT > 0)
|
2021-01-08 17:01:26 -08:00
|
|
|
if (isBrainPinValid(engineConfiguration->mc33972_cs)) {
|
2019-04-20 20:39:06 -07:00
|
|
|
// todo: reuse initSpiCs method?
|
2019-12-11 14:48:55 -08:00
|
|
|
mc33972.spi_config.ssport = getHwPort("mc33972 CS", engineConfiguration->mc33972_cs);
|
|
|
|
mc33972.spi_config.sspad = getHwPin("mc33972 CS", engineConfiguration->mc33972_cs);
|
2019-04-20 20:39:06 -07:00
|
|
|
mc33972.spi_bus = getSpiDevice(engineConfiguration->mc33972spiDevice);
|
|
|
|
// todo: propogate 'basePinOffset' parameter
|
2022-04-28 14:32:39 -07:00
|
|
|
int ret = mc33972_add(Gpio::MC33972_PIN_1, 0, &mc33972);
|
2021-01-06 15:29:47 -08:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
efiAssertVoid(OBD_PCM_Processor_Fault, ret == (int)Gpio::MC33972_PIN_1, "mc33972");
|
2019-04-20 20:39:06 -07:00
|
|
|
}
|
2020-09-09 14:16:51 -07:00
|
|
|
#endif /* (BOARD_MC33972_COUNT > 0) */
|
2019-04-13 07:58:52 -07:00
|
|
|
|
2022-02-06 06:47:18 -08:00
|
|
|
#if (BOARD_L9779_COUNT > 0)
|
|
|
|
if (isBrainPinValid(engineConfiguration->l9779_cs)) {
|
|
|
|
// todo: reuse initSpiCs method?
|
|
|
|
l9779_cfg.spi_config.ssport = getHwPort("l9779 CS", engineConfiguration->l9779_cs);
|
|
|
|
l9779_cfg.spi_config.sspad = getHwPin("l9779 CS", engineConfiguration->l9779_cs);
|
|
|
|
l9779_cfg.spi_bus = getSpiDevice(engineConfiguration->l9779spiDevice);
|
|
|
|
// todo: propogate 'basePinOffset' parameter
|
2022-04-28 14:32:39 -07:00
|
|
|
int ret = l9779_add(Gpio::L9779_IGN_1, 0, &l9779_cfg);
|
2022-02-06 06:47:18 -08:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
efiAssertVoid(OBD_PCM_Processor_Fault, ret == (int)Gpio::L9779_IGN_1, "l9779");
|
2022-02-06 06:47:18 -08:00
|
|
|
}
|
|
|
|
#endif /* (BOARD_L9779_COUNT > 0) */
|
|
|
|
|
2019-04-13 09:02:34 -07:00
|
|
|
#if (BOARD_TLE8888_COUNT > 0)
|
2021-01-08 17:01:26 -08:00
|
|
|
if (isBrainPinValid(engineConfiguration->tle8888_cs)) {
|
2019-04-16 06:23:24 -07:00
|
|
|
// todo: reuse initSpiCs method?
|
|
|
|
tle8888_cfg.spi_config.ssport = getHwPort("tle8888 CS", engineConfiguration->tle8888_cs);
|
|
|
|
tle8888_cfg.spi_config.sspad = getHwPin("tle8888 CS", engineConfiguration->tle8888_cs);
|
|
|
|
tle8888_cfg.spi_bus = getSpiDevice(engineConfiguration->tle8888spiDevice);
|
|
|
|
|
2020-04-23 13:57:37 -07:00
|
|
|
tle8888_cfg.mode = engineConfiguration->tle8888mode;
|
2020-11-10 11:16:46 -08:00
|
|
|
tle8888_cfg.stepper = engineConfiguration->useTLE8888_stepper;
|
2019-09-03 21:27:19 -07:00
|
|
|
|
2019-04-16 06:23:24 -07:00
|
|
|
/* spi_bus == null checked in _add function */
|
2022-04-28 14:32:39 -07:00
|
|
|
int ret = tle8888_add(Gpio::TLE8888_PIN_1, 0, &tle8888_cfg);
|
2019-04-16 06:23:24 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
efiAssertVoid(OBD_PCM_Processor_Fault, ret == (int)Gpio::TLE8888_PIN_1, "tle8888");
|
2019-04-16 06:23:24 -07:00
|
|
|
}
|
2020-09-09 14:16:51 -07:00
|
|
|
#endif /* (BOARD_TLE8888_COUNT > 0) */
|
|
|
|
|
|
|
|
#if (BOARD_DRV8860_COUNT > 0)
|
2021-01-08 17:01:26 -08:00
|
|
|
if (isBrainPinValid(engineConfiguration->drv8860_cs)) {
|
2020-09-09 14:16:51 -07:00
|
|
|
drv8860.spi_config.ssport = getHwPort("drv8860 CS", engineConfiguration->drv8860_cs);
|
|
|
|
drv8860.spi_config.sspad = getHwPin("drv8860 CS", engineConfiguration->drv8860_cs);
|
|
|
|
drv8860.spi_bus = getSpiDevice(engineConfiguration->drv8860spiDevice);
|
2022-04-28 14:32:39 -07:00
|
|
|
int ret = drv8860_add(Gpio::DRV8860_PIN_1, 0, &drv8860);
|
2020-09-09 14:16:51 -07:00
|
|
|
|
2022-04-28 14:32:39 -07:00
|
|
|
efiAssertVoid(OBD_PCM_Processor_Fault, ret == (int)Gpio::DRV8860_PIN_1, "drv8860");
|
2020-09-09 14:16:51 -07:00
|
|
|
}
|
|
|
|
#endif /* (BOARD_DRV8860_COUNT > 0) */
|
2019-04-13 16:32:46 -07:00
|
|
|
|
2021-01-06 15:29:47 -08:00
|
|
|
#if (BOARD_MC33810_COUNT > 0)
|
|
|
|
/* none of official boards has this IC */
|
|
|
|
#endif /* (BOARD_MC33810_COUNT > 0) */
|
|
|
|
|
2019-04-13 16:32:46 -07:00
|
|
|
/* external chip init */
|
|
|
|
gpiochips_init();
|
2019-04-20 20:39:06 -07:00
|
|
|
}
|
|
|
|
|
2021-05-14 07:54:40 -07:00
|
|
|
void tle8888startup() {
|
|
|
|
static efitick_t tle8888CrankingResetTime = 0;
|
|
|
|
|
2021-11-17 00:54:21 -08:00
|
|
|
if (engineConfiguration->useTLE8888_cranking_hack && engine->rpmCalculator.isCranking()) {
|
2021-05-14 07:54:40 -07:00
|
|
|
efitick_t nowNt = getTimeNowNt();
|
|
|
|
if (nowNt - tle8888CrankingResetTime > MS2NT(300)) {
|
|
|
|
tle8888_req_init();
|
|
|
|
// let's reset TLE8888 every 300ms while cranking since that's the best we can do to deal with undervoltage reset
|
|
|
|
// PS: oh yes, it's a horrible design! Please suggest something better!
|
|
|
|
tle8888CrankingResetTime = nowNt;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-20 20:39:06 -07:00
|
|
|
void stopSmartCsPins() {
|
2019-05-05 08:06:27 -07:00
|
|
|
#if (BOARD_TLE8888_COUNT > 0)
|
2020-11-26 07:55:39 -08:00
|
|
|
efiSetPadUnused(activeConfiguration.tle8888_cs);
|
2019-05-05 08:06:27 -07:00
|
|
|
#endif /* BOARD_TLE8888_COUNT */
|
|
|
|
#if (BOARD_TLE6240_COUNT > 0)
|
2020-11-26 07:55:39 -08:00
|
|
|
efiSetPadUnused(activeConfiguration.tle6240_cs);
|
2019-05-05 08:06:27 -07:00
|
|
|
#endif /* BOARD_TLE6240_COUNT */
|
|
|
|
#if (BOARD_MC33972_COUNT > 0)
|
2020-11-26 07:55:39 -08:00
|
|
|
efiSetPadUnused(activeConfiguration.mc33972_cs);
|
2019-05-05 08:06:27 -07:00
|
|
|
#endif /* BOARD_MC33972_COUNT */
|
2020-09-09 14:16:51 -07:00
|
|
|
#if (BOARD_DRV8860_COUNT > 0)
|
2020-11-26 07:55:39 -08:00
|
|
|
efiSetPadUnused(activeConfiguration.drv8860_cs);
|
2020-09-09 14:16:51 -07:00
|
|
|
#endif /* BOARD_DRV8860_COUNT */
|
2021-01-06 15:29:47 -08:00
|
|
|
#if (BOARD_MC33810_COUNT > 0)
|
|
|
|
/* none of official boards has this IC */
|
|
|
|
#endif /* (BOARD_MC33810_COUNT > 0) */
|
2019-04-20 20:39:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void startSmartCsPins() {
|
2019-05-05 08:06:27 -07:00
|
|
|
#if (BOARD_TLE8888_COUNT > 0)
|
2019-04-20 20:39:06 -07:00
|
|
|
tle8888Cs.initPin("tle8888 CS", engineConfiguration->tle8888_cs,
|
|
|
|
&engineConfiguration->tle8888_csPinMode);
|
2019-05-09 15:09:24 -07:00
|
|
|
tle8888Cs.setValue(true);
|
2019-05-05 08:06:27 -07:00
|
|
|
#endif /* BOARD_TLE8888_COUNT */
|
|
|
|
#if (BOARD_TLE6240_COUNT > 0)
|
|
|
|
tle6240Cs.initPin("tle6240 CS", engineConfiguration->tle6240_cs,
|
2019-04-20 20:39:06 -07:00
|
|
|
&engineConfiguration->tle6240_csPinMode);
|
2019-05-09 15:09:24 -07:00
|
|
|
tle6240Cs.setValue(true);
|
2019-05-05 08:06:27 -07:00
|
|
|
#endif /* BOARD_TLE6240_COUNT */
|
|
|
|
#if (BOARD_MC33972_COUNT > 0)
|
2019-12-11 14:48:55 -08:00
|
|
|
mc33972Cs.initPin("mc33972 CS", engineConfiguration->mc33972_cs,
|
|
|
|
&engineConfiguration->mc33972_csPinMode);
|
2019-05-09 15:09:24 -07:00
|
|
|
mc33972Cs.setValue(true);
|
2019-05-05 08:06:27 -07:00
|
|
|
#endif /* BOARD_MC33972_COUNT */
|
2020-09-09 14:16:51 -07:00
|
|
|
#if (BOARD_DRV8860_COUNT > 0)
|
|
|
|
drv8860Cs.initPin("drv8860 CS", engineConfiguration->drv8860_cs,
|
|
|
|
&engineConfiguration->drv8860_csPinMode);
|
|
|
|
drv8860Cs.setValue(true);
|
|
|
|
#endif /* BOARD_DRV8860_COUNT */
|
2021-01-06 15:29:47 -08:00
|
|
|
#if (BOARD_MC33810_COUNT > 0)
|
|
|
|
/* none of official boards has this IC */
|
|
|
|
#endif /* (BOARD_MC33810_COUNT > 0) */
|
2019-04-13 07:58:52 -07:00
|
|
|
}
|
2019-04-13 08:22:40 -07:00
|
|
|
|
|
|
|
#endif /* EFI_PROD_CODE */
|