we need TLE8888 driver #714
This commit is contained in:
parent
defdacd895
commit
11e60e35bf
|
@ -202,6 +202,7 @@ CPPSRC = $(CHCPPSRC) \
|
||||||
$(BOARDSRC_CPP) \
|
$(BOARDSRC_CPP) \
|
||||||
$(ENGINES_SRC_CPP) \
|
$(ENGINES_SRC_CPP) \
|
||||||
$(HW_LAYER_EMS_CPP) \
|
$(HW_LAYER_EMS_CPP) \
|
||||||
|
$(HW_LAYER_DRIVERS_CPP) \
|
||||||
$(HW_SENSORS_SRC) \
|
$(HW_SENSORS_SRC) \
|
||||||
$(TUNERSTUDIO_SRC_CPP) \
|
$(TUNERSTUDIO_SRC_CPP) \
|
||||||
$(CONSOLE_SRC_CPP) \
|
$(CONSOLE_SRC_CPP) \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Mar 22 22:56:39 EDT 2019
|
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 25 14:42:37 EDT 2019
|
||||||
// begin
|
// begin
|
||||||
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
|
#ifndef ENGINE_CONFIGURATION_GENERATED_H_
|
||||||
#define ENGINE_CONFIGURATION_GENERATED_H_
|
#define ENGINE_CONFIGURATION_GENERATED_H_
|
||||||
|
@ -2214,7 +2214,11 @@ typedef struct {
|
||||||
/**
|
/**
|
||||||
* offset 3129
|
* offset 3129
|
||||||
*/
|
*/
|
||||||
uint8_t unusedTest55[3];
|
brain_pin_e tle8888_cs;
|
||||||
|
/**
|
||||||
|
* offset 3130
|
||||||
|
*/
|
||||||
|
uint8_t unusedTest55[2];
|
||||||
/**
|
/**
|
||||||
* Optional timing advance table for Cranking (see useSeparateAdvanceForCranking)
|
* Optional timing advance table for Cranking (see useSeparateAdvanceForCranking)
|
||||||
* offset 3132
|
* offset 3132
|
||||||
|
@ -2360,7 +2364,11 @@ typedef struct {
|
||||||
/**
|
/**
|
||||||
* offset 4020
|
* offset 4020
|
||||||
*/
|
*/
|
||||||
int mainUnusedEnd[615];
|
spi_device_e tle8888spiDevice;
|
||||||
|
/**
|
||||||
|
* offset 4024
|
||||||
|
*/
|
||||||
|
int mainUnusedEnd[614];
|
||||||
/** total size 6480*/
|
/** total size 6480*/
|
||||||
} engine_configuration_s;
|
} engine_configuration_s;
|
||||||
|
|
||||||
|
@ -2607,4 +2615,4 @@ typedef struct {
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// end
|
// end
|
||||||
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Mar 22 22:56:39 EDT 2019
|
// this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 25 14:42:37 EDT 2019
|
||||||
|
|
|
@ -524,6 +524,7 @@ typedef enum {
|
||||||
CIM_DEFAULT = 0,
|
CIM_DEFAULT = 0,
|
||||||
CIM_FIXED_ANGLE = 1,
|
CIM_FIXED_ANGLE = 1,
|
||||||
|
|
||||||
|
// todo: make this a one byte enum
|
||||||
Force_4_bytes_size_cranking_ignition_mode = ENUM_32_BITS,
|
Force_4_bytes_size_cranking_ignition_mode = ENUM_32_BITS,
|
||||||
} cranking_ignition_mode_e;
|
} cranking_ignition_mode_e;
|
||||||
|
|
||||||
|
@ -533,7 +534,7 @@ typedef enum {
|
||||||
UART_DEVICE_2 = 2,
|
UART_DEVICE_2 = 2,
|
||||||
UART_DEVICE_3 = 3,
|
UART_DEVICE_3 = 3,
|
||||||
UART_DEVICE_4 = 4,
|
UART_DEVICE_4 = 4,
|
||||||
|
// todo: make this a one byte enum
|
||||||
Force_4_bytes_size_uart_device = ENUM_32_BITS,
|
Force_4_bytes_size_uart_device = ENUM_32_BITS,
|
||||||
} uart_device_e;
|
} uart_device_e;
|
||||||
|
|
||||||
|
@ -545,6 +546,7 @@ typedef enum {
|
||||||
SPI_DEVICE_3 = 3,
|
SPI_DEVICE_3 = 3,
|
||||||
SPI_DEVICE_4 = 4,
|
SPI_DEVICE_4 = 4,
|
||||||
|
|
||||||
|
// todo: make this a one byte enum
|
||||||
Force_4_bytes_size_spi_device = ENUM_32_BITS,
|
Force_4_bytes_size_spi_device = ENUM_32_BITS,
|
||||||
} spi_device_e;
|
} spi_device_e;
|
||||||
|
|
||||||
|
|
|
@ -1582,8 +1582,10 @@
|
||||||
#define externalKnockSenseAdc_offset_hex c37
|
#define externalKnockSenseAdc_offset_hex c37
|
||||||
#define stepperEnablePin_offset 3128
|
#define stepperEnablePin_offset 3128
|
||||||
#define stepperEnablePin_offset_hex c38
|
#define stepperEnablePin_offset_hex c38
|
||||||
#define unusedTest55_offset 3129
|
#define tle8888_cs_offset 3129
|
||||||
#define unusedTest55_offset_hex c39
|
#define tle8888_cs_offset_hex c39
|
||||||
|
#define unusedTest55_offset 3130
|
||||||
|
#define unusedTest55_offset_hex c3a
|
||||||
#define crankingAdvanceBins_offset 3132
|
#define crankingAdvanceBins_offset 3132
|
||||||
#define crankingAdvanceBins_offset_hex c3c
|
#define crankingAdvanceBins_offset_hex c3c
|
||||||
#define crankingAdvance_offset 3148
|
#define crankingAdvance_offset 3148
|
||||||
|
@ -1682,8 +1684,10 @@
|
||||||
#define idlePidFalloffDeltaRpm_offset_hex fb0
|
#define idlePidFalloffDeltaRpm_offset_hex fb0
|
||||||
#define unusedIdleTimingPid_offset 4018
|
#define unusedIdleTimingPid_offset 4018
|
||||||
#define unusedIdleTimingPid_offset_hex fb2
|
#define unusedIdleTimingPid_offset_hex fb2
|
||||||
#define mainUnusedEnd_offset 4020
|
#define tle8888spiDevice_offset 4020
|
||||||
#define mainUnusedEnd_offset_hex fb4
|
#define tle8888spiDevice_offset_hex fb4
|
||||||
|
#define mainUnusedEnd_offset 4024
|
||||||
|
#define mainUnusedEnd_offset_hex fb8
|
||||||
#define cltCrankingCorrBins_offset 6480
|
#define cltCrankingCorrBins_offset 6480
|
||||||
#define cltCrankingCorrBins_offset_hex 1950
|
#define cltCrankingCorrBins_offset_hex 1950
|
||||||
#define cltCrankingCorr_offset 6512
|
#define cltCrankingCorr_offset 6512
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
DRIVERS_DIR=$(PROJECT_DIR)/hw_layer/drivers
|
DRIVERS_DIR=$(PROJECT_DIR)/hw_layer/drivers
|
||||||
|
|
||||||
HW_LAYER_DRIVERS_INC = \
|
HW_LAYER_DRIVERS_INC = \
|
||||||
$(DRIVERS_DIR)
|
$(DRIVERS_DIR) \
|
||||||
|
$(DRIVERS_DIR)\gpio \
|
||||||
|
|
||||||
HW_LAYER_DRIVERS_CORE = \
|
HW_LAYER_DRIVERS_CORE = \
|
||||||
$(DRIVERS_DIR)/gpio/core.c \
|
$(DRIVERS_DIR)/gpio/core.c \
|
||||||
|
|
||||||
HW_LAYER_DRIVERS = \
|
HW_LAYER_DRIVERS = \
|
||||||
$(DRIVERS_DIR)/gpio/tle6240.c \
|
$(DRIVERS_DIR)/gpio/tle6240.c \
|
||||||
|
|
||||||
|
|
||||||
|
HW_LAYER_DRIVERS_CPP = \
|
||||||
|
$(DRIVERS_DIR)/gpio/tle8888.cpp \
|
||||||
|
|
||||||
|
|
|
@ -265,6 +265,9 @@ const char *portNameExt(unsigned int pin)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return result code
|
||||||
|
*/
|
||||||
int gpiochip_register(const char *name, struct gpiochip_ops *ops, size_t size, void *priv)
|
int gpiochip_register(const char *name, struct gpiochip_ops *ops, size_t size, void *priv)
|
||||||
{
|
{
|
||||||
(void)name; (void)ops; (void)size; (void)priv;
|
(void)name; (void)ops; (void)size; (void)priv;
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
/**
|
||||||
|
* @date Mar 25, 2019
|
||||||
|
* @author Andrey Belomutskiy, (c) 2012-2019
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TLE8888_CmdOE 0x1C
|
||||||
|
|
||||||
|
#include "engine.h"
|
||||||
|
#include "tle8888.h"
|
||||||
|
|
||||||
|
EXTERN_ENGINE;
|
||||||
|
|
||||||
|
static SPIDriver *driver;
|
||||||
|
|
||||||
|
static SPIConfig spiConfig;
|
||||||
|
|
||||||
|
void initTle8888(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||||
|
if (engineConfiguration->tle8888_cs == GPIO_UNASSIGNED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* tle8888.h
|
||||||
|
*
|
||||||
|
* Created on: Mar 25, 2019
|
||||||
|
* Author: garage
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef HW_LAYER_DRIVERS_GPIO_TLE8888_H_
|
||||||
|
#define HW_LAYER_DRIVERS_GPIO_TLE8888_H_
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
void initTle8888(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
|
#endif /* HW_LAYER_DRIVERS_GPIO_TLE8888_H_ */
|
|
@ -23,6 +23,7 @@
|
||||||
#include "yaw_rate_sensor.h"
|
#include "yaw_rate_sensor.h"
|
||||||
#include "pin_repository.h"
|
#include "pin_repository.h"
|
||||||
#include "max31855.h"
|
#include "max31855.h"
|
||||||
|
#include "tle8888.h"
|
||||||
#include "accelerometer.h"
|
#include "accelerometer.h"
|
||||||
#include "eficonsole.h"
|
#include "eficonsole.h"
|
||||||
#include "console_io.h"
|
#include "console_io.h"
|
||||||
|
@ -428,6 +429,8 @@ void initHardware(Logging *l) {
|
||||||
initMax31855(sharedLogger, getSpiDevice(CONFIGB(max31855spiDevice)), CONFIGB(max31855_cs));
|
initMax31855(sharedLogger, getSpiDevice(CONFIGB(max31855spiDevice)), CONFIGB(max31855_cs));
|
||||||
#endif /* EFI_MAX_31855 */
|
#endif /* EFI_MAX_31855 */
|
||||||
|
|
||||||
|
initTle8888(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||||
|
|
||||||
#if EFI_CAN_SUPPORT
|
#if EFI_CAN_SUPPORT
|
||||||
initCan();
|
initCan();
|
||||||
#endif /* EFI_CAN_SUPPORT */
|
#endif /* EFI_CAN_SUPPORT */
|
||||||
|
|
|
@ -944,7 +944,8 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0.0, 300,
|
||||||
pin_output_mode_e stepperDirectionPinMode;
|
pin_output_mode_e stepperDirectionPinMode;
|
||||||
adc_channel_e externalKnockSenseAdc;
|
adc_channel_e externalKnockSenseAdc;
|
||||||
brain_pin_e stepperEnablePin;
|
brain_pin_e stepperEnablePin;
|
||||||
uint8_t[3] unusedTest55;
|
brain_pin_e tle8888_cs;
|
||||||
|
uint8_t[2] unusedTest55;
|
||||||
|
|
||||||
float[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvanceBins;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"RPM", 1, 0, 0.0, 18000, 2
|
float[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvanceBins;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"RPM", 1, 0, 0.0, 18000, 2
|
||||||
float[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvance ;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"deg", 1, 0, -20, 90, 2
|
float[CRANKING_ADVANCE_CURVE_SIZE] crankingAdvance ;Optional timing advance table for Cranking (see useSeparateAdvanceForCranking);"deg", 1, 0, -20, 90, 2
|
||||||
|
@ -990,8 +991,9 @@ tChargeMode_e tChargeMode;
|
||||||
int16_t idleTimingPidDeadZone;If RPM is too perfect, let's leave the advance angle alone to avoid oscillation;"RPM", 1, 0, 0, 1000, 0
|
int16_t idleTimingPidDeadZone;If RPM is too perfect, let's leave the advance angle alone to avoid oscillation;"RPM", 1, 0, 0, 1000, 0
|
||||||
int16_t idlePidFalloffDeltaRpm;Added to the work zone for smooth correction falloff;"RPM", 1, 0, 0, 1000, 0
|
int16_t idlePidFalloffDeltaRpm;Added to the work zone for smooth correction falloff;"RPM", 1, 0, 0, 1000, 0
|
||||||
int16_t unusedIdleTimingPid;
|
int16_t unusedIdleTimingPid;
|
||||||
|
spi_device_e tle8888spiDevice;
|
||||||
|
|
||||||
int[615] mainUnusedEnd;
|
int[614] mainUnusedEnd;
|
||||||
|
|
||||||
|
|
||||||
end_struct
|
end_struct
|
||||||
|
|
|
@ -1638,6 +1638,7 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
|
||||||
field = "Saab CDM knock", cdmInputPin
|
field = "Saab CDM knock", cdmInputPin
|
||||||
field = "comm status light", communicationLedPin
|
field = "comm status light", communicationLedPin
|
||||||
field = "running status light", runningLedPin
|
field = "running status light", runningLedPin
|
||||||
|
field = "TLE8888 Chip Select", tle8888_cs
|
||||||
|
|
||||||
|
|
||||||
dialog = allPins1_2, "", xAxis
|
dialog = allPins1_2, "", xAxis
|
||||||
|
@ -1850,8 +1851,10 @@ cmd_set_engine_type_default = "w\x00\x31\x00\x00"
|
||||||
field = "Main Relay Pin", mainRelayPin
|
field = "Main Relay Pin", mainRelayPin
|
||||||
field = "Fuel Pump Pin Mode", fuelPumpPinMode
|
field = "Fuel Pump Pin Mode", fuelPumpPinMode
|
||||||
field = "Fuel Pump Pin", fuelPumpPin
|
field = "Fuel Pump Pin", fuelPumpPin
|
||||||
field = "Check Engine Pin Mode", malfunctionIndicatorPinMode
|
field = "Check Engine Pin Mode", malfunctionIndicatorPinMode
|
||||||
field = "Check Engine Pin", malfunctionIndicatorPin
|
field = "Check Engine Pin", malfunctionIndicatorPin
|
||||||
|
field = "TLE8888 Chip Select", tle8888_cs
|
||||||
|
field = "TLE8888 SPI", tle8888spiDevice
|
||||||
|
|
||||||
; Engine->MIL Settings
|
; Engine->MIL Settings
|
||||||
dialog = malfunction, "Check Engine Settings"
|
dialog = malfunction, "Check Engine Settings"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.rusefi.config;
|
package com.rusefi.config;
|
||||||
|
|
||||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Fri Mar 22 22:56:39 EDT 2019
|
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Mon Mar 25 14:42:37 EDT 2019
|
||||||
public class Fields {
|
public class Fields {
|
||||||
public static final int LE_COMMAND_LENGTH = 200;
|
public static final int LE_COMMAND_LENGTH = 200;
|
||||||
public static final int BLOCKING_FACTOR = 400;
|
public static final int BLOCKING_FACTOR = 400;
|
||||||
|
@ -1008,7 +1008,8 @@ public class Fields {
|
||||||
public static final int stepperDirectionPinMode_offset = 3126;
|
public static final int stepperDirectionPinMode_offset = 3126;
|
||||||
public static final int externalKnockSenseAdc_offset = 3127;
|
public static final int externalKnockSenseAdc_offset = 3127;
|
||||||
public static final int stepperEnablePin_offset = 3128;
|
public static final int stepperEnablePin_offset = 3128;
|
||||||
public static final int unusedTest55_offset = 3129;
|
public static final int tle8888_cs_offset = 3129;
|
||||||
|
public static final int unusedTest55_offset = 3130;
|
||||||
public static final int crankingAdvanceBins_offset = 3132;
|
public static final int crankingAdvanceBins_offset = 3132;
|
||||||
public static final int crankingAdvance_offset = 3148;
|
public static final int crankingAdvance_offset = 3148;
|
||||||
public static final int servoOutputPins1_offset = 3164;
|
public static final int servoOutputPins1_offset = 3164;
|
||||||
|
@ -1058,7 +1059,8 @@ public class Fields {
|
||||||
public static final int idleTimingPidDeadZone_offset = 4014;
|
public static final int idleTimingPidDeadZone_offset = 4014;
|
||||||
public static final int idlePidFalloffDeltaRpm_offset = 4016;
|
public static final int idlePidFalloffDeltaRpm_offset = 4016;
|
||||||
public static final int unusedIdleTimingPid_offset = 4018;
|
public static final int unusedIdleTimingPid_offset = 4018;
|
||||||
public static final int mainUnusedEnd_offset = 4020;
|
public static final int tle8888spiDevice_offset = 4020;
|
||||||
|
public static final int mainUnusedEnd_offset = 4024;
|
||||||
public static final int cltCrankingCorrBins_offset = 6480;
|
public static final int cltCrankingCorrBins_offset = 6480;
|
||||||
public static final int cltCrankingCorrBins_offset_hex = 1950;
|
public static final int cltCrankingCorrBins_offset_hex = 1950;
|
||||||
public static final int cltCrankingCorr_offset = 6512;
|
public static final int cltCrankingCorr_offset = 6512;
|
||||||
|
@ -1886,6 +1888,7 @@ public class Fields {
|
||||||
public static final Field STEPPERDIRECTIONPINMODE = Field.create("STEPPERDIRECTIONPINMODE", 3126, FieldType.INT, pin_output_mode_e);
|
public static final Field STEPPERDIRECTIONPINMODE = Field.create("STEPPERDIRECTIONPINMODE", 3126, FieldType.INT, pin_output_mode_e);
|
||||||
public static final Field EXTERNALKNOCKSENSEADC = Field.create("EXTERNALKNOCKSENSEADC", 3127, FieldType.INT, adc_channel_e);
|
public static final Field EXTERNALKNOCKSENSEADC = Field.create("EXTERNALKNOCKSENSEADC", 3127, FieldType.INT, adc_channel_e);
|
||||||
public static final Field STEPPERENABLEPIN = Field.create("STEPPERENABLEPIN", 3128, FieldType.INT, brain_pin_e);
|
public static final Field STEPPERENABLEPIN = Field.create("STEPPERENABLEPIN", 3128, FieldType.INT, brain_pin_e);
|
||||||
|
public static final Field TLE8888_CS = Field.create("TLE8888_CS", 3129, FieldType.INT, brain_pin_e);
|
||||||
public static final Field SERVOOUTPUTPINS1 = Field.create("SERVOOUTPUTPINS1", 3164, FieldType.INT, brain_pin_e);
|
public static final Field SERVOOUTPUTPINS1 = Field.create("SERVOOUTPUTPINS1", 3164, FieldType.INT, brain_pin_e);
|
||||||
public static final Field SERVOOUTPUTPINS2 = Field.create("SERVOOUTPUTPINS2", 3165, FieldType.INT, brain_pin_e);
|
public static final Field SERVOOUTPUTPINS2 = Field.create("SERVOOUTPUTPINS2", 3165, FieldType.INT, brain_pin_e);
|
||||||
public static final Field SERVOOUTPUTPINS3 = Field.create("SERVOOUTPUTPINS3", 3166, FieldType.INT, brain_pin_e);
|
public static final Field SERVOOUTPUTPINS3 = Field.create("SERVOOUTPUTPINS3", 3166, FieldType.INT, brain_pin_e);
|
||||||
|
@ -1927,6 +1930,7 @@ public class Fields {
|
||||||
public static final Field IDLETIMINGPIDDEADZONE = Field.create("IDLETIMINGPIDDEADZONE", 4014, FieldType.INT);
|
public static final Field IDLETIMINGPIDDEADZONE = Field.create("IDLETIMINGPIDDEADZONE", 4014, FieldType.INT);
|
||||||
public static final Field IDLEPIDFALLOFFDELTARPM = Field.create("IDLEPIDFALLOFFDELTARPM", 4016, FieldType.INT);
|
public static final Field IDLEPIDFALLOFFDELTARPM = Field.create("IDLEPIDFALLOFFDELTARPM", 4016, FieldType.INT);
|
||||||
public static final Field UNUSEDIDLETIMINGPID = Field.create("UNUSEDIDLETIMINGPID", 4018, FieldType.INT);
|
public static final Field UNUSEDIDLETIMINGPID = Field.create("UNUSEDIDLETIMINGPID", 4018, FieldType.INT);
|
||||||
|
public static final Field TLE8888SPIDEVICE = Field.create("TLE8888SPIDEVICE", 4020, FieldType.INT);
|
||||||
public static final Field FSIOFORMULAS1 = Field.create("FSIOFORMULAS1", 6672, FieldType.INT);
|
public static final Field FSIOFORMULAS1 = Field.create("FSIOFORMULAS1", 6672, FieldType.INT);
|
||||||
public static final Field FSIOFORMULAS2 = Field.create("FSIOFORMULAS2", 6872, FieldType.INT);
|
public static final Field FSIOFORMULAS2 = Field.create("FSIOFORMULAS2", 6872, FieldType.INT);
|
||||||
public static final Field FSIOFORMULAS3 = Field.create("FSIOFORMULAS3", 7072, FieldType.INT);
|
public static final Field FSIOFORMULAS3 = Field.create("FSIOFORMULAS3", 7072, FieldType.INT);
|
||||||
|
|
Loading…
Reference in New Issue