steps towards smarter gpio
This commit is contained in:
parent
00e848c243
commit
fb0bbc075c
|
@ -91,6 +91,7 @@ void setMinimalPinsEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
CONFIGB(sdCardCsPin) = GPIO_UNASSIGNED;
|
||||
boardConfiguration->fanPin = GPIO_UNASSIGNED;
|
||||
CONFIGB(idle).solenoidPin = GPIO_UNASSIGNED;
|
||||
boardConfiguration->fuelPumpPin = GPIO_UNASSIGNED;
|
||||
for (int i = 0;i<TRIGGER_INPUT_PIN_COUNT;i++) {
|
||||
CONFIGB(triggerInputPins)[i] = GPIO_UNASSIGNED;
|
||||
}
|
||||
|
@ -364,6 +365,7 @@ void setTle8888TestConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
CONFIG(etb2.directionPin1) = GPIOE_2;
|
||||
CONFIG(etb2.directionPin2) = GPIOE_4;
|
||||
|
||||
boardConfiguration->fuelPumpPin = TLE8888_PIN_20;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ENGINES_CUSTOM_ENGINE_CPP_ */
|
||||
|
|
|
@ -810,6 +810,6 @@ int getRusEfiVersion(void) {
|
|||
if (initBootloader() != 0)
|
||||
return 123;
|
||||
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
|
||||
return 20190410;
|
||||
return 20190412;
|
||||
}
|
||||
#endif /* EFI_UNIT_TEST */
|
||||
|
|
|
@ -286,6 +286,10 @@ OutputPin::OutputPin() {
|
|||
|
||||
bool OutputPin::isInitialized() {
|
||||
#if EFI_GPIO_HARDWARE
|
||||
#if (BOARD_EXT_GPIOCHIPS > 0)
|
||||
if (ext)
|
||||
return true;
|
||||
#endif /* (BOARD_EXT_GPIOCHIPS > 0) */
|
||||
return port != NULL;
|
||||
#else /* EFI_GPIO_HARDWARE */
|
||||
return true;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "global.h"
|
||||
|
||||
#if (BOARD_TLE6240_COUNT > 0)
|
||||
#if (BOARD_TLE8888_COUNT > 0)
|
||||
|
||||
/* to be moved to smart_gpio.cpp */
|
||||
#include "engine_configuration.h"
|
||||
|
@ -296,6 +296,7 @@ int tle8888_writePad(void *data, unsigned int pin, int value)
|
|||
{
|
||||
struct tle8888_priv *chip;
|
||||
|
||||
// todo: so for TLE8888_PIN_20 we 'return -1' here since below TLE8888_DIRECT_OUTPUTS. bug or feature?
|
||||
if ((pin >= TLE8888_DIRECT_OUTPUTS) || (data == NULL))
|
||||
return -1;
|
||||
|
||||
|
@ -528,7 +529,7 @@ static struct tle8888_config tle8888_cfg = {
|
|||
.sspad = 0U,
|
||||
#if defined(STM_F4_FAMILY)
|
||||
.cr1 =
|
||||
SPI_CR1_16BIT_MODE |
|
||||
SPI_CR1_16BIT_MODE |
|
||||
SPI_CR1_SSM |
|
||||
SPI_CR1_SSI |
|
||||
SPI_CR1_LSBFIRST | //LSB first
|
||||
|
@ -539,7 +540,7 @@ static struct tle8888_config tle8888_cfg = {
|
|||
.cr2 = SPI_CR2_16BIT_MODE
|
||||
#elif defined(STM_F7_FAMILY)
|
||||
.cr1 =
|
||||
SPI_CR1_16BIT_MODE |
|
||||
SPI_CR1_16BIT_MODE |
|
||||
SPI_CR1_SSM |
|
||||
SPI_CR1_SSI |
|
||||
SPI_CR1_LSBFIRST |
|
||||
|
|
|
@ -439,6 +439,13 @@ void initHardware(Logging *l) {
|
|||
|
||||
initRtc();
|
||||
|
||||
#if HAL_USE_SPI
|
||||
initSpiModules(boardConfiguration);
|
||||
#endif
|
||||
// initSmartGpio depends on 'initSpiModules'
|
||||
initSmartGpio(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
// output pins potentially depend on 'initSmartGpio'
|
||||
initOutputPins();
|
||||
|
||||
#if EFI_MAX_31855
|
||||
|
@ -459,13 +466,6 @@ void initHardware(Logging *l) {
|
|||
|
||||
turnOnHardware(sharedLogger);
|
||||
|
||||
|
||||
#if HAL_USE_SPI
|
||||
initSpiModules(boardConfiguration);
|
||||
#endif
|
||||
|
||||
initSmartGpio(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_HIP_9011
|
||||
initHip9011(sharedLogger);
|
||||
#endif /* EFI_HIP_9011 */
|
||||
|
|
|
@ -97,7 +97,7 @@ void initSmartGpio() {
|
|||
#endif /* (BOARD_MC33972_COUNT > 0) */
|
||||
|
||||
|
||||
#if (BOARD_TLE6240_COUNT > 0)
|
||||
#if (BOARD_TLE8888_COUNT > 0)
|
||||
if (engineConfiguration->tle8888_cs != GPIO_UNASSIGNED) {
|
||||
static OutputPin tle8888Cs;
|
||||
// // SPI pins are enabled in initSpiModules()
|
||||
|
|
|
@ -24,7 +24,7 @@ void initSmartGpio(void);
|
|||
#endif
|
||||
|
||||
|
||||
#if (BOARD_TLE6240_COUNT > 0)
|
||||
#if (BOARD_EXT_GPIOCHIPS > 0)
|
||||
|
||||
#if defined(STM_F4_FAMILY)
|
||||
#define SPI_CR1_16BIT_MODE SPI_CR1_DFF
|
||||
|
@ -44,6 +44,6 @@ void initSmartGpio(void);
|
|||
unexpected platform
|
||||
#endif
|
||||
|
||||
#endif /* (BOARD_TLE6240_COUNT > 0) */
|
||||
#endif /* (BOARD_EXT_GPIOCHIPS > 0) */
|
||||
|
||||
#endif /* HW_LAYER_SMART_GPIO_H_ */
|
||||
|
|
Loading…
Reference in New Issue