rusefi-1/firmware/config/stm32f4ems/efifeatures.h

415 lines
7.9 KiB
C
Raw Normal View History

2015-07-10 06:01:56 -07:00
/**
* @file efifeatures.h
*
* @brief In this header we can configure which firmware modules are used.
*
* @date Aug 29, 2013
2020-01-07 21:02:40 -08:00
* @author Andrey Belomutskiy, (c) 2012-2020
2015-07-10 06:01:56 -07:00
*/
2019-11-03 07:36:35 -08:00
#pragma once
2015-07-10 06:01:56 -07:00
2017-04-21 12:14:37 -07:00
#define EFI_GPIO_HARDWARE TRUE
2015-07-10 06:01:56 -07:00
2020-01-31 11:29:52 -08:00
#define EFI_BOOST_CONTROL TRUE
2020-03-23 17:44:34 -07:00
#define EFI_LAUNCH_CONTROL TRUE
2020-03-23 17:44:34 -07:00
#define EFI_DYNO_VIEW TRUE
2015-07-10 06:01:56 -07:00
#define EFI_FSIO TRUE
2019-01-31 16:14:29 -08:00
#ifndef EFI_CDM_INTEGRATION
#define EFI_CDM_INTEGRATION FALSE
2019-01-31 16:14:29 -08:00
#endif
2019-01-04 20:47:39 -08:00
2019-07-07 12:22:46 -07:00
#ifndef EFI_TOOTH_LOGGER
#define EFI_TOOTH_LOGGER TRUE
#endif
#define EFI_TEXT_LOGGING TRUE
2015-07-10 06:01:56 -07:00
#define EFI_PWM_TESTER FALSE
#define EFI_ACTIVE_CONFIGURATION_IN_FLASH FALSE
#define EFI_MC33816 TRUE
2020-11-09 19:53:23 -08:00
#define EFI_HPFP TRUE
#define EFI_ENABLE_CRITICAL_ENGINE_STOP TRUE
#define EFI_ENABLE_ENGINE_WARNING TRUE
2020-08-26 20:08:48 -07:00
#ifndef SC_BUFFER_SIZE
#define SC_BUFFER_SIZE 4000
#endif
2015-07-10 06:01:56 -07:00
/**
* if you have a 60-2 trigger, or if you just want better performance, you
* probably want EFI_ENABLE_ASSERTS to be FALSE. Also you would probably want to FALSE
* CH_DBG_ENABLE_CHECKS
* CH_DBG_ENABLE_ASSERTS
* in chconf.h
*
*/
2019-04-12 19:10:57 -07:00
#if !defined(EFI_ENABLE_ASSERTS)
2015-07-10 06:01:56 -07:00
#define EFI_ENABLE_ASSERTS TRUE
#endif /* EFI_ENABLE_ASSERTS */
2019-04-12 19:10:57 -07:00
#if !defined(EFI_ENABLE_MOCK_ADC)
2016-01-22 23:01:34 -08:00
#define EFI_ENABLE_MOCK_ADC TRUE
#endif /* EFI_ENABLE_MOCK_ADC */
2015-07-10 06:01:56 -07:00
//#define EFI_UART_ECHO_TEST_MODE TRUE
/**
* Build-in logic analyzer support. Logic analyzer viewer is one of the java console panes.
*/
#ifndef EFI_LOGIC_ANALYZER
#define EFI_LOGIC_ANALYZER TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
2019-01-31 16:14:29 -08:00
#ifndef EFI_ICU_INPUTS
2018-12-15 22:13:44 -08:00
#define EFI_ICU_INPUTS TRUE
2019-01-31 16:14:29 -08:00
#endif
2018-12-15 22:13:44 -08:00
2019-08-06 19:33:27 -07:00
#ifndef HAL_TRIGGER_USE_PAL
#define HAL_TRIGGER_USE_PAL FALSE
#endif /* HAL_TRIGGER_USE_PAL */
2020-09-07 12:27:29 -07:00
#ifndef HAL_TRIGGER_USE_ADC
#define HAL_TRIGGER_USE_ADC FALSE
#endif /* HAL_TRIGGER_USE_ADC */
2020-08-13 08:27:31 -07:00
#ifndef HAL_VSS_USE_PAL
#define HAL_VSS_USE_PAL FALSE
#endif /* HAL_VSS_USE_PAL */
2015-07-10 06:01:56 -07:00
/**
* TunerStudio support.
*/
#define EFI_TUNER_STUDIO TRUE
2017-06-04 05:50:31 -07:00
/**
* Bluetooth UART setup support.
*/
2020-05-02 19:34:31 -07:00
#define EFI_BLUETOOTH_SETUP TRUE
2017-06-04 05:50:31 -07:00
2015-07-10 06:01:56 -07:00
/**
* TunerStudio debug output
*/
#define EFI_TUNER_STUDIO_VERBOSE TRUE
#define EFI_DEFAILED_LOGGING FALSE
/**
* Dev console support.
*/
#define EFI_CLI_SUPPORT TRUE
2019-09-20 15:22:39 -07:00
#define EFI_RTC TRUE
2015-07-10 06:01:56 -07:00
#define EFI_ALTERNATOR_CONTROL TRUE
2016-06-27 19:02:41 -07:00
#define EFI_AUX_PID TRUE
2015-07-10 06:01:56 -07:00
#define EFI_SIGNAL_EXECUTOR_SLEEP FALSE
#define EFI_SIGNAL_EXECUTOR_ONE_TIMER TRUE
#define EFI_SIGNAL_EXECUTOR_HW_TIMER FALSE
2016-08-26 14:02:37 -07:00
#define FUEL_MATH_EXTREME_LOGGING FALSE
2016-10-28 20:01:36 -07:00
#define SPARK_EXTREME_LOGGING FALSE
2016-10-31 17:02:09 -07:00
#define TRIGGER_EXTREME_LOGGING FALSE
2019-01-31 16:14:29 -08:00
#ifndef EFI_INTERNAL_FLASH
2015-07-10 06:01:56 -07:00
#define EFI_INTERNAL_FLASH TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
/**
* Usually you need shaft position input, but maybe you do not need it?
*/
2019-01-31 16:14:29 -08:00
#ifndef EFI_SHAFT_POSITION_INPUT
2015-07-10 06:01:56 -07:00
#define EFI_SHAFT_POSITION_INPUT TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
/**
* Maybe we are just sniffing what's going on?
*/
#define EFI_ENGINE_CONTROL TRUE
/**
* MCP42010 digital potentiometer support. This could be useful if you are stimulating some
* stock ECU
*/
#define EFI_POTENTIOMETER FALSE
2015-07-10 06:01:56 -07:00
#ifndef BOARD_TLE6240_COUNT
#define BOARD_TLE6240_COUNT 1
#endif
#ifndef BOARD_MC33972_COUNT
#define BOARD_MC33972_COUNT 1
#endif
#ifndef BOARD_TLE8888_COUNT
#define BOARD_TLE8888_COUNT 1
#endif
2019-04-13 07:58:52 -07:00
2020-09-07 12:27:29 -07:00
#ifndef BOARD_DRV8860_COUNT
#define BOARD_DRV8860_COUNT 0
#endif
#ifndef BOARD_MC33810_COUNT
#define BOARD_MC33810_COUNT 0
#endif
2015-07-10 06:01:56 -07:00
#define EFI_ANALOG_SENSORS TRUE
2019-01-31 16:14:29 -08:00
#ifndef EFI_MAX_31855
2015-07-10 06:01:56 -07:00
#define EFI_MAX_31855 TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#define EFI_MCP_3208 FALSE
2019-01-31 16:14:29 -08:00
#ifndef EFI_HIP_9011
2020-06-21 18:50:41 -07:00
// disabling for now - DMA conflict with SPI1
#define EFI_HIP_9011 FALSE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
2019-01-31 16:14:29 -08:00
#ifndef EFI_CJ125
2016-07-25 20:03:45 -07:00
#define EFI_CJ125 TRUE
2019-01-31 16:14:29 -08:00
#endif
2016-07-25 20:03:45 -07:00
2019-04-12 19:10:57 -07:00
#if !defined(EFI_MEMS)
#define EFI_MEMS FALSE
2017-08-16 23:49:07 -07:00
#endif
2019-01-31 16:14:29 -08:00
#ifndef EFI_INTERNAL_ADC
2015-07-10 06:01:56 -07:00
#define EFI_INTERNAL_ADC TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#define EFI_USE_FAST_ADC TRUE
2018-01-23 05:33:20 -08:00
#define EFI_NARROW_EGO_AVERAGING TRUE
2019-01-31 16:14:29 -08:00
#ifndef EFI_CAN_SUPPORT
2015-07-10 06:01:56 -07:00
#define EFI_CAN_SUPPORT TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#define EFI_WIDEBAND_FIRMWARE_UPDATE TRUE
#ifndef EFI_AUX_SERIAL
#define EFI_AUX_SERIAL TRUE
#endif
2019-01-31 16:14:29 -08:00
#ifndef EFI_HD44780_LCD
2015-07-10 06:01:56 -07:00
#define EFI_HD44780_LCD TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#ifndef EFI_LCD
#define EFI_LCD TRUE
#endif
2019-01-31 16:14:29 -08:00
#ifndef EFI_IDLE_CONTROL
2015-07-10 06:01:56 -07:00
#define EFI_IDLE_CONTROL TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#define EFI_IDLE_PID_CIC TRUE
2017-06-12 15:14:39 -07:00
/**
* Control the main power relay based on measured ignition voltage (Vbatt)
*/
2019-09-02 08:48:49 -07:00
#ifndef EFI_MAIN_RELAY_CONTROL
2017-06-12 15:14:39 -07:00
#define EFI_MAIN_RELAY_CONTROL FALSE
2019-09-02 08:48:49 -07:00
#endif
2017-06-12 15:14:39 -07:00
2019-01-31 16:14:29 -08:00
#ifndef EFI_PWM
2015-07-10 06:01:56 -07:00
#define EFI_PWM TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
2019-01-31 16:14:29 -08:00
#ifndef EFI_VEHICLE_SPEED
2015-07-10 06:01:56 -07:00
#define EFI_VEHICLE_SPEED TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#define EFI_FUEL_PUMP TRUE
2019-01-31 16:14:29 -08:00
#ifndef EFI_ENGINE_EMULATOR
2015-07-10 06:01:56 -07:00
#define EFI_ENGINE_EMULATOR TRUE
2019-01-31 16:14:29 -08:00
#endif
#ifndef EFI_EMULATE_POSITION_SENSORS
2015-07-10 06:01:56 -07:00
#define EFI_EMULATE_POSITION_SENSORS TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
/**
* Do we need file logging (like SD card) logic?
*/
2019-01-31 16:14:29 -08:00
#ifndef EFI_FILE_LOGGING
2018-01-23 19:23:24 -08:00
#define EFI_FILE_LOGGING TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#ifndef EFI_EMBED_INI_MSD
#define EFI_EMBED_INI_MSD TRUE
#endif
2017-05-30 15:37:13 -07:00
#ifndef EFI_USB_SERIAL
2015-07-10 06:01:56 -07:00
#define EFI_USB_SERIAL TRUE
2017-05-30 15:37:13 -07:00
#endif
2015-07-10 06:01:56 -07:00
2020-09-11 00:54:07 -07:00
#define EFI_CONSOLE_USB_DEVICE SDU1
2020-09-07 12:27:29 -07:00
// F42x has more memory, so we can:
// - use compressed USB MSD image (requires 32k of memory)
// - use perf trace (requires ~16k of memory)
#ifdef EFI_IS_F42x
#define EFI_USE_COMPRESSED_INI_MSD
#define ENABLE_PERF_TRACE TRUE
#else
// small memory F40x can't fit perf trace
#define ENABLE_PERF_TRACE FALSE
#endif
#ifndef EFI_LUA
#define EFI_LUA TRUE
#endif
2019-01-31 16:14:29 -08:00
#ifndef EFI_ENGINE_SNIFFER
2015-07-15 18:01:45 -07:00
#define EFI_ENGINE_SNIFFER TRUE
2019-01-31 16:14:29 -08:00
#endif
2015-07-10 06:01:56 -07:00
#define EFI_HISTOGRAMS FALSE
2015-09-13 09:01:42 -07:00
#define EFI_SENSOR_CHART TRUE
2015-07-10 06:01:56 -07:00
#if defined __GNUC__
#define EFI_PERF_METRICS FALSE
#define DL_OUTPUT_BUFFER 6500
#else
#define EFI_PERF_METRICS FALSE
#define DL_OUTPUT_BUFFER 8000
#endif
/**
* Do we need GPS logic?
*/
#define EFI_UART_GPS FALSE
2015-07-10 06:01:56 -07:00
#define EFI_SERVO FALSE
2018-03-17 18:24:04 -07:00
2015-07-10 06:01:56 -07:00
#define EFI_ELECTRONIC_THROTTLE_BODY TRUE
//#define EFI_ELECTRONIC_THROTTLE_BODY FALSE
/**
* Do we need Malfunction Indicator blinking logic?
*/
#define EFI_MALFUNCTION_INDICATOR TRUE
//#define EFI_MALFUNCTION_INDICATOR FALSE
2017-01-06 07:04:41 -08:00
#define CONSOLE_MAX_ACTIONS 180
2015-07-10 06:01:56 -07:00
#define EFI_MAP_AVERAGING TRUE
//#define EFI_MAP_AVERAGING FALSE
// todo: most of this should become configurable
2021-01-28 17:43:23 -08:00
// todo: switch to continuous ADC conversion for fast ADC?
#define EFI_INTERNAL_FAST_ADC_GPT &GPTD6
2015-07-10 06:01:56 -07:00
#define EFI_SPI1_AF 5
#define EFI_SPI2_AF 5
/**
* This section is for right-side center SPI
*/
2017-04-11 16:25:31 -07:00
2015-07-10 06:01:56 -07:00
#define EFI_SPI3_AF 6
2017-04-21 17:07:17 -07:00
#define EFI_I2C_SCL_BRAIN_PIN GPIOB_6
#define EFI_I2C_SDA_BRAIN_PIN GPIOB_7
2015-07-10 06:01:56 -07:00
#define EFI_I2C_AF 4
/**
* Patched version of ChibiOS/RT support extra details in the system error messages
*/
#define EFI_CUSTOM_PANIC_METHOD TRUE
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
/**
* currently ChibiOS uses only first and second channels of each timer for input capture
*
* So, our options are:
*
* TIM2_CH1
* PA5
*
* TIM4_CH1
* PB6
* PD12
*
* TIM9_CH1
* PE5
*/
// allow override of EFI_USE_UART_DMA from cmdline passed defs
#ifndef EFI_USE_UART_DMA
#define EFI_USE_UART_DMA TRUE
2021-02-18 14:04:51 -08:00
#endif
2020-06-21 20:22:45 -07:00
#ifndef TS_PRIMARY_UART
#define TS_PRIMARY_UART UARTD3
#endif
#undef TS_SECONDARY_UART
2017-05-23 10:10:43 -07:00
#define AUX_SERIAL_DEVICE (&SD6)
2017-04-16 09:57:48 -07:00
// todo: start using consoleSerialTxPin? Not sure
#ifndef EFI_CONSOLE_TX_BRAIN_PIN
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOC_10
2017-04-16 09:57:48 -07:00
#endif
// todo: start using consoleSerialRxPin? Not sure
#ifndef EFI_CONSOLE_RX_BRAIN_PIN
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOC_11
2017-04-16 09:57:48 -07:00
#endif
2015-10-22 14:01:29 -07:00
// todo: this should be detected automatically based on pin selection
2015-07-10 06:01:56 -07:00
#define EFI_CONSOLE_AF 7
2015-10-22 14:01:29 -07:00
// todo: this should be detected automatically based on pin selection
2015-07-10 06:01:56 -07:00
#define TS_SERIAL_AF 7
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
#define LED_CRITICAL_ERROR_BRAIN_PIN GPIOD_14
#endif
2020-09-07 12:27:29 -07:00
#ifndef LED_ERROR_BRAIN_PIN_MODE
#define LED_ERROR_BRAIN_PIN_MODE DEFAULT_OUTPUT
#endif
2015-07-10 06:01:56 -07:00
// USART1 -> check defined STM32_SERIAL_USE_USART1
// For GPS we have USART1. We can start with PB7 USART1_RX and PB6 USART1_TX
#define GPS_SERIAL_DEVICE &SD1
#define GPS_SERIAL_SPEED 38400
2019-04-06 05:41:37 -07:00
#ifndef CONFIG_RESET_SWITCH_PORT
2019-04-12 22:05:01 -07:00
// looks like this feature is not extremely popular, we can try living without it now :)
//#define CONFIG_RESET_SWITCH_PORT GPIOD
2019-04-06 05:41:37 -07:00
#endif
#ifndef CONFIG_RESET_SWITCH_PIN
2015-07-10 06:01:56 -07:00
#define CONFIG_RESET_SWITCH_PIN 6
2019-04-06 05:41:37 -07:00
#endif
2015-07-10 06:01:56 -07:00
#ifndef EFI_STORAGE_INT_FLASH
#define EFI_STORAGE_INT_FLASH TRUE
#endif
#ifndef EFI_STORAGE_EXT_SNOR
#define EFI_STORAGE_EXT_SNOR FALSE
#endif
#define EFI_JOYSTICK TRUE