Add subaru eg33 (#2294)
* engine: Subaru SVX EG33 engine configuration Not tested yet. Just basic settings and placeholder * board: add Dron_Gus's Subaru EG33 p'n'p board * board: subaru eg33: linker script: stack, bss and heap to ram0 * board: subaru eg33: add mapping.yaml * board: subaru eg33: scripts for autogenerated * board: subaru eg33: fix DMA conflict (ADC1 vs SPI5) * board: subaru eg33: enable ADC3 * board: subaru eg33: Autogenerated * board: subaru eg33: disable fsio control of Main Relay Default MAIN_RELAY_LOGIC cause error during parsing * board: subaru eg33: configuration hack to fix usbconsole.c * gen_config: generate config for Subaru SVX board too
This commit is contained in:
parent
c8c4d19388
commit
08a5421090
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* STM32F76xxI generic setup.
|
||||
*
|
||||
* RAM0 - Data, Heap.
|
||||
* RAM3 - Main Stack, Process Stack, BSS, NOCACHE, ETH.
|
||||
*
|
||||
* Notes:
|
||||
* BSS is placed in DTCM RAM in order to simplify DMA buffers management.
|
||||
*/
|
||||
MEMORY
|
||||
{
|
||||
flash0 (rx) : org = 0x08000000, len = 2M /* Flash as AXIM (writable) */
|
||||
flash1 (rx) : org = 0x00200000, len = 2M /* Flash as ITCM */
|
||||
flash2 (rx) : org = 0x00000000, len = 0
|
||||
flash3 (rx) : org = 0x00000000, len = 0
|
||||
flash4 (rx) : org = 0x00000000, len = 0
|
||||
flash5 (rx) : org = 0x00000000, len = 0
|
||||
flash6 (rx) : org = 0x00000000, len = 0
|
||||
flash7 (rx) : org = 0x00000000, len = 0
|
||||
ram0 (wx) : org = 0x20020000, len = 384k /* SRAM1 + SRAM2 */
|
||||
ram1 (wx) : org = 0x20020000, len = 368k /* SRAM1 */
|
||||
ram2 (wx) : org = 0x2007C000, len = 16k /* SRAM2 */
|
||||
ram3 (wx) : org = 0x20000000, len = 128k /* DTCM-RAM */
|
||||
ram4 (wx) : org = 0x00000000, len = 16k /* ITCM-RAM */
|
||||
ram5 (wx) : org = 0x40024000, len = 4k /* BCKP SRAM */
|
||||
ram6 (wx) : org = 0x00000000, len = 0
|
||||
ram7 (wx) : org = 0x00000000, len = 0
|
||||
}
|
||||
|
||||
/* For each data/text section two region are defined, a virtual region
|
||||
and a load region (_LMA suffix).*/
|
||||
|
||||
/* Flash region to be used for exception vectors.*/
|
||||
REGION_ALIAS("VECTORS_FLASH", flash1);
|
||||
REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for constructors and destructors.*/
|
||||
REGION_ALIAS("XTORS_FLASH", flash1);
|
||||
REGION_ALIAS("XTORS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for code text.*/
|
||||
REGION_ALIAS("TEXT_FLASH", flash1);
|
||||
REGION_ALIAS("TEXT_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for read only data.*/
|
||||
REGION_ALIAS("RODATA_FLASH", flash0);
|
||||
REGION_ALIAS("RODATA_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for various.*/
|
||||
REGION_ALIAS("VARIOUS_FLASH", flash1);
|
||||
REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
|
||||
|
||||
/* Flash region to be used for RAM(n) initialization data.*/
|
||||
REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for Main stack. This stack accommodates the processing
|
||||
of all exceptions and interrupts.*/
|
||||
REGION_ALIAS("MAIN_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the process stack. This is the stack used by
|
||||
the main() function.*/
|
||||
REGION_ALIAS("PROCESS_STACK_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for data segment.*/
|
||||
REGION_ALIAS("DATA_RAM", ram0);
|
||||
REGION_ALIAS("DATA_RAM_LMA", flash0);
|
||||
|
||||
/* RAM region to be used for BSS segment.*/
|
||||
REGION_ALIAS("BSS_RAM", ram0);
|
||||
|
||||
/* RAM region to be used for the default heap.*/
|
||||
REGION_ALIAS("HEAP_RAM", ram0);
|
||||
|
||||
/* Stack rules inclusion.*/
|
||||
INCLUDE rules_stacks.ld
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Custom sections for STM32F7xx. */
|
||||
/*===========================================================================*/
|
||||
|
||||
/* RAM region to be used for nocache segment.*/
|
||||
REGION_ALIAS("NOCACHE_RAM", ram3);
|
||||
|
||||
/* RAM region to be used for eth segment.*/
|
||||
REGION_ALIAS("ETH_RAM", ram3);
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* Special section for non cache-able areas.*/
|
||||
.nocache (NOLOAD) : ALIGN(4)
|
||||
{
|
||||
__nocache_base__ = .;
|
||||
*(.nocache)
|
||||
*(.nocache.*)
|
||||
*(.bss.__nocache_*)
|
||||
. = ALIGN(4);
|
||||
__nocache_end__ = .;
|
||||
} > NOCACHE_RAM
|
||||
|
||||
/* Special section for Ethernet DMA non cache-able areas.*/
|
||||
.eth (NOLOAD) : ALIGN(4)
|
||||
{
|
||||
__eth_base__ = .;
|
||||
*(.eth)
|
||||
*(.eth.*)
|
||||
*(.bss.__eth_*)
|
||||
. = ALIGN(4);
|
||||
__eth_end__ = .;
|
||||
} > ETH_RAM
|
||||
}
|
||||
|
||||
/* Code rules inclusion.*/
|
||||
INCLUDE rules_code.ld
|
||||
|
||||
/* Data rules inclusion.*/
|
||||
INCLUDE rules_data.ld
|
||||
|
||||
/* Memory rules inclusion.*/
|
||||
INCLUDE rules_memory.ld
|
||||
|
|
@ -0,0 +1,298 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/board.c
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
#include "stm32_gpio.h"
|
||||
#include "efilib.h"
|
||||
#include "rusefi_hw_enums.h"
|
||||
|
||||
#include "board_io.h"
|
||||
|
||||
#include "drivers/gpio/mc33810.h"
|
||||
|
||||
/* drivers */
|
||||
|
||||
/*==========================================================================*/
|
||||
/* Driver local definitions. */
|
||||
/*==========================================================================*/
|
||||
|
||||
/*==========================================================================*/
|
||||
/* Driver exported variables. */
|
||||
/*==========================================================================*/
|
||||
|
||||
/*==========================================================================*/
|
||||
/* Driver local variables and types. */
|
||||
/*==========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Type of STM32 GPIO port setup.
|
||||
*/
|
||||
typedef struct {
|
||||
uint32_t moder;
|
||||
uint32_t otyper;
|
||||
uint32_t ospeedr;
|
||||
uint32_t pupdr;
|
||||
uint32_t odr;
|
||||
uint32_t afrl;
|
||||
uint32_t afrh;
|
||||
} gpio_setup_t;
|
||||
|
||||
/**
|
||||
* @brief Type of STM32 GPIO initialization data.
|
||||
*/
|
||||
typedef struct {
|
||||
gpio_setup_t PAData;
|
||||
gpio_setup_t PBData;
|
||||
gpio_setup_t PCData;
|
||||
gpio_setup_t PDData;
|
||||
gpio_setup_t PEData;
|
||||
gpio_setup_t PFData;
|
||||
gpio_setup_t PGData;
|
||||
gpio_setup_t PHData;
|
||||
gpio_setup_t PIData;
|
||||
} gpio_config_t;
|
||||
|
||||
/**
|
||||
* @brief STM32 GPIO static initialization data.
|
||||
*/
|
||||
static const gpio_config_t gpio_default_config = {
|
||||
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
|
||||
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
|
||||
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
|
||||
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
|
||||
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
|
||||
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
|
||||
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
|
||||
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
|
||||
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
|
||||
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
|
||||
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
|
||||
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
|
||||
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
|
||||
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
|
||||
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
|
||||
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
|
||||
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
|
||||
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH},
|
||||
};
|
||||
|
||||
/*==========================================================================*/
|
||||
/* Driver local functions. */
|
||||
/*==========================================================================*/
|
||||
|
||||
static void gpio_init(stm32_gpio_t *gpiop, const gpio_setup_t *config) {
|
||||
|
||||
gpiop->OTYPER = config->otyper;
|
||||
gpiop->OSPEEDR = config->ospeedr;
|
||||
gpiop->PUPDR = config->pupdr;
|
||||
gpiop->ODR = config->odr;
|
||||
gpiop->AFRL = config->afrl;
|
||||
gpiop->AFRH = config->afrh;
|
||||
gpiop->MODER = config->moder;
|
||||
}
|
||||
|
||||
static void stm32_gpio_init(void) {
|
||||
|
||||
/* Enabling GPIO-related clocks, the mask comes from the
|
||||
* registry header file.*/
|
||||
rccResetAHB1(STM32_GPIO_EN_MASK);
|
||||
rccEnableAHB1(STM32_GPIO_EN_MASK, true);
|
||||
|
||||
/* Initializing all the defined GPIO ports.*/
|
||||
gpio_init(GPIOA, &gpio_default_config.PAData);
|
||||
gpio_init(GPIOB, &gpio_default_config.PBData);
|
||||
gpio_init(GPIOC, &gpio_default_config.PCData);
|
||||
gpio_init(GPIOD, &gpio_default_config.PDData);
|
||||
gpio_init(GPIOE, &gpio_default_config.PEData);
|
||||
gpio_init(GPIOF, &gpio_default_config.PFData);
|
||||
gpio_init(GPIOG, &gpio_default_config.PGData);
|
||||
gpio_init(GPIOH, &gpio_default_config.PHData);
|
||||
gpio_init(GPIOI, &gpio_default_config.PIData);
|
||||
}
|
||||
|
||||
/*==========================================================================*/
|
||||
/* Driver interrupt handlers. */
|
||||
/*==========================================================================*/
|
||||
|
||||
/*==========================================================================*/
|
||||
/* Driver exported functions. */
|
||||
/*==========================================================================*/
|
||||
|
||||
/**
|
||||
* @brief Early initialization code.
|
||||
* @details GPIO ports and system clocks are initialized before everything
|
||||
* else.
|
||||
*/
|
||||
void __early_init(void)
|
||||
{
|
||||
/* allow debug in all low-power modes */
|
||||
DBGMCU->CR |= DBGMCU_CR_DBG_SLEEP | DBGMCU_CR_DBG_STOP | DBGMCU_CR_DBG_STANDBY;
|
||||
|
||||
stm32_gpio_init();
|
||||
stm32_clock_init();
|
||||
}
|
||||
|
||||
#if HAL_USE_SDC || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief SDC card detection.
|
||||
*/
|
||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp)
|
||||
{
|
||||
UNUSED(sdcp);
|
||||
/* TODO: Fill the implementation.*/
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief SDC card write protection detection.
|
||||
*/
|
||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp)
|
||||
{
|
||||
UNUSED(sdcp);
|
||||
/* TODO: Fill the implementation.*/
|
||||
return false;
|
||||
}
|
||||
#endif /* HAL_USE_SDC */
|
||||
|
||||
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief MMC_SPI card detection.
|
||||
*/
|
||||
bool mmc_lld_is_card_inserted(MMCDriver *mmcp)
|
||||
{
|
||||
UNUSED(mmcp);
|
||||
/* TODO: Fill the implementation.*/
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MMC_SPI card write protection detection.
|
||||
*/
|
||||
bool mmc_lld_is_write_protected(MMCDriver *mmcp)
|
||||
{
|
||||
UNUSED(mmcp);
|
||||
/* TODO: Fill the implementation.*/
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Board-specific ADC channel configuration code overrides.
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
void setAdcChannelOverrides(void) {
|
||||
}
|
||||
|
||||
#define STATUS_LED_PIN 8
|
||||
#define STATUS_LED_PORT GPIOG
|
||||
|
||||
void BLIIINK(int t) {
|
||||
int i, j;
|
||||
palSetPadMode(STATUS_LED_PORT, STATUS_LED_PIN, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
//while (true) {
|
||||
for (j = 0; j < 2; j++) {
|
||||
palClearPad(STATUS_LED_PORT, STATUS_LED_PIN);
|
||||
for (i = 0; i < 2 * t; i++) {
|
||||
palTogglePad(STATUS_LED_PORT, STATUS_LED_PIN);
|
||||
chThdSleepMilliseconds(250);
|
||||
}
|
||||
chThdSleepMilliseconds(1000);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct mc33810_config mc33810_odd = {
|
||||
.spi_bus = &SPID5,
|
||||
.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 |
|
||||
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-dirvers */
|
||||
[4] = {.port = GPIOB, .pad = 3}, /* IGN 1 */
|
||||
[5] = {.port = GPIOB, .pad = 4}, /* IGN 3 */
|
||||
[6] = {.port = GPIOB, .pad = 5}, /* IGN 7 */
|
||||
[7] = {.port = GPIOB, .pad = 8}, /* IGN 5 */
|
||||
},
|
||||
/* en shared between two chips */
|
||||
.en = {.port = GPIOI, .pad = 7}
|
||||
};
|
||||
|
||||
static const struct mc33810_config mc33810_even = {
|
||||
.spi_bus = &SPID5,
|
||||
.spi_config = {
|
||||
.circular = false,
|
||||
.end_cb = NULL,
|
||||
.ssport = GPIOF,
|
||||
.sspad = 2,
|
||||
.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 |
|
||||
SPI_CR2_DS_3 | SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0
|
||||
},
|
||||
.direct_io = {
|
||||
/* injector drivers */
|
||||
[0] = {.port = GPIOE, .pad = 3}, /* INJ 2 */
|
||||
[1] = {.port = GPIOE, .pad = 4}, /* INJ 4 */
|
||||
[2] = {.port = GPIOE, .pad = 5}, /* INJ 6 */
|
||||
[3] = {.port = GPIOE, .pad = 6}, /* INJ 8 */
|
||||
/* ignition pre-dirvers */
|
||||
[4] = {.port = GPIOC, .pad = 14}, /* IGN 2 */
|
||||
[5] = {.port = GPIOC, .pad = 13}, /* IGN 4 */
|
||||
[6] = {.port = GPIOC, .pad = 15}, /* IGN 6 */
|
||||
[7] = {.port = GPIOI, .pad = 9}, /* IGN 8 */
|
||||
},
|
||||
/* en shared between two chips */
|
||||
//.en = {.port = GPIOI, .pad = 7}
|
||||
};
|
||||
|
||||
static void board_init_ext_gpios(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = mc33810_add(MC33810_0_OUT_0, 0, &mc33810_odd);
|
||||
if (ret < 0) {
|
||||
/* error */
|
||||
}
|
||||
ret = mc33810_add(MC33810_1_OUT_0, 1, &mc33810_even);
|
||||
if (ret < 0) {
|
||||
/* error */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific initialization code.
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
void boardInit(void)
|
||||
{
|
||||
board_init_ext_gpios();
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/board.c
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#ifndef BOARD_H
|
||||
#define BOARD_H
|
||||
|
||||
/*
|
||||
* Board identifier.
|
||||
*/
|
||||
#define BOARD_NAME "Subaru EG33/STM32F765 for RusEFI"
|
||||
|
||||
#define EFI_USB_AF 10U
|
||||
//#define EFI_USB_SERIAL_ID GPIOA_10
|
||||
#define EFI_USB_SERIAL_DM GPIOA_11
|
||||
#define EFI_USB_SERIAL_DP GPIOA_12
|
||||
|
||||
/*
|
||||
* Board oscillators-related settings.
|
||||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 25000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 330U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
* this declaration for stm32_registry.h
|
||||
*/
|
||||
#ifndef STM32F765xx
|
||||
#define STM32F765xx
|
||||
#endif
|
||||
|
||||
#endif /* BOARD_H */
|
|
@ -0,0 +1,37 @@
|
|||
BOARD_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)
|
||||
|
||||
# List of all the board related files.
|
||||
BOARDSRC = $(BOARD_DIR)/board.c
|
||||
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = $(BOARD_DIR)
|
||||
BOARDINC += $(BOARD_DIR)/config/controllers/algo
|
||||
|
||||
# Override LD script
|
||||
ifeq ($(USE_BOOTLOADER),yes)
|
||||
# include Prometheus bootloader code
|
||||
BOOTLOADERINC = $(PROJECT_DIR)/bootloader/subaru_eg33
|
||||
endif
|
||||
|
||||
LDSCRIPT = $(BOARD_DIR)/STM32F76xxI.ld
|
||||
|
||||
#FIX THIS
|
||||
CONFIGPATH = $(PROJECT_DIR)/config/stm32f7ems
|
||||
|
||||
CONFDIR = config/stm32f7ems
|
||||
|
||||
#LED
|
||||
LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=GPIOG_7
|
||||
|
||||
# We are running on Subaru EG33 hardware!
|
||||
DDEFS += -DHW_SUBARU_EG33=1
|
||||
|
||||
# Override DEFAULT_ENGINE_TYPE
|
||||
# Fix
|
||||
DDEFS += -DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS -DSTM32F765xx $(LED_CRITICAL_ERROR_BRAIN_PIN)
|
||||
|
||||
# Shared variables
|
||||
ALLCSRC += $(BOARDSRC)
|
||||
ALLCPPSRC += $(BOARDCPPSRC)
|
||||
ALLINC += $(BOARDINC)
|
|
@ -0,0 +1,246 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/board_configuration.h
|
||||
*
|
||||
* @brief In this file we can override engine_configuration.cpp.
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include "engine.h"
|
||||
#include "engine_math.h"
|
||||
#include "allsensors.h"
|
||||
#include "fsio_impl.h"
|
||||
#include "engine_configuration.h"
|
||||
#include "smart_gpio.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
void setPinConfigurationOverrides(void) {
|
||||
|
||||
}
|
||||
|
||||
void setSerialConfigurationOverrides(void) {
|
||||
engineConfiguration->useSerialPort = false;
|
||||
engineConfiguration->binarySerialTxPin = GPIOE_1;
|
||||
engineConfiguration->binarySerialRxPin = GPIOE_0;
|
||||
/* actually Bluetooth/WiFi interface */
|
||||
//engineConfiguration->consoleSerialTxPin = GPIOC_10;
|
||||
//engineConfiguration->consoleSerialRxPin = GPIOC_11;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
}
|
||||
|
||||
void setSdCardConfigurationOverrides(void) {
|
||||
engineConfiguration->is_enabled_spi_1 = false;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_1;
|
||||
engineConfiguration->sdCardCsPin = GPIOA_2;
|
||||
engineConfiguration->isSdCardEnabled = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration code overrides.
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
void setBoardConfigurationOverrides(void) {
|
||||
setSerialConfigurationOverrides();
|
||||
|
||||
/* Battery voltage */
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_6;
|
||||
/* Throttle position */
|
||||
engineConfiguration->tps1_1AdcChannel = EFI_ADC_12;
|
||||
/* MAP */
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_10;
|
||||
/* MAF */
|
||||
engineConfiguration->mafAdcChannel = EFI_ADC_3;
|
||||
/* coolant t */
|
||||
engineConfiguration->clt.adcChannel = EFI_ADC_14;
|
||||
/* not yet */
|
||||
engineConfiguration->iat.adcChannel = EFI_ADC_NONE;
|
||||
/* narrow */
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->adcVcc = ADC_VCC;
|
||||
|
||||
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;
|
||||
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_NONE;
|
||||
|
||||
/* Injectors */
|
||||
engineConfiguration->injectionPins[1 - 1] = MC33810_0_OUT_0;
|
||||
engineConfiguration->injectionPins[2 - 1] = MC33810_1_OUT_0;
|
||||
engineConfiguration->injectionPins[3 - 1] = MC33810_0_OUT_1;
|
||||
engineConfiguration->injectionPins[4 - 1] = MC33810_1_OUT_1;
|
||||
engineConfiguration->injectionPins[5 - 1] = MC33810_0_OUT_2;
|
||||
engineConfiguration->injectionPins[6 - 1] = MC33810_1_OUT_2;
|
||||
engineConfiguration->injectionPins[7 - 1] = MC33810_0_OUT_3;
|
||||
engineConfiguration->injectionPins[8 - 1] = MC33810_1_OUT_3;
|
||||
|
||||
/* Ignition */
|
||||
engineConfiguration->ignitionPins[1 - 1] = MC33810_0_GD_0;
|
||||
engineConfiguration->ignitionPins[2 - 1] = MC33810_1_GD_1;
|
||||
engineConfiguration->ignitionPins[3 - 1] = MC33810_0_GD_1;
|
||||
engineConfiguration->ignitionPins[4 - 1] = MC33810_1_GD_0;
|
||||
engineConfiguration->ignitionPins[5 - 1] = MC33810_0_GD_3;
|
||||
engineConfiguration->ignitionPins[6 - 1] = MC33810_1_GD_2;
|
||||
engineConfiguration->ignitionPins[7 - 1] = MC33810_0_GD_2;
|
||||
engineConfiguration->ignitionPins[8 - 1] = MC33810_1_GD_3;
|
||||
//engineConfiguration->ignitionPinMode = OM_INVERTED;
|
||||
|
||||
// Vbat divider: 10K + 1K
|
||||
engineConfiguration->vbattDividerCoeff = (1.0 + 10.0) / 1.0;
|
||||
//engineConfiguration->clt.config.bias_resistor = 2700;
|
||||
//sengineConfiguration->iat.config.bias_resistor = 2700;
|
||||
|
||||
// Idle configuration
|
||||
engineConfiguration->useStepperIdle = false;
|
||||
engineConfiguration->isDoubleSolenoidIdle = true;
|
||||
engineConfiguration->idle.solenoidPin = TLE6240_PIN_11;
|
||||
engineConfiguration->secondSolenoidPin = TLE6240_PIN_12;
|
||||
|
||||
engineConfiguration->communicationLedPin = GPIOG_6; /* LD1 - green */
|
||||
engineConfiguration->runningLedPin = GPIOG_8; /* LD3 - yellow */
|
||||
engineConfiguration->warningLedPin = GPIO_UNASSIGNED; /* LD3 - yellow*/
|
||||
//engineConfiguration->unusedErrorPin = LED_ERROR_BRAIN_PIN; /* LD2 - red */
|
||||
|
||||
/* IF you have BOTH camshaft position sensor and crankshaft position sensor
|
||||
* camshaft is always trigger#1 input and then crankshaft is trigger#2. */
|
||||
engineConfiguration->triggerInputPins[0] = GPIOH_12; /* cam */
|
||||
engineConfiguration->triggerInputPins[1] = GPIOH_10; /* crank pos #1 */
|
||||
engineConfiguration->triggerInputPins[2] = GPIOE_9; /* crank pos #2 */
|
||||
engineConfiguration->camInputs[0] = GPIO_UNASSIGNED;
|
||||
|
||||
/* SPI devices: mess of board and engine configurations */
|
||||
/* TLE6240 */
|
||||
engineConfiguration->tle6240spiDevice = SPI_DEVICE_4;
|
||||
engineConfiguration->tle6240_cs = GPIOE_15; /* SPI4_NSS0 */
|
||||
engineConfiguration->tle6240_csPinMode = OM_OPENDRAIN;
|
||||
/* MC33972 */
|
||||
engineConfiguration->mc33972spiDevice = SPI_DEVICE_4;
|
||||
engineConfiguration->mc33972_cs = GPIOE_10; /* SPI4_NSS2 */
|
||||
engineConfiguration->mc33972_csPinMode = OM_OPENDRAIN;
|
||||
|
||||
/* TLE6240 - OUT3, also PG2 */
|
||||
engineConfiguration->tachOutputPin = TLE6240_PIN_2;
|
||||
engineConfiguration->tachOutputPinMode = OM_DEFAULT;
|
||||
/* spi driven - TLE6240 - OUT5 */
|
||||
#if 0
|
||||
engineConfiguration->fuelPumpPin = TLE6240_PIN_5;
|
||||
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
||||
/* self shutdown? */
|
||||
engineConfiguration->mainRelayPin = GPIOH_7;
|
||||
engineConfiguration->mainRelayPinMode = OM_DEFAULT;
|
||||
#else
|
||||
engineConfiguration->fuelPumpPin = GPIO_UNASSIGNED;
|
||||
engineConfiguration->fuelPumpPinMode = OM_DEFAULT;
|
||||
/* self shutdown? */
|
||||
engineConfiguration->mainRelayPin = TLE6240_PIN_5;
|
||||
engineConfiguration->mainRelayPinMode = OM_DEFAULT;
|
||||
#endif
|
||||
/* spi driven - TLE6240 - OUT1, OUT2 */
|
||||
engineConfiguration->fanPin = TLE6240_PIN_1;
|
||||
engineConfiguration->fanPinMode = OM_DEFAULT;
|
||||
/* TODO: second fan */
|
||||
//engineConfiguration->fanPin[1] = TLE6240_PIN_2;
|
||||
//engineConfiguration->fanPinMode[1] = OM_DEFAULT;
|
||||
/* spi driven - TLE6240 - OUT8 */
|
||||
engineConfiguration->malfunctionIndicatorPin = TLE6240_PIN_7;
|
||||
engineConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
|
||||
|
||||
// starter block
|
||||
/* Starter signal connected through MC33972 - SG11 */
|
||||
//setFsio(0, (GPIOB_1), STARTER_RELAY_LOGIC PASS_CONFIG_PARAMETER_SUFFIX);
|
||||
|
||||
// not used
|
||||
engineConfiguration->externalKnockSenseAdc = EFI_ADC_NONE;
|
||||
engineConfiguration->displayMode = DM_NONE;
|
||||
engineConfiguration->HD44780_rs = GPIO_UNASSIGNED;
|
||||
engineConfiguration->HD44780_e = GPIO_UNASSIGNED;
|
||||
engineConfiguration->HD44780_db4 = GPIO_UNASSIGNED;
|
||||
engineConfiguration->HD44780_db5 = GPIO_UNASSIGNED;
|
||||
engineConfiguration->HD44780_db6 = GPIO_UNASSIGNED;
|
||||
engineConfiguration->HD44780_db7 = GPIO_UNASSIGNED;
|
||||
engineConfiguration->digitalPotentiometerChipSelect[0] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->digitalPotentiometerChipSelect[1] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->digitalPotentiometerChipSelect[2] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->digitalPotentiometerChipSelect[3] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->vehicleSpeedSensorInputPin = GPIO_UNASSIGNED;
|
||||
|
||||
engineConfiguration->digitalPotentiometerSpiDevice = SPI_NONE;
|
||||
engineConfiguration->max31855spiDevice = SPI_NONE;
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
|
||||
engineConfiguration->is_enabled_spi_1 = true;
|
||||
engineConfiguration->is_enabled_spi_2 = false;
|
||||
engineConfiguration->is_enabled_spi_3 = true;
|
||||
engineConfiguration->is_enabled_spi_4 = true;
|
||||
|
||||
engineConfiguration->spi1mosiPin = GPIO_UNASSIGNED;
|
||||
engineConfiguration->spi1MosiMode = PO_DEFAULT;
|
||||
engineConfiguration->spi1misoPin = GPIO_UNASSIGNED;
|
||||
engineConfiguration->spi1MisoMode = PO_DEFAULT;
|
||||
engineConfiguration->spi1sckPin = GPIO_UNASSIGNED;
|
||||
engineConfiguration->spi1SckMode = PO_DEFAULT;
|
||||
|
||||
engineConfiguration->spi3mosiPin = GPIOC_12;
|
||||
engineConfiguration->spi3MosiMode = PO_DEFAULT;
|
||||
engineConfiguration->spi3misoPin = GPIOC_11;
|
||||
engineConfiguration->spi3MisoMode = PO_DEFAULT;
|
||||
engineConfiguration->spi3sckPin = GPIOC_10;
|
||||
engineConfiguration->spi3SckMode = PO_DEFAULT;
|
||||
|
||||
/* Knock sensor */
|
||||
engineConfiguration->hip9011SpiDevice = SPI_DEVICE_4;
|
||||
engineConfiguration->hip9011CsPin = GPIOE_11; /* SPI4_NSS1 */
|
||||
engineConfiguration->hip9011CsPinMode = OM_OPENDRAIN;
|
||||
engineConfiguration->hip9011IntHoldPin = GPIOH_8;
|
||||
engineConfiguration->hip9011IntHoldPinMode = OM_OPENDRAIN;
|
||||
engineConfiguration->hipOutputChannel = EFI_ADC_7; /* PA7 */
|
||||
engineConfiguration->isHip9011Enabled = true;
|
||||
|
||||
|
||||
engineConfiguration->hip9011PrescalerAndSDO = (0x6 << 1); //HIP_16MHZ_PRESCALER;
|
||||
engineConfiguration->hip9011Gain = 1.0;
|
||||
engineConfiguration->knockBandCustom = 0.0;
|
||||
engineConfiguration->knockVThreshold = 4.0;
|
||||
engineConfiguration->cylinderBore = 96.9;
|
||||
engineConfiguration->maxKnockSubDeg = 20.0;
|
||||
|
||||
#if 0
|
||||
engineConfiguration->cj125SpiDevice = SPI_DEVICE_3;
|
||||
engineConfiguration->cj125ua = EFI_ADC_9;
|
||||
engineConfiguration->cj125ur = EFI_ADC_12;
|
||||
engineConfiguration->cj125CsPin = GPIOA_15;
|
||||
engineConfiguration->cj125CsPinMode = OM_OPENDRAIN;
|
||||
engineConfiguration->wboHeaterPin = GPIOC_13;
|
||||
engineConfiguration->o2heaterPin = GPIOC_13;
|
||||
#endif
|
||||
engineConfiguration->isCJ125Enabled = false;
|
||||
|
||||
engineConfiguration->canTxPin = GPIOD_1;
|
||||
engineConfiguration->canRxPin = GPIOD_0;
|
||||
|
||||
/* not used pins with testpads */
|
||||
engineConfiguration->triggerSimulatorPins[0] = GPIOH_2;
|
||||
engineConfiguration->triggerSimulatorPins[1] = GPIOH_3;
|
||||
engineConfiguration->triggerSimulatorPins[2] = GPIOH_4;
|
||||
engineConfiguration->triggerSimulatorPinModes[0] = OM_DEFAULT;
|
||||
engineConfiguration->triggerSimulatorPinModes[1] = OM_DEFAULT;
|
||||
engineConfiguration->triggerSimulatorPinModes[2] = OM_DEFAULT;
|
||||
|
||||
engineConfiguration->logicAnalyzerPins[0] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->logicAnalyzerPins[1] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->logicAnalyzerPins[2] = GPIO_UNASSIGNED;
|
||||
engineConfiguration->logicAnalyzerPins[3] = GPIO_UNASSIGNED;
|
||||
//!!!!!!!!!!!!!!!!!!!
|
||||
//engineConfiguration->silentTriggerError = true;
|
||||
|
||||
//!!!!!!!!!!!!!
|
||||
//engineConfiguration->isEngineChartEnabled = false;
|
||||
|
||||
if (engineConfiguration->fuelAlgorithm == LM_REAL_MAF)
|
||||
setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);
|
||||
if (engineConfiguration->fuelAlgorithm == LM_ALPHA_N)
|
||||
setAlgorithm(LM_ALPHA_N PASS_CONFIG_PARAMETER_SUFFIX);
|
||||
}
|
|
@ -0,0 +1,991 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/board_io.c
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#ifndef BOARD_IO_H
|
||||
#define BOARD_IO_H
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
|
||||
#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U))
|
||||
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
// See https://github.com/rusefi/rusefi/issues/397
|
||||
#define DEFAULT_GPIO_SPEED PIN_OSPEED_HIGH
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
*
|
||||
* PA0 - n.u.
|
||||
* PA1 - ignition current sensor for cyl 1, 3, 5, 7
|
||||
* PA2 - ignition current sensor for cyl 2, 4, 6, 8
|
||||
* PA3 - MAF sensor input
|
||||
* PA4 - n.u.
|
||||
* PA5 - n.u.
|
||||
* PA6 - battery voltage input
|
||||
* PA7 - knock sensor input
|
||||
* PA8 - knock IC clock out
|
||||
* PA9 - USART1_TX - boot/console - TTL level on XP4.2
|
||||
* PA10 - USART1_RX - boot/console - TTL level on XP4.3
|
||||
* PA11 - USB_FS_D- - boot/console/TS - XS3
|
||||
* PA12 - USB_FS_D+ - boot/console/TS - XS3
|
||||
* PA13 - SWDIO
|
||||
* PA14 - SWCLK
|
||||
* PA15 - bluetooth/wifi module reset gpio
|
||||
*/
|
||||
#define VAL_GPIOA_MODER (PIN_OTYPE_PUSHPULL(1) | \
|
||||
PIN_MODE_ANALOG(2) | \
|
||||
PIN_MODE_ANALOG(2) | \
|
||||
PIN_MODE_ANALOG(3) | \
|
||||
PIN_OTYPE_PUSHPULL(4) | \
|
||||
PIN_OTYPE_PUSHPULL(5) | \
|
||||
PIN_MODE_ANALOG(6) | \
|
||||
PIN_MODE_ANALOG(7) | \
|
||||
PIN_MODE_ALTERNATE(8) | \
|
||||
PIN_MODE_ALTERNATE(9) | \
|
||||
PIN_MODE_ALTERNATE(10) | \
|
||||
PIN_MODE_ALTERNATE(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
PIN_MODE_ALTERNATE(13) | \
|
||||
PIN_MODE_ALTERNATE(14) | \
|
||||
PIN_MODE_OUTPUT(15))
|
||||
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14) | \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOA_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_PULLUP( 9) | \
|
||||
PIN_PUPDR_PULLUP(10) | \
|
||||
PIN_PUPDR_FLOATING(11) | \
|
||||
PIN_PUPDR_FLOATING(12) | \
|
||||
PIN_PUPDR_PULLUP(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLUP(15))
|
||||
#define VAL_GPIOA_ODR (PIN_ODR_LOW(0) | \
|
||||
PIN_ODR_LOW(4) | \
|
||||
PIN_ODR_LOW(5) | \
|
||||
PIN_ODR_LOW(15))
|
||||
#define VAL_GPIOA_AFRL (PIN_AFIO_AF( 0, 1U) | \
|
||||
PIN_AFIO_AF( 1, 1U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOA_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 7U) | \
|
||||
PIN_AFIO_AF(10, 7U) | \
|
||||
PIN_AFIO_AF(11, 10U) | \
|
||||
PIN_AFIO_AF(12, 10U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOB setup:
|
||||
*
|
||||
* PB0 - oxygen sensor #2
|
||||
* PB1 - EGR t sensor
|
||||
* PB2 - boot mode - pulled low
|
||||
* PB3 - ignition #1
|
||||
* PB4 - ignition #3
|
||||
* PB5 - ignition #7
|
||||
* PB6 - QSPI CS
|
||||
* PB7 - ignition (1, 3, 5, 7) spark duration input
|
||||
* PB8 - ignition #5
|
||||
* PB9 - injector #7
|
||||
* PB10 - VR diagnostic (crank #2 and cam)
|
||||
* PB11 - n.u.
|
||||
* PB12 - USB HS ID
|
||||
* PB13 - USB HS VBus
|
||||
* PB14 - USB HS DM
|
||||
* PB15 - USB HS DP
|
||||
*/
|
||||
#define VAL_GPIOB_MODER (PIN_MODE_ANALOG(0) | \
|
||||
PIN_MODE_ANALOG(1) | \
|
||||
PIN_MODE_INPUT(2) | \
|
||||
PIN_MODE_OUTPUT(3) | \
|
||||
PIN_MODE_OUTPUT(4) | \
|
||||
PIN_MODE_OUTPUT(5) | \
|
||||
PIN_MODE_ALTERNATE(6) | \
|
||||
PIN_MODE_INPUT(7) | \
|
||||
PIN_MODE_OUTPUT(8) | \
|
||||
PIN_MODE_OUTPUT(9) | \
|
||||
PIN_MODE_OUTPUT(10) | \
|
||||
PIN_MODE_OUTPUT(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
PIN_MODE_INPUT(13) | \
|
||||
PIN_MODE_ALTERNATE(14) | \
|
||||
PIN_MODE_ALTERNATE(15))
|
||||
#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14) | \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOB_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOB_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_PULLDOWN( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_PULLUP( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_FLOATING( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_FLOATING(11) | \
|
||||
PIN_PUPDR_FLOATING(12) | \
|
||||
PIN_PUPDR_FLOATING(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_FLOATING(15))
|
||||
#define VAL_GPIOB_ODR (PIN_ODR_LOW(3) | \
|
||||
PIN_ODR_LOW(4) | \
|
||||
PIN_ODR_LOW(5) | \
|
||||
PIN_ODR_LOW(8) | \
|
||||
PIN_ODR_LOW(9) | \
|
||||
PIN_ODR_LOW(10) | \
|
||||
PIN_ODR_LOW(11) | \
|
||||
PIN_ODR_LOW(13))
|
||||
#define VAL_GPIOB_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOB_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 0U) | \
|
||||
PIN_AFIO_AF(10, 0U) | \
|
||||
PIN_AFIO_AF(11, 0U) | \
|
||||
PIN_AFIO_AF(12, 12U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 12U) | \
|
||||
PIN_AFIO_AF(15, 12U))
|
||||
|
||||
/*
|
||||
* GPIOC setup:
|
||||
*
|
||||
* PC0 - Atm P input
|
||||
* PC1 - Aux0 input
|
||||
* PC2 - Throtle input
|
||||
* PC3 - mc33972 analog input
|
||||
* PC4 - coolant T input
|
||||
* PC5 - oxygen #1 input
|
||||
* PC6 - idle open
|
||||
* PC7 - USB HS power enable
|
||||
* PC8 - idle close
|
||||
* PC9 - USB HS overcurrent input
|
||||
* PC10 - UART4 TX
|
||||
* PC11 - UART4 Rx
|
||||
* PC12 - bluetooth/wifi mode
|
||||
* PC13 - ignition #4
|
||||
* PC14 - ignition #2
|
||||
* PC15 - ignition #6
|
||||
*/
|
||||
#define VAL_GPIOC_MODER (PIN_MODE_ANALOG(0) | \
|
||||
PIN_MODE_ANALOG(1) | \
|
||||
PIN_MODE_ANALOG(2) | \
|
||||
PIN_MODE_ANALOG(3) | \
|
||||
PIN_MODE_ANALOG(4) | \
|
||||
PIN_MODE_ANALOG(5) | \
|
||||
PIN_MODE_OUTPUT(6) | \
|
||||
PIN_MODE_OUTPUT(7) | \
|
||||
PIN_MODE_OUTPUT(8) | \
|
||||
PIN_MODE_INPUT(9) | \
|
||||
PIN_MODE_ALTERNATE(10) | \
|
||||
PIN_MODE_ALTERNATE(11) | \
|
||||
PIN_MODE_OUTPUT(12) | \
|
||||
PIN_MODE_OUTPUT(13) | \
|
||||
PIN_MODE_OUTPUT(14) | \
|
||||
PIN_MODE_OUTPUT(15))
|
||||
#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14) | \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOC_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_PULLUP( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_PULLUP(11) | \
|
||||
PIN_PUPDR_FLOATING(12) | \
|
||||
PIN_PUPDR_FLOATING(13) | \
|
||||
PIN_PUPDR_FLOATING(14) | \
|
||||
PIN_PUPDR_FLOATING(15))
|
||||
#define VAL_GPIOC_ODR (PIN_ODR_LOW(6) | \
|
||||
PIN_ODR_LOW(7) | \
|
||||
PIN_ODR_LOW(8) | \
|
||||
PIN_ODR_LOW(12) | \
|
||||
PIN_ODR_LOW(13) | \
|
||||
PIN_ODR_LOW(14) | \
|
||||
PIN_ODR_LOW(15))
|
||||
#define VAL_GPIOC_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOC_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 0U) | \
|
||||
PIN_AFIO_AF(10, 8U) | \
|
||||
PIN_AFIO_AF(11, 8U) | \
|
||||
PIN_AFIO_AF(12, 0U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOD setup:
|
||||
*
|
||||
* PD0 - CAN1 Rx
|
||||
* PD1 - CAN1 Tx
|
||||
* PD2 - E-Thtot #2 direction
|
||||
* PD3 - E-Thtot #2 PWM
|
||||
* PD4 - E-Thtot #1 direction
|
||||
* PD5 - E-Thtot #1 PWM
|
||||
* PD6 - MMC clk
|
||||
* PD7 - MMC cmd
|
||||
* PD8 - UART3 Tx
|
||||
* PD9 - UART3 Rx
|
||||
* PD10 - Power hold to PMIC
|
||||
* PD11 - QSPI IO0
|
||||
* PD12 - QSPI IO1
|
||||
* PD13 - QSPI IO2
|
||||
* PD14 - Speed sensor input
|
||||
* PD15 - LIN RTS
|
||||
*/
|
||||
#define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(0) | \
|
||||
PIN_MODE_ALTERNATE(1) | \
|
||||
PIN_MODE_OUTPUT(2) | \
|
||||
PIN_MODE_OUTPUT(3) | \
|
||||
PIN_MODE_OUTPUT(4) | \
|
||||
PIN_MODE_OUTPUT(5) | \
|
||||
PIN_MODE_ALTERNATE(6) | \
|
||||
PIN_MODE_ALTERNATE(7) | \
|
||||
PIN_MODE_ALTERNATE(8) | \
|
||||
PIN_MODE_ALTERNATE(9) | \
|
||||
PIN_MODE_OUTPUT(10) | \
|
||||
PIN_MODE_ALTERNATE(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
PIN_MODE_ALTERNATE(13) | \
|
||||
PIN_MODE_INPUT(14) | \
|
||||
PIN_MODE_ALTERNATE(15))
|
||||
#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14) | \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOD_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
PIN_OSPEED_HIGH( 6) | \
|
||||
PIN_OSPEED_HIGH( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
PIN_OSPEED_HIGH(11) | \
|
||||
PIN_OSPEED_HIGH(12) | \
|
||||
PIN_OSPEED_HIGH(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_PULLUP( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_PULLUP(11) | \
|
||||
PIN_PUPDR_PULLUP(12) | \
|
||||
PIN_PUPDR_PULLUP(13) | \
|
||||
PIN_PUPDR_FLOATING(14) | \
|
||||
PIN_PUPDR_FLOATING(15))
|
||||
#define VAL_GPIOD_ODR (PIN_ODR_LOW(2) | \
|
||||
PIN_ODR_LOW(3) | \
|
||||
PIN_ODR_LOW(4) | \
|
||||
PIN_ODR_LOW(5) | \
|
||||
PIN_ODR_HIGH(10))
|
||||
#define VAL_GPIOD_AFRL (PIN_AFIO_AF( 0, 9U) | \
|
||||
PIN_AFIO_AF( 1, 9U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 11U) | \
|
||||
PIN_AFIO_AF( 7, 11U))
|
||||
#define VAL_GPIOD_AFRH (PIN_AFIO_AF( 8, 7U) | \
|
||||
PIN_AFIO_AF( 9, 7U) | \
|
||||
PIN_AFIO_AF(10, 0U) | \
|
||||
PIN_AFIO_AF(11, 9U) | \
|
||||
PIN_AFIO_AF(12, 9U) | \
|
||||
PIN_AFIO_AF(13, 9U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 8U))
|
||||
|
||||
/*
|
||||
* GPIOE setup:
|
||||
*
|
||||
* PE0 - LIN Rx
|
||||
* PE1 - LIN Tx
|
||||
* PE2 - QSPI IO2
|
||||
* PE3 - injector #2
|
||||
* PE4 - injector #4
|
||||
* PE5 - injector #6
|
||||
* PE6 - injector %8
|
||||
* PE7 - n.u.
|
||||
* PE8 - n.u.
|
||||
* PE9 - Crank position sensor #2
|
||||
* PE10 - SPI4 CS2 (5V pulled)
|
||||
* PE11 - SPI4 CS1 (5V pulled)
|
||||
* PE12 - SPI4 SCK (5V pulled)
|
||||
* PE13 - SPI4 MISO (5V pulled)
|
||||
* PE14 - SPI4 MOSI (5V pulled)
|
||||
* PE15 - SPI4 CS0 (5V pulled)
|
||||
*/
|
||||
#define VAL_GPIOE_MODER (PIN_MODE_ALTERNATE(0) | \
|
||||
PIN_MODE_ALTERNATE(1) | \
|
||||
PIN_MODE_OUTPUT(2) /* PIN_MODE_ALTERNATE(2) */ | \
|
||||
PIN_MODE_OUTPUT(3) | \
|
||||
PIN_MODE_OUTPUT(4) | \
|
||||
PIN_MODE_OUTPUT(5) | \
|
||||
PIN_MODE_OUTPUT(6) | \
|
||||
PIN_MODE_OUTPUT(7) | \
|
||||
PIN_MODE_OUTPUT(8) | \
|
||||
PIN_MODE_INPUT(9) | \
|
||||
PIN_MODE_OUTPUT(10) | \
|
||||
PIN_MODE_OUTPUT(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
PIN_MODE_ALTERNATE(13) | \
|
||||
PIN_MODE_ALTERNATE(14) | \
|
||||
PIN_MODE_OUTPUT(15))
|
||||
#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_OPENDRAIN(10)| \
|
||||
PIN_OTYPE_OPENDRAIN(11)| \
|
||||
PIN_OTYPE_OPENDRAIN(12)| \
|
||||
PIN_OTYPE_PUSHPULL(13) /* PIN_OTYPE_OPENDRAIN(13) */| \
|
||||
PIN_OTYPE_OPENDRAIN(14)| \
|
||||
PIN_OTYPE_OPENDRAIN(15))
|
||||
#define VAL_GPIOE_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_PULLUP( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_PULLUP( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_FLOATING(11) | \
|
||||
PIN_PUPDR_FLOATING(12) | \
|
||||
PIN_PUPDR_FLOATING(13) | \
|
||||
PIN_PUPDR_FLOATING(14) | \
|
||||
PIN_PUPDR_FLOATING(15))
|
||||
#define VAL_GPIOE_ODR (PIN_ODR_LOW(3) | \
|
||||
PIN_ODR_LOW(4) | \
|
||||
PIN_ODR_LOW(5) | \
|
||||
PIN_ODR_LOW(6) | \
|
||||
PIN_ODR_LOW(7) | \
|
||||
PIN_ODR_LOW(8) | \
|
||||
PIN_ODR_HIGH(10) | \
|
||||
PIN_ODR_HIGH(11) | \
|
||||
PIN_ODR_HIGH(15))
|
||||
#define VAL_GPIOE_AFRL (PIN_AFIO_AF( 0, 8U) | \
|
||||
PIN_AFIO_AF( 1, 8U) | \
|
||||
PIN_AFIO_AF( 2, 9U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOE_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 0U) | \
|
||||
PIN_AFIO_AF(10, 0U) | \
|
||||
PIN_AFIO_AF(11, 0U) | \
|
||||
PIN_AFIO_AF(12, 5U) | \
|
||||
PIN_AFIO_AF(13, 5U) | \
|
||||
PIN_AFIO_AF(14, 5U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOF setup:
|
||||
*
|
||||
* PF0 - Ignition (2, 4, 6, 8) MAXI input
|
||||
* PF1 - SPI5 CS0
|
||||
* PF2 - SPI5 CS1
|
||||
* PF3 - optional analog input 3
|
||||
* PF4 - optional analog input 2
|
||||
* PF5 - optional analog input 1
|
||||
* PF6 - optional analog input 0
|
||||
* PF7 - SPI5 SCK
|
||||
* PF8 - SPI5 MISO
|
||||
* PF9 - SPI5 MOSI
|
||||
* PF10 - QSPI CLK
|
||||
* PF11 - SPI5 CS4
|
||||
* PF12 - SPI5 CS5
|
||||
* PF13 - n.u.
|
||||
* PF14 - SPI5 CS2
|
||||
* PF15 - SPI5 CS3
|
||||
*/
|
||||
#define VAL_GPIOF_MODER (PIN_MODE_INPUT(0) | \
|
||||
PIN_MODE_OUTPUT(1) | \
|
||||
PIN_MODE_OUTPUT(2) | \
|
||||
PIN_MODE_ANALOG(3) | \
|
||||
PIN_MODE_ANALOG(4) | \
|
||||
PIN_MODE_ANALOG(5) | \
|
||||
PIN_MODE_ANALOG(6) | \
|
||||
PIN_MODE_ALTERNATE(7) | \
|
||||
PIN_MODE_ALTERNATE(8) | \
|
||||
PIN_MODE_ALTERNATE(9) | \
|
||||
PIN_MODE_ALTERNATE(10) | \
|
||||
PIN_MODE_OUTPUT(11) | \
|
||||
PIN_MODE_OUTPUT(12) | \
|
||||
PIN_MODE_OUTPUT(13) | \
|
||||
PIN_MODE_OUTPUT(14) | \
|
||||
PIN_MODE_OUTPUT(15))
|
||||
#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14) | \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOF_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_PULLUP( 8) | \
|
||||
PIN_PUPDR_FLOATING( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_FLOATING(11) | \
|
||||
PIN_PUPDR_FLOATING(12) | \
|
||||
PIN_PUPDR_FLOATING(13) | \
|
||||
PIN_PUPDR_FLOATING(14) | \
|
||||
PIN_PUPDR_FLOATING(15))
|
||||
#define VAL_GPIOF_ODR (PIN_ODR_HIGH(1) | \
|
||||
PIN_ODR_HIGH(2) | \
|
||||
PIN_ODR_HIGH(11) | \
|
||||
PIN_ODR_HIGH(12) | \
|
||||
PIN_ODR_HIGH(14) | \
|
||||
PIN_ODR_HIGH(15))
|
||||
#define VAL_GPIOF_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 5U))
|
||||
#define VAL_GPIOF_AFRH (PIN_AFIO_AF( 8, 5U) | \
|
||||
PIN_AFIO_AF( 9, 5U) | \
|
||||
PIN_AFIO_AF(10, 9U) | \
|
||||
PIN_AFIO_AF(11, 0U) | \
|
||||
PIN_AFIO_AF(12, 0U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOG setup:
|
||||
*
|
||||
* PG0 - CAN1 EN
|
||||
* PG1 - SW2 irq
|
||||
* PG2 - taho out
|
||||
* PG3 - 1 wire interface
|
||||
* PG4 - mc33972 irq
|
||||
* PG5 - mc33972 wake up input
|
||||
* PG6 - LD2 - active low
|
||||
* PG7 - LD1 - active low
|
||||
* PG8 - LD0 - active low
|
||||
* PG9 - MMC D0
|
||||
* PG10 - MMC D1
|
||||
* PG11 - MMC D2
|
||||
* PG12 - MMC D3
|
||||
* PG13 - ignition (1, 3, 5, 7) MAXI input
|
||||
* PG14 - E-Throttle disable
|
||||
* PG15 - ignition (1, 3, 5, 7) NOMI input
|
||||
*/
|
||||
#define VAL_GPIOG_MODER (PIN_MODE_OUTPUT(0) | \
|
||||
PIN_MODE_INPUT(1) | \
|
||||
PIN_MODE_OUTPUT(2) | \
|
||||
PIN_MODE_OUTPUT(3) | \
|
||||
PIN_MODE_INPUT(4) | \
|
||||
PIN_MODE_INPUT(5) | \
|
||||
PIN_MODE_OUTPUT(6) | \
|
||||
PIN_MODE_OUTPUT(7) | \
|
||||
PIN_MODE_OUTPUT(8) | \
|
||||
PIN_MODE_ALTERNATE(9) | \
|
||||
PIN_MODE_ALTERNATE(10) | \
|
||||
PIN_MODE_ALTERNATE(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
PIN_MODE_INPUT(13) | \
|
||||
PIN_MODE_OUTPUT(14) | \
|
||||
PIN_MODE_INPUT(15))
|
||||
#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_OPENDRAIN( 6)| \
|
||||
PIN_OTYPE_OPENDRAIN( 7)| \
|
||||
PIN_OTYPE_OPENDRAIN( 8)| \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14)| \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOG_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOG_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_PULLUP( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_PULLUP( 4) | \
|
||||
PIN_PUPDR_PULLUP( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_PULLUP( 9) | \
|
||||
PIN_PUPDR_PULLUP(10) | \
|
||||
PIN_PUPDR_PULLUP(11) | \
|
||||
PIN_PUPDR_PULLUP(12) | \
|
||||
PIN_PUPDR_PULLUP(13) | \
|
||||
PIN_PUPDR_FLOATING(14) | \
|
||||
PIN_PUPDR_PULLUP(15))
|
||||
#define VAL_GPIOG_ODR (PIN_ODR_LOW(0) | \
|
||||
PIN_ODR_LOW(2) | \
|
||||
PIN_ODR_HIGH(3) | \
|
||||
PIN_ODR_HIGH(6) | \
|
||||
PIN_ODR_HIGH(7) | \
|
||||
PIN_ODR_HIGH(8) | \
|
||||
PIN_ODR_HIGH(14))
|
||||
#define VAL_GPIOG_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOG_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 11U) | \
|
||||
PIN_AFIO_AF(10, 11U) | \
|
||||
PIN_AFIO_AF(11, 10U) | \
|
||||
PIN_AFIO_AF(12, 11U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOH setup:
|
||||
*
|
||||
* PH0 - OSC_IN (input floating).
|
||||
* PH1 - OSC_OUT (input floating).
|
||||
* PH2 - n.u.
|
||||
* PH3 - n.u.
|
||||
* PH4 - n.u.
|
||||
* PH5 - n.u.
|
||||
* PH6 - SW reset
|
||||
* PH7 - self shutdown output
|
||||
* PH8 - knock sensor IC hold output (5V pulled)
|
||||
* PH9 - knock sensor IC tst output (5V pulled)
|
||||
* PH10 - Crank position #1
|
||||
* PH11 - watchdog
|
||||
* PH12 - Cam positio #1
|
||||
* PH13 - USB FS overcurrent input
|
||||
* PH14 - USB FS power enable
|
||||
* PH15 - OLED DC output
|
||||
*/
|
||||
#define VAL_GPIOH_MODER (PIN_MODE_INPUT(0) | \
|
||||
PIN_MODE_INPUT(1) | \
|
||||
PIN_MODE_OUTPUT(2) | \
|
||||
PIN_MODE_OUTPUT(3) | \
|
||||
PIN_MODE_OUTPUT(4) | \
|
||||
PIN_MODE_OUTPUT(5) | \
|
||||
PIN_MODE_OUTPUT(6) | \
|
||||
PIN_MODE_OUTPUT(7) | \
|
||||
PIN_MODE_OUTPUT(8) | \
|
||||
PIN_MODE_OUTPUT(9) | \
|
||||
PIN_MODE_INPUT(10) | \
|
||||
PIN_MODE_OUTPUT(11) | \
|
||||
PIN_MODE_INPUT(12) | \
|
||||
PIN_MODE_INPUT(13) | \
|
||||
PIN_MODE_OUTPUT(14) | \
|
||||
PIN_MODE_OUTPUT(15))
|
||||
#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_OPENDRAIN( 8)| \
|
||||
PIN_OTYPE_OPENDRAIN( 9)| \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11) | \
|
||||
PIN_OTYPE_PUSHPULL(12) | \
|
||||
PIN_OTYPE_PUSHPULL(13) | \
|
||||
PIN_OTYPE_PUSHPULL(14) | \
|
||||
PIN_OTYPE_PUSHPULL(15))
|
||||
#define VAL_GPIOH_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOH_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_FLOATING( 9) | \
|
||||
PIN_PUPDR_PULLUP(10) | \
|
||||
PIN_PUPDR_FLOATING(11) | \
|
||||
PIN_PUPDR_PULLUP(12) | \
|
||||
PIN_PUPDR_PULLUP(13) | \
|
||||
PIN_PUPDR_FLOATING(14) | \
|
||||
PIN_PUPDR_FLOATING(15))
|
||||
#define VAL_GPIOH_ODR (PIN_ODR_HIGH( 0) | \
|
||||
PIN_ODR_HIGH( 1) | \
|
||||
PIN_ODR_LOW( 2) | \
|
||||
PIN_ODR_LOW( 3) | \
|
||||
PIN_ODR_LOW( 4) | \
|
||||
PIN_ODR_LOW( 5) | \
|
||||
PIN_ODR_LOW( 6) | \
|
||||
PIN_ODR_LOW( 7) | \
|
||||
PIN_ODR_HIGH( 8) | \
|
||||
PIN_ODR_HIGH( 9) | \
|
||||
PIN_ODR_LOW(11) | \
|
||||
PIN_ODR_LOW(14) | \
|
||||
PIN_ODR_LOW(15))
|
||||
#define VAL_GPIOH_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 0U) | \
|
||||
PIN_AFIO_AF( 3, 0U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOH_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 0U) | \
|
||||
PIN_AFIO_AF(10, 0U) | \
|
||||
PIN_AFIO_AF(11, 0U) | \
|
||||
PIN_AFIO_AF(12, 0U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOI setup:
|
||||
*
|
||||
* PI0 - SPI2 CS0
|
||||
* PI1 - SPI2 SCK
|
||||
* PI2 - SPI2 MISO
|
||||
* PI3 - SPI2 MOSI
|
||||
* PI4 - injector #5
|
||||
* PI5 - injector #3
|
||||
* PI6 - injector #1
|
||||
* PI7 - SW enable
|
||||
* PI8 - ignition (2, 4, 6, 8) spark duration input
|
||||
* PI9 - ignition #8
|
||||
* PI10 - n.u.
|
||||
* PI11 - ignition (2, 4, 6, 8) NOMI input
|
||||
*/
|
||||
#define VAL_GPIOI_MODER (PIN_MODE_OUTPUT(0) | \
|
||||
PIN_MODE_ALTERNATE(1) | \
|
||||
PIN_MODE_ALTERNATE(2) | \
|
||||
PIN_MODE_ALTERNATE(3) | \
|
||||
PIN_MODE_OUTPUT(4) | \
|
||||
PIN_MODE_OUTPUT(5) | \
|
||||
PIN_MODE_OUTPUT(6) | \
|
||||
PIN_MODE_OUTPUT(7) | \
|
||||
PIN_MODE_INPUT(8) | \
|
||||
PIN_MODE_OUTPUT(9) | \
|
||||
PIN_MODE_OUTPUT(10) | \
|
||||
PIN_MODE_INPUT(11))
|
||||
#define VAL_GPIOI_OTYPER (PIN_OTYPE_PUSHPULL( 0) | \
|
||||
PIN_OTYPE_PUSHPULL( 1) | \
|
||||
PIN_OTYPE_PUSHPULL( 2) | \
|
||||
PIN_OTYPE_PUSHPULL( 3) | \
|
||||
PIN_OTYPE_PUSHPULL( 4) | \
|
||||
PIN_OTYPE_PUSHPULL( 5) | \
|
||||
PIN_OTYPE_PUSHPULL( 6) | \
|
||||
PIN_OTYPE_PUSHPULL( 7) | \
|
||||
PIN_OTYPE_PUSHPULL( 8) | \
|
||||
PIN_OTYPE_PUSHPULL( 9) | \
|
||||
PIN_OTYPE_PUSHPULL(10) | \
|
||||
PIN_OTYPE_PUSHPULL(11))
|
||||
#define VAL_GPIOI_OSPEEDR (DEFAULT_GPIO_SPEED( 0) | \
|
||||
DEFAULT_GPIO_SPEED( 1) | \
|
||||
DEFAULT_GPIO_SPEED( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11))
|
||||
#define VAL_GPIOI_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_FLOATING( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_FLOATING( 3) | \
|
||||
PIN_PUPDR_FLOATING( 4) | \
|
||||
PIN_PUPDR_FLOATING( 5) | \
|
||||
PIN_PUPDR_FLOATING( 6) | \
|
||||
PIN_PUPDR_FLOATING( 7) | \
|
||||
PIN_PUPDR_PULLUP( 8) | \
|
||||
PIN_PUPDR_FLOATING( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_PULLUP(11))
|
||||
#define VAL_GPIOI_ODR (PIN_ODR_HIGH( 0) | \
|
||||
PIN_ODR_LOW( 4) | \
|
||||
PIN_ODR_LOW( 5) | \
|
||||
PIN_ODR_LOW( 6) | \
|
||||
PIN_ODR_LOW( 7) | \
|
||||
PIN_ODR_LOW( 9))
|
||||
#define VAL_GPIOI_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 5U) | \
|
||||
PIN_AFIO_AF( 2, 5U) | \
|
||||
PIN_AFIO_AF( 3, 5U) | \
|
||||
PIN_AFIO_AF( 4, 0U) | \
|
||||
PIN_AFIO_AF( 5, 0U) | \
|
||||
PIN_AFIO_AF( 6, 0U) | \
|
||||
PIN_AFIO_AF( 7, 0U))
|
||||
#define VAL_GPIOI_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 0U) | \
|
||||
PIN_AFIO_AF(10, 0U) | \
|
||||
PIN_AFIO_AF(11, 0U))
|
||||
|
||||
#endif /* BOARD_IO_H */
|
|
@ -0,0 +1,2 @@
|
|||
#We have our own enums
|
||||
GENERATED_ENUMS_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/config/controllers/algo
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,59 @@
|
|||
// was generated automatically by rusEfi tool from rusefi_hw_enums.h // was generated automatically by rusEfi tool from rusefi_enums.h // by enum2string.jar tool on Sun Nov 22 13:52:01 MSK 2020
|
||||
// see also gen_config_and_enums.bat
|
||||
|
||||
|
||||
|
||||
#include "rusefi_enums.h"
|
||||
#include "rusefi_hw_enums.h"
|
||||
#pragma once
|
||||
const char *getPidAutoTune_AutoTunerState(PidAutoTune_AutoTunerState value);
|
||||
const char *getPidAutoTune_Peak(PidAutoTune_Peak value);
|
||||
const char *getAdc_channel_e(adc_channel_e value);
|
||||
const char *getAdc_channel_mode_e(adc_channel_mode_e value);
|
||||
const char *getAfr_override_e(afr_override_e value);
|
||||
const char *getAir_pressure_sensor_type_e(air_pressure_sensor_type_e value);
|
||||
const char *getAntiLagActivationMode_e(antiLagActivationMode_e value);
|
||||
const char *getBoostType_e(boostType_e value);
|
||||
const char *getBrain_pin_diag_e(brain_pin_diag_e value);
|
||||
const char *getBrain_pin_e(brain_pin_e value);
|
||||
const char *getCan_baudrate_e(can_baudrate_e value);
|
||||
const char *getCan_nbc_e(can_nbc_e value);
|
||||
const char *getCan_vss_nbc_e(can_vss_nbc_e value);
|
||||
const char *getChamber_style_e(chamber_style_e value);
|
||||
const char *getCranking_ignition_mode_e(cranking_ignition_mode_e value);
|
||||
const char *getDebug_mode_e(debug_mode_e value);
|
||||
const char *getDisplay_mode_e(display_mode_e value);
|
||||
const char *getEgo_sensor_e(ego_sensor_e value);
|
||||
const char *getEngine_load_mode_e(engine_load_mode_e value);
|
||||
const char *getEngine_type_e(engine_type_e value);
|
||||
const char *getEtb_function_e(etb_function_e value);
|
||||
const char *getGear_e(gear_e value);
|
||||
const char *getGppwm_channel_e(gppwm_channel_e value);
|
||||
const char *getGppwm_compare_mode_e(gppwm_compare_mode_e value);
|
||||
const char *getHip_state_e(hip_state_e value);
|
||||
const char *getIdle_mode_e(idle_mode_e value);
|
||||
const char *getIdle_state_e(idle_state_e value);
|
||||
const char *getIgnition_mode_e(ignition_mode_e value);
|
||||
const char *getInjection_mode_e(injection_mode_e value);
|
||||
const char *getInjector_compensation_mode_e(injector_compensation_mode_e value);
|
||||
const char *getInjector_pressure_type_e(injector_pressure_type_e value);
|
||||
const char *getLaunchActivationMode_e(launchActivationMode_e value);
|
||||
const char *getLog_format_e(log_format_e value);
|
||||
const char *getMaf_sensor_type_e(maf_sensor_type_e value);
|
||||
const char *getOperation_mode_e(operation_mode_e value);
|
||||
const char *getPin_input_mode_e(pin_input_mode_e value);
|
||||
const char *getPin_mode_e(pin_mode_e value);
|
||||
const char *getPin_output_mode_e(pin_output_mode_e value);
|
||||
const char *getSensor_chart_e(sensor_chart_e value);
|
||||
const char *getSpi_device_e(spi_device_e value);
|
||||
const char *getSpi_speed_e(spi_speed_e value);
|
||||
const char *getTChargeMode_e(tChargeMode_e value);
|
||||
const char *getTiming_mode_e(timing_mode_e value);
|
||||
const char *getTle8888_mode_e(tle8888_mode_e value);
|
||||
const char *getTrigger_event_e(trigger_event_e value);
|
||||
const char *getTrigger_type_e(trigger_type_e value);
|
||||
const char *getTrigger_value_e(trigger_value_e value);
|
||||
const char *getTrigger_wheel_e(trigger_wheel_e value);
|
||||
const char *getUart_device_e(uart_device_e value);
|
||||
const char *getVe_override_e(ve_override_e value);
|
||||
const char *getVvt_mode_e(vvt_mode_e value);
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,49 @@
|
|||
#/!bin/sh
|
||||
# This batch files reads rusefi_config.txt and produses firmware persistent configuration headers
|
||||
# the storage section of rusefi.ini is updated as well
|
||||
|
||||
BOARDNAME=subaru_eg33
|
||||
SHORT_BOARDNAME=${BOARDNAME}_f7
|
||||
BOARD_DIR=config/boards/${BOARDNAME}
|
||||
BUILD_DIR=build_${BOARDNAME}
|
||||
|
||||
mkdir -p ${BUILD_DIR}
|
||||
|
||||
echo This batch files reads rusefi_config.txt and produses firmware persistent configuration headers
|
||||
echo the storage section of rusefi_${BOARDNAME}.ini is updated as well
|
||||
|
||||
java \
|
||||
-DSystemOut.name=gen_config_subaru_eg33_board \
|
||||
-cp ../java_tools/ConfigDefinition.jar \
|
||||
com.rusefi.board_generator.BoardReader \
|
||||
-yaml config/boards/${BOARDNAME}/mapping.yaml \
|
||||
-firmware_path . \
|
||||
-output_file tunerstudio/generated/${BOARDNAME}_prefix.txt \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-enumInputFile ${BOARD_DIR}/rusefi_hw_enums.h \
|
||||
> gen_config_${BOARDNAME}_1.log
|
||||
|
||||
[ $? -eq 0 ] || { echo "ERROR generating TunerStudio config for ${BOARDNAME}"; exit 1; }
|
||||
|
||||
java \
|
||||
-DSystemOut.name=gen_config_subaru_eg33 \
|
||||
-jar ../java_tools/ConfigDefinition.jar \
|
||||
-definition integration/rusefi_config.txt \
|
||||
-tool ${BOARD_DIR}/config/gen_config.sh \
|
||||
-ts_destination tunerstudio \
|
||||
-cache ${SHORT_BOARDNAME} \
|
||||
-cache_zip_file tunerstudio/generated/cache.zip \
|
||||
-firing_order controllers/algo/firing_order.h \
|
||||
-with_c_defines false \
|
||||
-initialize_to_zero false \
|
||||
-ts_output_name generated/rusefi_${SHORT_BOARDNAME}.ini \
|
||||
-c_defines ${BOARD_DIR}/config/controllers/algo/rusefi_generated.h \
|
||||
-c_destination ${BOARD_DIR}/config/controllers/algo/engine_configuration_generated_structures.h \
|
||||
-signature tunerstudio/generated/signature_${SHORT_BOARDNAME}.txt \
|
||||
-signature_destination controllers/generated/signature_${SHORT_BOARDNAME}.h \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-prepend tunerstudio/generated/${BOARDNAME}_prefix.txt \
|
||||
-prepend config/boards/${BOARDNAME}/prepend.txt \
|
||||
> gen_config_${BOARDNAME}_2.log
|
||||
|
||||
[ $? -eq 0 ] || { echo "ERROR generating TunerStudio config for ${BOARDNAME}"; exit 1; }
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo This batch files reads rusefi_enums.h and produses auto_generated_enums.* files
|
||||
|
||||
#cd ../../../..
|
||||
#cd ..
|
||||
|
||||
BOARD=subaru_eg33
|
||||
|
||||
java -DSystemOut.name=gen_enum_to_string \
|
||||
-jar ../java_tools/enum2string.jar \
|
||||
-inputPath . \
|
||||
-outputPath config/boards/${BOARD}/config/controllers/algo \
|
||||
-enumInputFile controllers/algo/rusefi_enums.h \
|
||||
-enumInputFile config/boards/${BOARD}/rusefi_hw_enums.h
|
|
@ -0,0 +1,4 @@
|
|||
#define output_pin_e_enum "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"," - Self Shutdown","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","D17 - FAN 1","D03 - FAN 2","C16 - Tacho out","C14 - FPump modulator","D23 - FPump relay","D22 - EGR control","D19 - CE indicator","C15 - AUX1 out","D18 - Auxillary air valve","D06 - Absorber purge","D02 - IDLE open","D01 - IDLE close","XP2 - AUX0 out","XP2 - AUX1 out","B08 - AC clutch","D20 - Charge valve","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
||||
#define adc_channel_e_enum "TP - AIN 0","int - IGN1 current","int - IGN2 current","B05 - MAF Ain","INVALID","INVALID","A02 - Battery Ain","int - Knock","A05 - Oxyg #2 Ain","A04 - EGR t Ait","--- - Atm P Ain","A18 - AUX0 Ain","B02 - TPS Ain","int - MC33972 DIN","A03 - Coolant t Ain","A06 - Oxyg #1 Ain","NONE"
|
||||
#define brain_input_pin_e_enum "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","B11 - Speed Din (GPIO)","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","A08 - Crank #2","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","C01 - Crank #1","INVALID","A07 - Cam","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","B11 - Speed Din (MC33972)","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
||||
#define switch_input_pin_e_enum "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","TP - SP1 Din","TP - SP2 Din","TP - SP3 Din","INVALID","C10 - Starter Din","C12 - Memory SW Din","C13 - Test SW Din","D04 - California ID Din","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","C09 - Air Condition request Din","B12 - IGN Din","INVALID","B10 - N pos Din","B09 - P pos Din","A20 - Torque Ctrl Din","A19 - AC Ctrl Din","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
|
@ -0,0 +1,145 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/efifeatures.h
|
||||
*
|
||||
* @brief In this header we can override efifeatures.h.
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#include "../../stm32f7ems/efifeatures.h"
|
||||
|
||||
#ifndef EFIFEATURES_SUBARUEG33_H_
|
||||
#define EFIFEATURES_SUBARUEG33_H_
|
||||
|
||||
/* LEDs */
|
||||
#undef LED_ERROR_BRAIN_PIN_MODE
|
||||
#define LED_ERROR_BRAIN_PIN_MODE INVERTED_OUTPUT
|
||||
#undef LED_WARNING_BRAIN_PIN_MODE
|
||||
#define LED_WARNING_BRAIN_PIN_MODE INVERTED_OUTPUT
|
||||
#undef LED_RUNING_BRAIN_PIN_MODE
|
||||
#define LED_RUNING_BRAIN_PIN_MODE INVERTED_OUTPUT
|
||||
|
||||
/* debug console */
|
||||
#undef EFI_USE_UART_FOR_CONSOLE
|
||||
#define EFI_USE_UART_FOR_CONSOLE TRUE
|
||||
#undef EFI_CONSOLE_SERIAL_DEVICE
|
||||
#define EFI_CONSOLE_SERIAL_DEVICE (&SD1)
|
||||
|
||||
/* TunerStudio binary protocol */
|
||||
/* do not use UART device for console */
|
||||
#undef TS_UART_DEVICE
|
||||
|
||||
/* do not use serial device for console */
|
||||
#undef TS_SERIAL_DEVICE
|
||||
|
||||
#undef BOARD_TLE6240_COUNT
|
||||
#define BOARD_TLE6240_COUNT 1
|
||||
|
||||
#define TLE6240_RESET_PORT GPIOH
|
||||
#define TLE6240_RESET_PAD 6
|
||||
#define TLE6240_DIRECT_IO \
|
||||
/* IN1..3 grounded */ \
|
||||
[0] = {.port = NULL, .pad = 0}, \
|
||||
[1] = {.port = NULL, .pad = 0}, \
|
||||
/* IN3 - D_TACH_OUT */ \
|
||||
[2] = {.port = GPIOG, .pad = 2},\
|
||||
/* IN4 - grounded */ \
|
||||
[3] = {.port = NULL, .pad = 0}, \
|
||||
/* IN9..10 grounded */ \
|
||||
[4] = {.port = NULL, .pad = 15},\
|
||||
[5] = {.port = NULL, .pad = 14},\
|
||||
/* IN11 - D_IDLE_OPEN */ \
|
||||
[6] = {.port = GPIOC, .pad = 6},\
|
||||
/* IN12 - D_IDLE_CLOSE */ \
|
||||
[7] = {.port = GPIOC, .pad = 8}
|
||||
|
||||
#undef BOARD_MC33972_COUNT
|
||||
#define BOARD_MC33972_COUNT 1
|
||||
|
||||
#undef BOARD_MC33810_COUNT
|
||||
#define BOARD_MC33810_COUNT 2
|
||||
|
||||
#undef BOARD_TLE8888_COUNT
|
||||
#define BOARD_TLE8888_COUNT 0
|
||||
|
||||
#undef EFI_RTC
|
||||
#define EFI_RTC FALSE
|
||||
|
||||
#undef EFI_POTENTIOMETER
|
||||
#define EFI_POTENTIOMETER FALSE
|
||||
|
||||
#undef EFI_MAX_31855
|
||||
#define EFI_MAX_31855 FALSE
|
||||
|
||||
#undef EFI_HD44780_LCD
|
||||
#define EFI_HD44780_LCD FALSE
|
||||
|
||||
#undef EFI_IDLE_CONTROL
|
||||
#define EFI_IDLE_CONTROL TRUE
|
||||
|
||||
#undef EFI_USB_SERIAL
|
||||
#define EFI_USB_SERIAL TRUE
|
||||
|
||||
#undef EFI_FUEL_PUMP
|
||||
#define EFI_FUEL_PUMP TRUE
|
||||
|
||||
#undef MMC_CARD_SPI
|
||||
#define MMC_CARD_SPI SPID1
|
||||
|
||||
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
|
||||
|
||||
#undef EFI_UART_GPS
|
||||
#define EFI_UART_GPS FALSE
|
||||
|
||||
#undef EFI_BLUETOOTH_SETUP
|
||||
#define EFI_BLUETOOTH_SETUP FALSE
|
||||
|
||||
#undef SERIAL_SPEED
|
||||
#define SERIAL_SPEED 115200
|
||||
|
||||
#ifdef EFI_CONSOLE_SERIAL_DEVICE
|
||||
#undef EFI_CONSOLE_TX_PORT
|
||||
#define EFI_CONSOLE_TX_PORT GPIOA
|
||||
#undef EFI_CONSOLE_TX_PIN
|
||||
#define EFI_CONSOLE_TX_PIN 9
|
||||
#undef EFI_CONSOLE_RX_PORT
|
||||
#define EFI_CONSOLE_RX_PORT GPIOA
|
||||
#undef EFI_CONSOLE_RX_PIN
|
||||
#define EFI_CONSOLE_RX_PIN 10
|
||||
#undef EFI_CONSOLE_AF
|
||||
#define EFI_CONSOLE_AF 7
|
||||
#endif
|
||||
|
||||
#undef TS_SERIAL_AF
|
||||
#define TS_SERIAL_AF 8
|
||||
|
||||
/* no console switch */
|
||||
#undef CONSOLE_MODE_SWITCH_PORT
|
||||
#undef CONSOLE_MODE_SWITCH_PIN
|
||||
#define GET_CONSOLE_MODE_VALUE() (FALSE)
|
||||
|
||||
/* no reset switch */
|
||||
#undef CONFIG_RESET_SWITCH_PORT
|
||||
#undef CONFIG_RESET_SWITCH_PIN
|
||||
|
||||
#undef ADC_VCC
|
||||
#define ADC_VCC 2.5f
|
||||
|
||||
#undef EFI_MAIN_RELAY_CONTROL
|
||||
#define EFI_MAIN_RELAY_CONTROL FALSE
|
||||
|
||||
#undef EFI_MEMS
|
||||
#define EFI_MEMS FALSE
|
||||
|
||||
#undef EFI_IDLE_PID_CIC
|
||||
#define EFI_IDLE_PID_CIC TRUE
|
||||
|
||||
#define RPM_LOW_THRESHOLD 8 // RPM=8 is an empirical lower sensitivity threshold of MAX9926 for 60-2
|
||||
#define NO_RPM_EVENTS_TIMEOUT_SECS 5 // (RPM < 12)
|
||||
|
||||
#define EFI_PRINT_ERRORS_AS_WARNINGS TRUE
|
||||
|
||||
#define EFI_NARROW_EGO_AVERAGING TRUE
|
||||
|
||||
#endif /* EFIFEATURES_SUBARUEG33_H_ */
|
|
@ -0,0 +1,41 @@
|
|||
/**
|
||||
* @file boards/subarue_eg33/halconf.h
|
||||
*
|
||||
* @brief In this header we can override halconf.h.
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#include "mcuconf.h"
|
||||
#include "../../stm32f7ems/halconf.h"
|
||||
|
||||
#ifndef _HALCONF_SUBARUEG33_H_
|
||||
#define _HALCONF_SUBARUEG33_H_
|
||||
|
||||
#undef HAL_USE_PAL
|
||||
#define HAL_USE_PAL TRUE
|
||||
#undef PAL_USE_CALLBACKS
|
||||
#define PAL_USE_CALLBACKS TRUE
|
||||
#undef HAL_TRIGGER_USE_PAL
|
||||
#define HAL_TRIGGER_USE_PAL TRUE
|
||||
|
||||
#undef HAL_USE_I2C
|
||||
#define HAL_USE_I2C FALSE
|
||||
|
||||
#undef HAL_USE_SERIAL
|
||||
#define HAL_USE_SERIAL TRUE
|
||||
|
||||
//#if TS_UART_DMA_MODE
|
||||
#undef HAL_USE_UART
|
||||
#define HAL_USE_UART FALSE
|
||||
#undef UART_USE_WAIT
|
||||
#define UART_USE_WAIT FALSE
|
||||
//#else
|
||||
//#define HAL_USE_UART FALSE
|
||||
//#endif
|
||||
|
||||
#undef HAL_USE_USB_MSD
|
||||
#define HAL_USE_USB_MSD FALSE
|
||||
|
||||
#endif /* _HALCONF_SUBARUEG33_H_ */
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
export PROJECT_BOARD=subaru_eg33
|
||||
export PROJECT_CPU=ARCH_STM32F7
|
||||
export MCU=cortex-m7
|
||||
export EXTRA_PARAMS="-DSHORT_BOARD_NAME=subaru_eg33_f7 -DDUMMY -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE"
|
||||
export DEFAULT_ENGINE_TYPE="-DDEFAULT_ENGINE_TYPE=SUBARUEG33_DEFAULTS"
|
||||
#echo $EXTRA_PARAMS
|
||||
#export DEBUG_LEVEL_OPT="-O0"
|
||||
#export USE_BOOTLOADER=yes
|
||||
|
||||
#export LDSCRIPT="config/boards/NUCLEO_F767/STM32F76xxI.ld"
|
||||
#bash config/boards/common_make.sh
|
||||
|
||||
#CROSS_COMPILE=../../toolchain/gcc-arm-none-eabi-8-2018-q4-major/bin/arm-none-eabi- make $*
|
||||
CROSS_COMPILE=../../toolchain/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi- make $*
|
|
@ -0,0 +1,92 @@
|
|||
outputs:
|
||||
# MCU
|
||||
GPIOH_7: " - Self Shutdown"
|
||||
# TLE6240
|
||||
TLE6240_PIN_1: "D17 - FAN 1"
|
||||
TLE6240_PIN_2: "D03 - FAN 2"
|
||||
TLE6240_PIN_3: "C16 - Tacho out"
|
||||
TLE6240_PIN_4: "C14 - FPump modulator"
|
||||
TLE6240_PIN_5: "D23 - FPump relay"
|
||||
TLE6240_PIN_6: "D22 - EGR control"
|
||||
TLE6240_PIN_7: "D19 - CE indicator"
|
||||
TLE6240_PIN_8: "C15 - AUX1 out"
|
||||
TLE6240_PIN_9: "D18 - Auxillary air valve"
|
||||
TLE6240_PIN_10: "D06 - Absorber purge"
|
||||
TLE6240_PIN_11: "D02 - IDLE open"
|
||||
TLE6240_PIN_12: "D01 - IDLE close"
|
||||
TLE6240_PIN_13: "XP2 - AUX0 out"
|
||||
TLE6240_PIN_14: "XP2 - AUX1 out"
|
||||
TLE6240_PIN_15: "B08 - AC clutch"
|
||||
TLE6240_PIN_16: "D20 - Charge valve"
|
||||
# MC33810s
|
||||
MC33810_0_PIN_1: "D13 - INJ 1"
|
||||
MC33810_0_PIN_2: "D11 - INJ 3"
|
||||
MC33810_0_PIN_3: "A01 - INJ 5"
|
||||
MC33810_0_PIN_4: "XP2 - INJ 7"
|
||||
MC33810_0_PIN_5: "D07 - IGN 1"
|
||||
MC33810_0_PIN_6: "D09 - IGN 3"
|
||||
MC33810_0_PIN_7: "XP2 - IGN 7 (HP)"
|
||||
MC33810_0_PIN_8: "D21 - IGN 5"
|
||||
MC33810_1_PIN_1: "D12 - INJ 2"
|
||||
MC33810_1_PIN_2: "D26 - INJ 4"
|
||||
MC33810_1_PIN_3: "A12 - INJ 6"
|
||||
MC33810_1_PIN_4: "XP6 - INJ 8"
|
||||
MC33810_1_PIN_5: "XP6 - IGN 8 (HP)"
|
||||
MC33810_1_PIN_6: "D16 - IGN 6"
|
||||
MC33810_1_PIN_7: "D08 - IGN 2"
|
||||
MC33810_1_PIN_8: "D10 - IGN 4"
|
||||
|
||||
switch_inputs:
|
||||
MC33972_PIN_1: "TP - SP1 Din"
|
||||
MC33972_PIN_2: "TP - SP2 Din"
|
||||
MC33972_PIN_3: "TP - SP3 Din"
|
||||
MC33972_PIN_5: "C10 - Starter Din"
|
||||
MC33972_PIN_6: "C12 - Memory SW Din"
|
||||
MC33972_PIN_7: "C13 - Test SW Din"
|
||||
MC33972_PIN_8: "D04 - California ID Din"
|
||||
MC33972_PIN_16: "C09 - Air Condition request Din"
|
||||
MC33972_PIN_17: "B12 - IGN Din"
|
||||
MC33972_PIN_19: "B10 - N pos Din"
|
||||
MC33972_PIN_20: "B09 - P pos Din"
|
||||
MC33972_PIN_21: "A20 - Torque Ctrl Din"
|
||||
MC33972_PIN_22: "A19 - AC Ctrl Din"
|
||||
|
||||
event_inputs:
|
||||
GPIOH_10: "C01 - Crank #1"
|
||||
GPIOE_9: "A08 - Crank #2"
|
||||
GPIOH_12: "A07 - Cam"
|
||||
GPIOD_14: "B11 - Speed Din (GPIO)"
|
||||
MC33972_PIN_18: "B11 - Speed Din (MC33972)"
|
||||
|
||||
analog_inputs:
|
||||
EFI_ADC_0: "TP - AIN 0"
|
||||
EFI_ADC_1: "int - IGN1 current"
|
||||
EFI_ADC_2: "int - IGN2 current"
|
||||
EFI_ADC_3: "B05 - MAF Ain"
|
||||
# EFI_ADC_4: "n.u."
|
||||
EFI_ADC_6: "A02 - Battery Ain"
|
||||
EFI_ADC_7: "int - Knock"
|
||||
EFI_ADC_8: "A05 - Oxyg #2 Ain"
|
||||
EFI_ADC_9: "A04 - EGR t Ait"
|
||||
EFI_ADC_10: "--- - Atm P Ain"
|
||||
EFI_ADC_11: "A18 - AUX0 Ain"
|
||||
EFI_ADC_12: "B02 - TPS Ain"
|
||||
EFI_ADC_13: "int - MC33972 DIN"
|
||||
EFI_ADC_14: "A03 - Coolant t Ain"
|
||||
EFI_ADC_15: "A06 - Oxyg #1 Ain"
|
||||
# EFI_ADC3_4: "XP2 - OPT0"
|
||||
# EFI_ADC3_5: "n.u."
|
||||
# EFI_ADC3_6: "n.u."
|
||||
# EFI_ADC3_7: "n.u."
|
||||
# EFI_ADC3_8: "n.u."
|
||||
# EFI_ADC3_9: "XP6 - OPT3"
|
||||
# EFI_ADC3_14: "XP6 - OPT2"
|
||||
# EFI_ADC3_15: "XP2 - OPT1"
|
||||
# MC33972_PIN_4: "A03 - Coolant t Ain"
|
||||
# MC33972_PIN_9: "A04 - EGR t Ain"
|
||||
# MC33972_PIN_10: "A06 - Oxyg #1"
|
||||
# MC33972_PIN_11: "A05 - Oxyg #2"
|
||||
# MC33972_PIN_12: "--- - Atm P Ain"
|
||||
# MC33972_PIN_13: "A18 - AUX0 Ain"
|
||||
# MC33972_PIN_14: "B02 - TPS Ain"
|
||||
# MC33972_PIN_15: "B05 - MAF Ain"
|
|
@ -0,0 +1,94 @@
|
|||
/**
|
||||
* @file boards/subarue-eg33/mcuconf.h
|
||||
*
|
||||
* @brief In this header we can override mcuconf.h.
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#include "../../stm32f7ems/mcuconf.h"
|
||||
|
||||
#ifndef _MCUCONF_SUBARUEG33_H_
|
||||
#define _MCUCONF_SUBARUEG33_H_
|
||||
|
||||
/* clocks adjust for 25 MHz ocs */
|
||||
#undef STM32_PLLM_VALUE
|
||||
#define STM32_PLLM_VALUE 25
|
||||
|
||||
//#undef CORTEX_ENABLE_WFI_IDLE
|
||||
#define CORTEX_ENABLE_WFI_IDLE FALSE
|
||||
|
||||
//#undef STM32_LSE_ENABLED
|
||||
//#define STM32_LSE_ENABLED FALSE
|
||||
|
||||
#undef STM32_RTCSEL
|
||||
#define STM32_RTCSEL STM32_RTCSEL_HSEDIV // STM32_RTCSEL_LSI
|
||||
|
||||
/* serials and uarts */
|
||||
#undef STM32_SERIAL_USE_USART1
|
||||
#undef STM32_UART_USE_USART1
|
||||
//#if TS_UART_DMA_MODE
|
||||
//#define STM32_SERIAL_USE_UART1 FALSE
|
||||
//#else
|
||||
#define STM32_SERIAL_USE_USART1 TRUE
|
||||
#define STM32_UART_USE_USART1 FALSE
|
||||
//#endif
|
||||
|
||||
/* enable serial driver for USART2 to make usbconsole.c happy:
|
||||
* as '#define USB_SERIAL_DRIVER SD2' in usbconsole.h and
|
||||
* sdStart(&USB_SERIAL_DRIVER, NULL); is called unconditionaly */
|
||||
#undef STM32_SERIAL_USE_USART2
|
||||
#undef STM32_UART_USE_USART2
|
||||
#define STM32_SERIAL_USE_USART2 TRUE
|
||||
#define STM32_UART_USE_USART2 FALSE
|
||||
|
||||
#undef STM32_SERIAL_USE_USART3
|
||||
#undef STM32_UART_USE_USART3
|
||||
#define STM32_SERIAL_USE_USART3 FALSE
|
||||
#define STM32_UART_USE_USART3 FALSE
|
||||
|
||||
#undef STM32_UART_USE_USART3
|
||||
#define STM32_UART_USE_USART3 FALSE
|
||||
|
||||
#undef STM32_UART_USE_UART4
|
||||
#define STM32_UART_USE_UART4 FALSE
|
||||
|
||||
#undef STM32_USB_USE_OTG1
|
||||
#define STM32_USB_USE_OTG1 TRUE
|
||||
|
||||
#undef STM32_USB_USE_USB1
|
||||
#define STM32_USB_USE_USB1 TRUE
|
||||
|
||||
#undef STM32_I2C_USE_I2C1
|
||||
#define STM32_I2C_USE_I2C1 FALSE
|
||||
|
||||
#undef STM32_SPI_USE_SPI2
|
||||
#define STM32_SPI_USE_SPI2 FALSE
|
||||
|
||||
#undef STM32_SPI_USE_SPI4
|
||||
#define STM32_SPI_USE_SPI4 TRUE
|
||||
|
||||
#undef STM32_SPI_USE_SPI5
|
||||
#define STM32_SPI_USE_SPI5 TRUE
|
||||
|
||||
#undef STM32_ADC_USE_ADC3
|
||||
#define STM32_ADC_USE_ADC3 TRUE
|
||||
|
||||
/* default STM32_DMA_STREAM_ID(2, 4) used by ADC1 */
|
||||
#undef STM32_SPI_SPI5_TX_DMA_STREAM
|
||||
#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 6)
|
||||
|
||||
/* To remove futher possible conflict */
|
||||
#undef STM32_SPI_SPI6_RX_DMA_STREAM
|
||||
|
||||
#undef STM32_ICU_USE_TIM3
|
||||
#define STM32_ICU_USE_TIM3 TRUE
|
||||
|
||||
#undef STM32_CAN_USE_CAN2
|
||||
#define STM32_CAN_USE_CAN2 FALSE
|
||||
|
||||
//#undef STM32_CAN_CAN1_IRQ_PRIORITY
|
||||
//#define STM32_CAN_CAN1_IRQ_PRIORITY 4
|
||||
|
||||
#endif /* _MCUCONF_SUBARUEG33_H_ */
|
|
@ -0,0 +1,18 @@
|
|||
//TODO: understand this.
|
||||
|
||||
#define ts_show_hip9011 true
|
||||
#define ts_show_cj125 false
|
||||
#define ts_show_lcd false
|
||||
#define ts_show_joystick false
|
||||
#define ts_show_egt false
|
||||
#define ts_show_gps false
|
||||
#define ts_show_etb_pins true
|
||||
#define ts_show_analog_divider false
|
||||
#define ts_show_spi true
|
||||
#define ts_show_sd_card true
|
||||
#define ts_show_can_pins true
|
||||
#define ts_show_tunerstudio_port false
|
||||
|
||||
#define show_test_presets false
|
||||
#define show_Frankenso_presets false
|
||||
#define show_Proteus_presets false
|
|
@ -0,0 +1,4 @@
|
|||
subaru EG33 board.
|
||||
|
||||
https://github.com/dron0gus/rusefi
|
||||
https://rusefi.com/forum/viewtopic.php?p=35502
|
|
@ -0,0 +1,294 @@
|
|||
/*
|
||||
* @file rusefi_hw_enums.h
|
||||
*
|
||||
* @date Jun 2, 2019
|
||||
* @author Andrey Belomutskiy, (c) 2012-2020
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// todo: migrate/unify with pin_output_mode_e? rename? something is messy here
|
||||
// this enum is currently only used for SPI pins
|
||||
typedef enum __attribute__ ((__packed__)) {
|
||||
// todo: here we have a rare example of stm32-specific enum, todo: make this not stm32 specific?
|
||||
PO_DEFAULT = 0,
|
||||
PO_OPENDRAIN = 4, // PAL_STM32_OTYPE_OPENDRAIN
|
||||
PO_PULLUP = 32, // PAL_STM32_PUDR_PULLUP
|
||||
PO_PULLDOWN = 64 // PAL_STM32_PUPDR_PULLDOWN
|
||||
} pin_mode_e;
|
||||
|
||||
/**
|
||||
* Hardware pin. This enum is platform-specific.
|
||||
*/
|
||||
typedef enum __attribute__ ((__packed__)) {
|
||||
GPIO_UNASSIGNED = 0,
|
||||
GPIO_INVALID = 1,
|
||||
|
||||
GPIOA_0 = 2,
|
||||
GPIOA_1 = 3,
|
||||
GPIOA_2 = 4,
|
||||
GPIOA_3 = 5,
|
||||
GPIOA_4 = 6,
|
||||
GPIOA_5 = 7,
|
||||
GPIOA_6 = 8,
|
||||
GPIOA_7 = 9,
|
||||
GPIOA_8 = 10,
|
||||
GPIOA_9 = 11,
|
||||
GPIOA_10 = 12,
|
||||
GPIOA_11 = 13,
|
||||
GPIOA_12 = 14,
|
||||
GPIOA_13 = 15,
|
||||
GPIOA_14 = 16,
|
||||
GPIOA_15 = 17,
|
||||
|
||||
GPIOB_0 = 18,
|
||||
GPIOB_1 = 19,
|
||||
GPIOB_2 = 20,
|
||||
GPIOB_3 = 21,
|
||||
GPIOB_4 = 22,
|
||||
GPIOB_5 = 23,
|
||||
GPIOB_6 = 24,
|
||||
GPIOB_7 = 25,
|
||||
GPIOB_8 = 26,
|
||||
GPIOB_9 = 27,
|
||||
GPIOB_10 = 28,
|
||||
GPIOB_11 = 29,
|
||||
GPIOB_12 = 30,
|
||||
GPIOB_13 = 31,
|
||||
GPIOB_14 = 32,
|
||||
GPIOB_15 = 33,
|
||||
|
||||
GPIOC_0 = 34,
|
||||
GPIOC_1 = 35,
|
||||
GPIOC_2 = 36,
|
||||
GPIOC_3 = 37,
|
||||
GPIOC_4 = 38,
|
||||
GPIOC_5 = 39,
|
||||
GPIOC_6 = 40,
|
||||
GPIOC_7 = 41,
|
||||
GPIOC_8 = 42,
|
||||
GPIOC_9 = 43,
|
||||
GPIOC_10 = 44,
|
||||
GPIOC_11 = 45,
|
||||
GPIOC_12 = 46,
|
||||
GPIOC_13 = 47,
|
||||
GPIOC_14 = 48,
|
||||
GPIOC_15 = 49,
|
||||
|
||||
GPIOD_0 = 50,
|
||||
GPIOD_1 = 51,
|
||||
GPIOD_2 = 52,
|
||||
GPIOD_3 = 53,
|
||||
GPIOD_4 = 54,
|
||||
GPIOD_5 = 55,
|
||||
GPIOD_6 = 56,
|
||||
GPIOD_7 = 57,
|
||||
GPIOD_8 = 58,
|
||||
GPIOD_9 = 59,
|
||||
GPIOD_10 = 60,
|
||||
GPIOD_11 = 61,
|
||||
GPIOD_12 = 62,
|
||||
GPIOD_13 = 63,
|
||||
GPIOD_14 = 64,
|
||||
GPIOD_15 = 65,
|
||||
|
||||
GPIOE_0 = 66,
|
||||
GPIOE_1 = 67,
|
||||
GPIOE_2 = 68,
|
||||
GPIOE_3 = 69,
|
||||
GPIOE_4 = 70,
|
||||
GPIOE_5 = 71,
|
||||
GPIOE_6 = 72,
|
||||
GPIOE_7 = 73,
|
||||
GPIOE_8 = 74,
|
||||
GPIOE_9 = 75,
|
||||
GPIOE_10 = 76,
|
||||
GPIOE_11 = 77,
|
||||
GPIOE_12 = 78,
|
||||
GPIOE_13 = 79,
|
||||
GPIOE_14 = 80,
|
||||
GPIOE_15 = 81,
|
||||
|
||||
GPIOF_0 = 82,
|
||||
GPIOF_1 = 83,
|
||||
GPIOF_2 = 84,
|
||||
GPIOF_3 = 85,
|
||||
GPIOF_4 = 86,
|
||||
GPIOF_5 = 87,
|
||||
GPIOF_6 = 88,
|
||||
GPIOF_7 = 89,
|
||||
GPIOF_8 = 90,
|
||||
GPIOF_9 = 91,
|
||||
GPIOF_10 = 92,
|
||||
GPIOF_11 = 93,
|
||||
GPIOF_12 = 94,
|
||||
GPIOF_13 = 95,
|
||||
GPIOF_14 = 96,
|
||||
GPIOF_15 = 97,
|
||||
|
||||
GPIOG_0 = 98,
|
||||
GPIOG_1 = 99,
|
||||
GPIOG_2 = 100,
|
||||
GPIOG_3 = 101,
|
||||
GPIOG_4 = 102,
|
||||
GPIOG_5 = 103,
|
||||
GPIOG_6 = 104,
|
||||
GPIOG_7 = 105,
|
||||
GPIOG_8 = 106,
|
||||
GPIOG_9 = 107,
|
||||
GPIOG_10 = 108,
|
||||
GPIOG_11 = 109,
|
||||
GPIOG_12 = 110,
|
||||
GPIOG_13 = 111,
|
||||
GPIOG_14 = 112,
|
||||
GPIOG_15 = 113,
|
||||
|
||||
GPIOH_0 = 114,
|
||||
GPIOH_1 = 115,
|
||||
GPIOH_2 = 116,
|
||||
GPIOH_3 = 117,
|
||||
GPIOH_4 = 118,
|
||||
GPIOH_5 = 119,
|
||||
GPIOH_6 = 120,
|
||||
GPIOH_7 = 121,
|
||||
GPIOH_8 = 122,
|
||||
GPIOH_9 = 123,
|
||||
GPIOH_10 = 124,
|
||||
GPIOH_11 = 125,
|
||||
GPIOH_12 = 126,
|
||||
GPIOH_13 = 127,
|
||||
GPIOH_14 = 128,
|
||||
GPIOH_15 = 129,
|
||||
|
||||
GPIOI_0 = 130,
|
||||
GPIOI_1 = 131,
|
||||
GPIOI_2 = 132,
|
||||
GPIOI_3 = 133,
|
||||
GPIOI_4 = 134,
|
||||
GPIOI_5 = 135,
|
||||
GPIOI_6 = 136,
|
||||
GPIOI_7 = 137,
|
||||
GPIOI_8 = 138,
|
||||
GPIOI_9 = 139,
|
||||
GPIOI_10 = 140,
|
||||
GPIOI_11 = 141,
|
||||
GPIOI_12 = 142,
|
||||
GPIOI_13 = 143,
|
||||
GPIOI_14 = 144,
|
||||
GPIOI_15 = 145,
|
||||
|
||||
TLE6240_PIN_1 = 146,
|
||||
TLE6240_PIN_2 = 147,
|
||||
TLE6240_PIN_3 = 148,
|
||||
TLE6240_PIN_4 = 149,
|
||||
TLE6240_PIN_5 = 150,
|
||||
TLE6240_PIN_6 = 151,
|
||||
TLE6240_PIN_7 = 152,
|
||||
TLE6240_PIN_8 = 153,
|
||||
TLE6240_PIN_9 = 154,
|
||||
TLE6240_PIN_10 = 155,
|
||||
TLE6240_PIN_11 = 156,
|
||||
TLE6240_PIN_12 = 157,
|
||||
TLE6240_PIN_13 = 158,
|
||||
TLE6240_PIN_14 = 159,
|
||||
TLE6240_PIN_15 = 160,
|
||||
TLE6240_PIN_16 = 161,
|
||||
|
||||
MC33972_PIN_1 = 162,
|
||||
MC33972_PIN_2 = 163,
|
||||
MC33972_PIN_3 = 164,
|
||||
MC33972_PIN_4 = 165,
|
||||
MC33972_PIN_5 = 166,
|
||||
MC33972_PIN_6 = 167,
|
||||
MC33972_PIN_7 = 168,
|
||||
MC33972_PIN_8 = 169,
|
||||
MC33972_PIN_9 = 170,
|
||||
MC33972_PIN_10 = 171,
|
||||
MC33972_PIN_11 = 172,
|
||||
MC33972_PIN_12 = 173,
|
||||
MC33972_PIN_13 = 174,
|
||||
MC33972_PIN_14 = 175,
|
||||
MC33972_PIN_15 = 176,
|
||||
MC33972_PIN_16 = 177,
|
||||
MC33972_PIN_17 = 178,
|
||||
MC33972_PIN_18 = 179,
|
||||
MC33972_PIN_19 = 180,
|
||||
MC33972_PIN_20 = 181,
|
||||
MC33972_PIN_21 = 182,
|
||||
MC33972_PIN_22 = 183,
|
||||
|
||||
MC33810_0_OUT_0 = 184,
|
||||
MC33810_0_OUT_1 = 185,
|
||||
MC33810_0_OUT_2 = 186,
|
||||
MC33810_0_OUT_3 = 187,
|
||||
MC33810_0_GD_0 = 188,
|
||||
MC33810_0_GD_1 = 189,
|
||||
MC33810_0_GD_2 = 190,
|
||||
MC33810_0_GD_3 = 191,
|
||||
|
||||
MC33810_1_OUT_0 = 192,
|
||||
MC33810_1_OUT_1 = 193,
|
||||
MC33810_1_OUT_2 = 194,
|
||||
MC33810_1_OUT_3 = 195,
|
||||
MC33810_1_GD_0 = 196,
|
||||
MC33810_1_GD_1 = 197,
|
||||
MC33810_1_GD_2 = 198,
|
||||
MC33810_1_GD_3 = 199,
|
||||
} brain_pin_e;
|
||||
|
||||
/* Plase keep updating these defines */
|
||||
#define BRAIN_PIN_ONCHIP_LAST GPIOI_15
|
||||
#define BRAIN_PIN_ONCHIP_PINS (BRAIN_PIN_ONCHIP_LAST - GPIOA_0 + 1)
|
||||
#define BRAIN_PIN_LAST MC33810_1_GD_3
|
||||
#define BRAIN_PIN_TOTAL_PINS (BRAIN_PIN_LAST - GPIOA_0 + 1)
|
||||
/* Plase keep updating these defines */
|
||||
|
||||
/* diagnostic for brain pins
|
||||
* can be combination of few bits
|
||||
* defined as bit mask */
|
||||
typedef enum __attribute__ ((__packed__))
|
||||
{
|
||||
PIN_OK = 0,
|
||||
PIN_OPEN = 0x01,
|
||||
PIN_SHORT_TO_GND = 0x02,
|
||||
PIN_SHORT_TO_BAT = 0x04,
|
||||
PIN_OVERLOAD = 0x08,
|
||||
PIN_DRIVER_OVERTEMP = 0x10,
|
||||
PIN_INVALID = 0x80
|
||||
} brain_pin_diag_e;
|
||||
|
||||
typedef enum __attribute__ ((__packed__)) {
|
||||
EFI_ADC_NONE = 0,
|
||||
|
||||
EFI_ADC_0 = 1,
|
||||
EFI_ADC_1 = 2,
|
||||
EFI_ADC_2 = 3,
|
||||
EFI_ADC_3 = 4,
|
||||
EFI_ADC_4 = 5,
|
||||
EFI_ADC_5 = 6,
|
||||
EFI_ADC_6 = 7,
|
||||
EFI_ADC_7 = 8,
|
||||
EFI_ADC_8 = 9,
|
||||
EFI_ADC_9 = 10,
|
||||
EFI_ADC_10 = 11,
|
||||
EFI_ADC_11 = 12,
|
||||
EFI_ADC_12 = 13,
|
||||
EFI_ADC_13 = 14,
|
||||
EFI_ADC_14 = 15,
|
||||
EFI_ADC_15 = 16,
|
||||
|
||||
EFI_ADC3_4 = 17, // PF6
|
||||
EFI_ADC3_5 = 18, // PF7
|
||||
EFI_ADC3_6 = 19, // PF8
|
||||
EFI_ADC3_7 = 20, // PF9
|
||||
EFI_ADC3_8 = 21, // PF10
|
||||
EFI_ADC3_9 = 22, // PF3
|
||||
EFI_ADC3_14 = 23, // PF4
|
||||
EFI_ADC3_15 = 24, // PF5
|
||||
|
||||
EFI_ADC_TEMP_SENSOR = 25, // Internal temp sensor
|
||||
|
||||
EFI_ADC_LAST_CHANNEL = 26, // Please keep this in sync with the last valid channel index!
|
||||
|
||||
EFI_ADC_ERROR = 50,
|
||||
} adc_channel_e;
|
|
@ -62,3 +62,60 @@ void setSubaruEJ18_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
|
|||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Subaru SVX (Alcyone SVX)
|
||||
*/
|
||||
|
||||
void setSubaruEG33Defaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
|
||||
|
||||
engineConfiguration->trigger.type = TT_SUBARU_SVX;
|
||||
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
|
||||
|
||||
engineConfiguration->specs.cylindersCount = 6;
|
||||
engineConfiguration->specs.firingOrder = FO_1_6_3_2_5_4;
|
||||
|
||||
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
|
||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||
|
||||
/* TODO: */
|
||||
engineConfiguration->globalTriggerAngleOffset = 114; // the end of 19th tooth?
|
||||
|
||||
/* TODO: */
|
||||
//engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
|
||||
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
|
||||
|
||||
engineConfiguration->specs.displacement = 3.30;
|
||||
engineConfiguration->injector.flow = 250;
|
||||
|
||||
engineConfiguration->cranking.baseFuel = 5; // ???
|
||||
engineConfiguration->crankingChargeAngle = 70;
|
||||
engineConfiguration->cranking.rpm = 400;
|
||||
|
||||
engineConfiguration->rpmHardLimit = 6500;
|
||||
|
||||
engineConfiguration->idleStepperReactionTime = 10;
|
||||
engineConfiguration->stepperDirectionPinMode = OM_INVERTED;
|
||||
engineConfiguration->useLinearCltSensor = true;
|
||||
|
||||
engineConfiguration->canReadEnabled = true;
|
||||
engineConfiguration->canWriteEnabled = false;
|
||||
|
||||
/* TODO: */
|
||||
//engineConfiguration->tpsMin = convertVoltageTo10bitADC(0.250);
|
||||
//engineConfiguration->tpsMax = convertVoltageTo10bitADC(4.538);
|
||||
//engineConfiguration->tpsMax = convertVoltageTo10bitADC(5.000);
|
||||
engineConfiguration->tpsErrorDetectionTooLow = -10; // -10% open
|
||||
engineConfiguration->tpsErrorDetectionTooHigh = 110; // 110% open
|
||||
|
||||
engineConfiguration->mapMinBufferLength = 4;
|
||||
|
||||
/* idle configuration */
|
||||
engineConfiguration->manIdlePosition = 30;
|
||||
engineConfiguration->idle.solenoidFrequency = 250;
|
||||
|
||||
/* Check this */
|
||||
engineConfiguration->tachPulsePerRev = 2;
|
||||
}
|
||||
|
|
|
@ -10,3 +10,4 @@
|
|||
void setSubaru2003Wrx(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
void setSubaruEJ20GDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
void setSubaruEJ18_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE);
|
||||
void setSubaruEG33Defaults(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
|
|
@ -1375,6 +1375,11 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
|
|||
setTest33816EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif // HW_FRANKENSO
|
||||
#ifdef HW_SUBARU_EG33
|
||||
case SUBARUEG33_DEFAULTS:
|
||||
setSubaruEG33Defaults(PASS_CONFIG_PARAMETER_SIGNATURE);
|
||||
break;
|
||||
#endif //HW_SUBARU_EG33
|
||||
default:
|
||||
firmwareError(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType);
|
||||
}
|
||||
|
|
|
@ -191,6 +191,7 @@ typedef enum {
|
|||
|
||||
HELLEN_NB2 = ET_HELLEN_NB2,
|
||||
|
||||
SUBARUEG33_DEFAULTS = 70,
|
||||
|
||||
/**
|
||||
* this configuration has as few pins configured as possible
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
//
|
||||
// was generated automatically by rusEfi tool ConfigDefinition.jar based on config/boards/subaru_eg33/config/gen_config.sh integration/rusefi_config.txt
|
||||
//
|
||||
|
||||
#define SIGNATURE_BOARD subaru_eg33_f7
|
||||
#define SIGNATURE_DATE 2020.09.08
|
||||
#define SIGNATURE_HASH 1078744669
|
||||
#define TS_SIGNATURE "rusEFI 2020.09.08.subaru_eg33_f7.1078744669"
|
|
@ -9,7 +9,7 @@ rm -f gen_config_board.log
|
|||
bash gen_config_default.sh
|
||||
[ $? -eq 0 ] || { echo "ERROR generating default"; exit 1; }
|
||||
|
||||
for BOARD in "hellen/hellen72 hellen72" "microrusefi mre_f7" "microrusefi mre_f4" "frankenso frankenso_na6" "prometheus prometheus_469" "prometheus prometheus_405" "proteus proteus_f7" "proteus proteus_f4"; do
|
||||
for BOARD in "hellen/hellen72 hellen72" "microrusefi mre_f7" "microrusefi mre_f4" "frankenso frankenso_na6" "prometheus prometheus_469" "prometheus prometheus_405" "proteus proteus_f7" "proteus proteus_f4" "subaru_eg33 subaru_eg33_f7"; do
|
||||
BOARD_NAME="${BOARD% *}"
|
||||
BOARD_SHORT_NAME="${BOARD#* }"
|
||||
bash gen_config_board.sh $BOARD_NAME $BOARD_SHORT_NAME
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,4 @@
|
|||
#define output_pin_e_enum "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"," - Self Shutdown","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","D17 - FAN 1","D03 - FAN 2","C16 - Tacho out","C14 - FPump modulator","D23 - FPump relay","D22 - EGR control","D19 - CE indicator","C15 - AUX1 out","D18 - Auxillary air valve","D06 - Absorber purge","D02 - IDLE open","D01 - IDLE close","XP2 - AUX0 out","XP2 - AUX1 out","B08 - AC clutch","D20 - Charge valve","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
||||
#define adc_channel_e_enum "NONE","TP - AIN 0","int - IGN1 current","int - IGN2 current","B05 - MAF Ain","INVALID","INVALID","A02 - Battery Ain","int - Knock","A05 - Oxyg #2 Ain","A04 - EGR t Ait","--- - Atm P Ain","A18 - AUX0 Ain","B02 - TPS Ain","int - MC33972 DIN","A03 - Coolant t Ain","A06 - Oxyg #1 Ain","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
||||
#define brain_input_pin_e_enum "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","B11 - Speed Din (GPIO)","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","A08 - Crank #2","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","C01 - Crank #1","INVALID","A07 - Cam","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","B11 - Speed Din (MC33972)","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
||||
#define switch_input_pin_e_enum "NONE","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","TP - SP1 Din","TP - SP2 Din","TP - SP3 Din","INVALID","C10 - Starter Din","C12 - Memory SW Din","C13 - Test SW Din","D04 - California ID Din","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","C09 - Air Condition request Din","B12 - IGN Din","INVALID","B10 - N pos Din","B09 - P pos Din","A20 - Torque Ctrl Din","A19 - AC Ctrl Din","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID","INVALID"
|
Loading…
Reference in New Issue