mirror of https://github.com/FOME-Tech/fome-fw.git
Merge remote-tracking branch 'origin/master' into openblt-can
This commit is contained in:
commit
6b97de0523
|
@ -7,7 +7,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
|
|
|
@ -15,7 +15,82 @@ on:
|
|||
type: string
|
||||
|
||||
jobs:
|
||||
build-libopenblt-linux:
|
||||
runs-on: ubuntu-latest-selfhost
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: cmake configure libopenblt
|
||||
working-directory: ./firmware/ext/openblt/Host/Source/LibOpenBLT/build
|
||||
run: cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
- name: make libopenblt
|
||||
working-directory: ./firmware/ext/openblt/Host/Source/LibOpenBLT/build
|
||||
run: make -j8
|
||||
|
||||
- name: cmake configure libopenblt_jni
|
||||
working-directory: ./misc/libopenblt_jni/build
|
||||
run: cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
- name: make libopenblt_jni
|
||||
working-directory: ./misc/libopenblt_jni/build
|
||||
run: make -j8
|
||||
|
||||
- name: coalesce
|
||||
run: |
|
||||
mkdir deliver
|
||||
cp ./firmware/ext/openblt/Host/libopenblt.so deliver/
|
||||
cp ./misc/libopenblt_jni/build/libopenblt_jni.so deliver/
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: libopenblt-linux
|
||||
path: |
|
||||
./deliver/libopenblt.so
|
||||
./deliver/libopenblt_jni.so
|
||||
|
||||
build-libopenblt-macos:
|
||||
runs-on: macos-13
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: cmake configure libopenblt
|
||||
working-directory: ./firmware/ext/openblt/Host/Source/LibOpenBLT/build
|
||||
run: cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
- name: make libopenblt
|
||||
working-directory: ./firmware/ext/openblt/Host/Source/LibOpenBLT/build
|
||||
run: make -j8
|
||||
|
||||
- name: cmake configure libopenblt_jni
|
||||
working-directory: ./misc/libopenblt_jni/build
|
||||
run: cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
|
||||
- name: make libopenblt_jni
|
||||
working-directory: ./misc/libopenblt_jni/build
|
||||
run: make -j8
|
||||
|
||||
- name: coalesce
|
||||
run: |
|
||||
mkdir deliver
|
||||
cp ./firmware/ext/openblt/Host/libopenblt.dylib deliver/
|
||||
cp ./misc/libopenblt_jni/build/libopenblt_jni.dylib deliver/
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: libopenblt-macos
|
||||
path: |
|
||||
./deliver/libopenblt.dylib
|
||||
./deliver/libopenblt_jni.dylib
|
||||
|
||||
build-firmware:
|
||||
needs: [build-libopenblt-linux, build-libopenblt-macos]
|
||||
runs-on: ubuntu-latest-selfhost
|
||||
|
||||
strategy:
|
||||
|
@ -32,22 +107,26 @@ jobs:
|
|||
# folder: config/boards/hellen/hellen81
|
||||
# ini-file: fome_hellen81.ini
|
||||
|
||||
- build-target: alphax-2chan
|
||||
folder: config/boards/hellen/alphax-2chan
|
||||
ini-file: fome_alphax-2chan.ini
|
||||
# - build-target: alphax-2chan
|
||||
# folder: config/boards/hellen/alphax-2chan
|
||||
# ini-file: fome_alphax-2chan.ini
|
||||
|
||||
- build-target: alphax-4chan
|
||||
folder: config/boards/hellen/alphax-4chan
|
||||
ini-file: fome_alphax-4chan.ini
|
||||
# - build-target: alphax-4chan
|
||||
# folder: config/boards/hellen/alphax-4chan
|
||||
# ini-file: fome_alphax-4chan.ini
|
||||
|
||||
- build-target: alphax-8chan
|
||||
folder: config/boards/hellen/alphax-8chan
|
||||
ini-file: fome_alphax-8chan.ini
|
||||
# - build-target: alphax-8chan
|
||||
# folder: config/boards/hellen/alphax-8chan
|
||||
# ini-file: fome_alphax-8chan.ini
|
||||
|
||||
# - build-target: harley81
|
||||
# folder: config/boards/hellen/harley81
|
||||
# ini-file: fome_harley81.ini
|
||||
|
||||
- build-target: small-can-board
|
||||
folder: config/boards/hellen/small-can-board
|
||||
ini-file: rusefi_small-can-board.ini
|
||||
|
||||
# - build-target: hellen88bmw
|
||||
# folder: config/boards/hellen/hellen88bmw
|
||||
# ini-file: fome_hellen88bmw.ini
|
||||
|
@ -84,9 +163,9 @@ jobs:
|
|||
# folder: config/boards/hellen/hellen-honda-k
|
||||
# ini-file: fome_hellen-honda-k.ini
|
||||
|
||||
- build-target: hellen154hyundai
|
||||
folder: config/boards/hellen/hellen154hyundai
|
||||
ini-file: fome_hellen154hyundai.ini
|
||||
# - build-target: hellen154hyundai
|
||||
# folder: config/boards/hellen/hellen154hyundai
|
||||
# ini-file: fome_hellen154hyundai.ini
|
||||
|
||||
# - build-target: frankenso_na6
|
||||
# folder: config/boards/frankenso
|
||||
|
@ -156,13 +235,13 @@ jobs:
|
|||
# folder: config/boards/f429-discovery
|
||||
# ini-file: fome_f429-discovery.ini
|
||||
|
||||
# - build-target: core8
|
||||
# folder: config/boards/core8
|
||||
# ini-file: fome_core8.ini
|
||||
- build-target: core8
|
||||
folder: config/boards/core8
|
||||
ini-file: fome_core8.ini
|
||||
|
||||
# - build-target: 48way
|
||||
# folder: config/boards/48way
|
||||
# ini-file: fome_48way.ini
|
||||
- build-target: core48
|
||||
folder: config/boards/core48
|
||||
ini-file: fome_core48.ini
|
||||
|
||||
# - build-target: atlas
|
||||
# folder: config/boards/atlas
|
||||
|
@ -190,7 +269,7 @@ jobs:
|
|||
echo "full=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
|
@ -261,6 +340,18 @@ jobs:
|
|||
# 'OS="Windows_NT"' allows us to build Windows executable on unix
|
||||
run: OS="Windows_NT" bash misc/jenkins/build_simulator.sh
|
||||
|
||||
- name: Download LibOpenBLT Tool (Linux)
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: libopenblt-linux
|
||||
path: ./firmware/ext/openblt/Host/
|
||||
|
||||
- name: Download LibOpenBLT Tool (MacOS)
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: libopenblt-macos
|
||||
path: ./firmware/ext/openblt/Host/
|
||||
|
||||
- name: Package Bundle
|
||||
if: ${{ env.full == 'true' }}
|
||||
run: bash misc/jenkins/compile_other_versions/prepare_bundle.sh ${{matrix.build-target}} "${{matrix.ini-file}}" ${{ toJSON(inputs.build_name) }}
|
||||
|
|
|
@ -8,7 +8,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout Submodules
|
||||
run: |
|
||||
|
|
|
@ -11,7 +11,7 @@ jobs:
|
|||
os: [ubuntu-latest, macos-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Checkout Submodules
|
||||
run: |
|
||||
|
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
runs-on: ${{matrix.runs-on}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
if: ${{ github.repository == 'FOME-Tech/fome-fw' }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Check last date
|
||||
run: if [ "$(git log -1 --pretty=%B)" = "Update date" ]; then echo "skip=true" >> $GITHUB_ENV; fi
|
||||
|
|
|
@ -26,8 +26,8 @@
|
|||
branch = rusefi_prod_2021_11_12
|
||||
[submodule "firmware/ext/openblt"]
|
||||
path = firmware/ext/openblt
|
||||
url = https://github.com/rusefi/openblt
|
||||
branch = rusefi_prod
|
||||
url = https://github.com/fome-tech/openblt
|
||||
branch = master
|
||||
[submodule "misc/hex2dfu"]
|
||||
path = misc/hex2dfu
|
||||
url = https://github.com/rusefi/hex2dfu
|
||||
|
|
|
@ -38,12 +38,22 @@ Release template (copy/paste this for new release):
|
|||
- Configurable ignition timing limits, adding safety particularly for engines running wasted spark with a large cam #211
|
||||
- Improved injection, ignition bench test UI and functionality: More gauges, fuel pump on/off buttons for injector testing, and configurable duration/count #219
|
||||
- Preset for Mazdaspeed Miata (NB) IAT sensor
|
||||
- Option to compensate Alpha-N fueling with intake air temperature
|
||||
- Gasoline-scale AFR gauge: instead of showing true AFR, show "gasoline scale" where 14.7 means stoichiometric
|
||||
- Decode fuel temperature from flex fuel sensors #254
|
||||
- Allow brief operation over 100% injector duty cycle and add configurable duty cycle limits #215
|
||||
- Buttons to bump VVT targets for testing/PID tuning
|
||||
- Improved serial port selection for FOME console and firmware update
|
||||
|
||||
### Fixed
|
||||
- Improved bench test resolution (more usable for testing injectors, dwell, etc)
|
||||
- Maximum knock retard table displays correct Y axis values in TunerStudio
|
||||
- Make errors about fuel pressure sensors less aggressive #111 #117
|
||||
- Always operate in "two wire" mode for batch fuel, fixing batch firing order #23
|
||||
- Fix "Toyota 3 Tooth Cam" VVT mode (1JZ, 2JZ, 1G, etc) actually works now #237
|
||||
- Fix autotune while TS project is in AFR mode - corrections now made properly for target AFR table values
|
||||
- Changing idle stepper settings causes kernel panic #265
|
||||
- Data log channel "Fuel: Injection timing SOI" indicates correct values
|
||||
|
||||
## May 2023 Release
|
||||
|
||||
|
|
|
@ -43,15 +43,6 @@ ifeq ($(DEBUG_LEVEL_OPT),)
|
|||
# DEBUG_LEVEL_OPT = -O0 -ggdb -g
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(CCACHE_DIR),)
|
||||
$(info No CCACHE_DIR)
|
||||
else
|
||||
$(info CCACHE_DIR is ${CCACHE_DIR})
|
||||
CCPREFIX=ccache
|
||||
endif
|
||||
|
||||
|
||||
# Compiler options here.
|
||||
# yes we have two kinds of EXTRA_*PARAMS so that we can define those in two different places independently
|
||||
#
|
||||
|
@ -79,6 +70,8 @@ endif
|
|||
# Hellen is one of the boards which cares
|
||||
USE_CPPOPT += -Wno-error=tautological-compare
|
||||
|
||||
USE_CPPOPT += $(RUSEFI_CPPOPT)
|
||||
|
||||
# Enable this if you want the linker to remove unused code and data
|
||||
ifeq ($(USE_LINK_GC),)
|
||||
USE_LINK_GC = yes
|
||||
|
@ -297,8 +290,8 @@ ifeq ($(CROSS_COMPILE),)
|
|||
else
|
||||
TRGT = $(CROSS_COMPILE)
|
||||
endif
|
||||
CC = $(CCPREFIX) $(TRGT)gcc
|
||||
CPPC = $(CCPREFIX) $(TRGT)g++
|
||||
CC = $(TRGT)gcc
|
||||
CPPC = $(TRGT)g++
|
||||
# Enable loading with g++ only if you need C++ runtime support.
|
||||
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
||||
# runtime support makes code size explode.
|
||||
|
|
|
@ -23,6 +23,9 @@ DDEFS += -DEFI_USE_UART_DMA=FALSE
|
|||
|
||||
DDEFS += -DEFI_USB_SERIAL=TRUE -DHAL_USE_USB_MSD=FALSE
|
||||
|
||||
# Cache is disabled on F7, H7
|
||||
DDEFS += -DSTM32_SRAM2_NOCACHE=FALSE -DSTM32_NOCACHE_SRAM1_SRAM2=FALSE -DSTM32_NOCACHE_SRAM3=FALSE
|
||||
|
||||
DDEFS += -DEFI_UNIT_TEST=0 -DEFI_PROD_CODE=1 -DEFI_SIMULATOR=0
|
||||
|
||||
# Compiler options here.
|
||||
|
@ -190,8 +193,8 @@ CPPSRC = $(ALLCPPSRC) \
|
|||
$(PROJECT_DIR)/bootloader/openblt_chibios/openblt_chibios.cpp \
|
||||
$(PROJECT_DIR)/bootloader/openblt_chibios/openblt_flash.cpp \
|
||||
$(PROJECT_DIR)/bootloader/openblt_chibios/openblt_usb.cpp \
|
||||
src/rusefi_stubs.cpp \
|
||||
src/main.cpp
|
||||
bootloader_stubs.cpp \
|
||||
bootloader_main.cpp
|
||||
|
||||
# C sources to be compiled in ARM mode regardless of the global setting.
|
||||
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
|
||||
|
@ -220,6 +223,7 @@ ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) $(PROJECT_DIR)/hw_layer/main_hardf
|
|||
INCDIR = $(ALLINC) \
|
||||
$(PCH_DIR) \
|
||||
.. \
|
||||
$(BOARDINC) \
|
||||
$(CHIBIOS)/os/various \
|
||||
$(CHIBIOS)/os/ex/ST \
|
||||
$(CHIBIOS)/os/hal/lib/peripherals/sensors \
|
||||
|
@ -235,6 +239,7 @@ INCDIR = $(ALLINC) \
|
|||
$(PROJECT_DIR)/console/binary_log \
|
||||
$(PROJECT_DIR)/console/fl_binary \
|
||||
$(PROJECT_DIR)/hw_layer \
|
||||
$(PROJECT_DIR)/hw_layer/digital_input \
|
||||
$(PROJECT_DIR)/hw_layer/adc \
|
||||
$(PROJECT_DIR)/hw_layer/mass_storage \
|
||||
$(PROJECT_DIR)/hw_layer/serial_over_usb \
|
||||
|
@ -279,8 +284,8 @@ ifeq ($(CROSS_COMPILE),)
|
|||
else
|
||||
TRGT = $(CROSS_COMPILE)
|
||||
endif
|
||||
CC = $(CCPREFIX) $(TRGT)gcc
|
||||
CPPC = $(CCPREFIX) $(TRGT)g++
|
||||
CC = $(TRGT)gcc
|
||||
CPPC = $(TRGT)g++
|
||||
# Enable loading with g++ only if you need C++ runtime support.
|
||||
# NOTE: You can use C++ even without C++ support if you are careful. C++
|
||||
# runtime support makes code size explode.
|
|
@ -0,0 +1,74 @@
|
|||
|
||||
#include "pch.h"
|
||||
#include "usbconsole.h"
|
||||
#include "hardware.h"
|
||||
|
||||
extern "C" {
|
||||
#include "boot.h"
|
||||
#include "shared_params.h"
|
||||
}
|
||||
|
||||
class BlinkyThread : public chibios_rt::BaseStaticThread<256> {
|
||||
protected:
|
||||
void main(void) override {
|
||||
Gpio yellow = getWarningLedPin();
|
||||
Gpio blue = getCommsLedPin();
|
||||
Gpio green = getRunningLedPin();
|
||||
|
||||
efiSetPadMode("yellow", yellow, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
efiSetPadMode("blue", blue, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
efiSetPadMode("green", green, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
|
||||
auto yellowPort = getBrainPinPort(yellow);
|
||||
auto yellowPin = getBrainPinIndex(yellow);
|
||||
auto bluePort = getBrainPinPort(blue);
|
||||
auto bluePin = getBrainPinIndex(blue);
|
||||
auto greenPort = getBrainPinPort(green);
|
||||
auto greenPin = getBrainPinIndex(green);
|
||||
|
||||
palSetPad(yellowPort, yellowPin);
|
||||
palSetPad(bluePort, bluePin);
|
||||
palSetPad(greenPort, greenPin);
|
||||
|
||||
while (true) {
|
||||
palTogglePad(yellowPort, yellowPin);
|
||||
palTogglePad(bluePort, bluePin);
|
||||
palTogglePad(greenPort, greenPin);
|
||||
chThdSleepMilliseconds(250);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static BlinkyThread blinky;
|
||||
|
||||
int main(void) {
|
||||
halInit();
|
||||
chSysInit();
|
||||
|
||||
baseMCUInit();
|
||||
|
||||
// start the blinky thread
|
||||
blinky.start(NORMALPRIO + 10);
|
||||
|
||||
// Init openblt shared params
|
||||
SharedParamsInit();
|
||||
|
||||
// Init openblt itself
|
||||
BootInit();
|
||||
|
||||
while (true) {
|
||||
BootTask();
|
||||
}
|
||||
}
|
||||
|
||||
// very basic version, supports on chip pins only (really only used for USB, LEDs)
|
||||
void efiSetPadMode(const char* msg, brain_pin_e brainPin, iomode_t mode) {
|
||||
ioportid_t port = getHwPort(msg, brainPin);
|
||||
ioportmask_t pin = getHwPin(msg, brainPin);
|
||||
/* paranoid */
|
||||
if (port == GPIO_NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
palSetPadMode(port, pin, mode);
|
||||
}
|
|
@ -3,10 +3,10 @@
|
|||
#include "hardware.h"
|
||||
|
||||
/*
|
||||
* We need only a small portion of code from rusEFI codebase in the bootloader.
|
||||
* Mostly it's tunerstudio_io.cpp. And other files like efi_gpio.cpp etc. needed only to make it work.
|
||||
* We need only a small portion of code from FOME codebase in the bootloader.
|
||||
* Mostly it's efi_gpio.cpp, flash_main.cpp, etc. needed only to make it work.
|
||||
* And stubs needed just to settle down compiler errors.
|
||||
* The whole idea of bootloader is to make it as small as possible. And reasonably independent.
|
||||
* The whole idea of bootloader is to make it as small as possible and reasonably independent.
|
||||
*/
|
||||
|
||||
void chDbgPanic3(const char* /*msg*/, const char* /*file*/, int /*line*/) {
|
||||
|
@ -14,6 +14,9 @@ void chDbgPanic3(const char* /*msg*/, const char* /*file*/, int /*line*/) {
|
|||
|
||||
void logHardFault(uint32_t type, uintptr_t faultAddress, struct port_extctx* ctx, uint32_t csfr) { }
|
||||
|
||||
void firmwareError(ObdCode code, const char *fmt, ...) {
|
||||
}
|
||||
|
||||
// this is supposed to be taken from chconf_common.h but it does not work? I am not sure why :(
|
||||
// TODO: make this be defined by chconf_common.h?
|
||||
//#if ! ENABLE_PERF_TRACE
|
|
@ -9,7 +9,7 @@ echo "Entering $SCRIPT_NAME"
|
|||
BOOTLOADER_CODE_DESTINATION_FILE=$BOOTLOADER_CODE_DESTINATION_PATH/bootloader_generated.hxx
|
||||
|
||||
echo "$SCRIPT_NAME: Starting bootloader compilation..."
|
||||
make -j6 -f src/Makefile $1 $2 $3
|
||||
make -j6 $1 $2 $3
|
||||
|
||||
# downstream scripts detect error condition by checking if the output file exists so we need to make sure we remove it
|
||||
[ $? -eq 0 ] || { echo "ERROR: bootloader compilation failed"; rm -f blbuild/$BOOTLOADER_CODE_DESTINATION_FILE ; exit 1; }
|
||||
|
|
|
@ -44,24 +44,6 @@
|
|||
#include "boot.h" /* bootloader generic header */
|
||||
#include "flash.h"
|
||||
|
||||
|
||||
/****************************************************************************************
|
||||
* Hook functions
|
||||
****************************************************************************************/
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
extern void NvmInitHook(void);
|
||||
extern void NvmReinitHook(void);
|
||||
extern blt_int8u NvmWriteHook(blt_addr addr, blt_int32u len, blt_int8u *data);
|
||||
extern blt_int8u NvmEraseHook(blt_addr addr, blt_int32u len);
|
||||
extern blt_bool NvmDoneHook(void);
|
||||
#endif
|
||||
|
||||
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||
extern blt_bool NvmWriteChecksumHook(void);
|
||||
extern blt_bool NvmVerifyChecksumHook(void);
|
||||
#endif
|
||||
|
||||
|
||||
/************************************************************************************//**
|
||||
** \brief Initializes the NVM driver.
|
||||
** \return none.
|
||||
|
@ -69,13 +51,6 @@ extern blt_bool NvmVerifyChecksumHook(void);
|
|||
****************************************************************************************/
|
||||
void NvmInit(void)
|
||||
{
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
/* give the application a chance to initialize a driver for operating on NVM
|
||||
* that is not by default supported by this driver.
|
||||
*/
|
||||
NvmInitHook();
|
||||
#endif
|
||||
|
||||
/* init the internal driver */
|
||||
FlashInit();
|
||||
} /*** end of NvmInit ***/
|
||||
|
@ -90,13 +65,6 @@ void NvmInit(void)
|
|||
****************************************************************************************/
|
||||
void NvmReinit(void)
|
||||
{
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
/* give the application a chance to re-initialize a driver for operating on NVM
|
||||
* that is not by default supported by this driver.
|
||||
*/
|
||||
NvmReinitHook();
|
||||
#endif
|
||||
|
||||
/* reinitialize the internal driver */
|
||||
FlashReinit();
|
||||
} /*** end of NvmReinit ***/
|
||||
|
@ -112,33 +80,6 @@ void NvmReinit(void)
|
|||
****************************************************************************************/
|
||||
blt_bool NvmWrite(blt_addr addr, blt_int32u len, blt_int8u *data)
|
||||
{
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
blt_int8u result = BLT_NVM_NOT_IN_RANGE;
|
||||
#endif
|
||||
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
/* give the application a chance to operate on memory that is not by default supported
|
||||
* by this driver.
|
||||
*/
|
||||
result = NvmWriteHook(addr, len, data);
|
||||
|
||||
/* process the return code */
|
||||
if (result == BLT_NVM_OKAY)
|
||||
{
|
||||
/* data was within range of the additionally supported memory and succesfully
|
||||
* programmed, so we are all done.
|
||||
*/
|
||||
return BLT_TRUE;
|
||||
}
|
||||
else if (result == BLT_NVM_ERROR)
|
||||
{
|
||||
/* data was within range of the additionally supported memory and attempted to be
|
||||
* programmed, but an error occurred, so we can't continue.
|
||||
*/
|
||||
return BLT_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* still here so the internal driver should try and perform the program operation */
|
||||
return FlashWrite(addr, len, data);
|
||||
} /*** end of NvmWrite ***/
|
||||
|
@ -153,33 +94,6 @@ blt_bool NvmWrite(blt_addr addr, blt_int32u len, blt_int8u *data)
|
|||
****************************************************************************************/
|
||||
blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
||||
{
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
blt_int8u result = BLT_NVM_NOT_IN_RANGE;
|
||||
#endif
|
||||
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
/* give the application a chance to operate on memory that is not by default supported
|
||||
* by this driver.
|
||||
*/
|
||||
result = NvmEraseHook(addr, len);
|
||||
|
||||
/* process the return code */
|
||||
if (result == BLT_NVM_OKAY)
|
||||
{
|
||||
/* address was within range of the additionally supported memory and succesfully
|
||||
* erased, so we are all done.
|
||||
*/
|
||||
return BLT_TRUE;
|
||||
}
|
||||
else if (result == BLT_NVM_ERROR)
|
||||
{
|
||||
/* address was within range of the additionally supported memory and attempted to be
|
||||
* erased, but an error occurred, so we can't continue.
|
||||
*/
|
||||
return BLT_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* still here so the internal driver should try and perform the erase operation */
|
||||
return FlashErase(addr, len);
|
||||
} /*** end of NvmErase ***/
|
||||
|
@ -193,13 +107,8 @@ blt_bool NvmErase(blt_addr addr, blt_int32u len)
|
|||
****************************************************************************************/
|
||||
blt_bool NvmVerifyChecksum(void)
|
||||
{
|
||||
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||
/* check checksum using the application specific method. */
|
||||
return NvmVerifyChecksumHook();
|
||||
#else
|
||||
/* check checksum using the interally supported method. */
|
||||
return FlashVerifyChecksum();
|
||||
#endif
|
||||
} /*** end of NvmVerifyChecksum ***/
|
||||
|
||||
|
||||
|
@ -226,28 +135,11 @@ blt_addr NvmGetUserProgBaseAddress(void)
|
|||
****************************************************************************************/
|
||||
blt_bool NvmDone(void)
|
||||
{
|
||||
#if (BOOT_NVM_HOOKS_ENABLE > 0)
|
||||
/* give the application's NVM driver a chance to finish up */
|
||||
if (NvmDoneHook() == BLT_FALSE)
|
||||
{
|
||||
/* error so no need to continue */
|
||||
return BLT_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (BOOT_NVM_CHECKSUM_HOOKS_ENABLE > 0)
|
||||
/* compute and write checksum, using the application specific method. */
|
||||
if (NvmWriteChecksumHook() == BLT_FALSE)
|
||||
{
|
||||
return BLT_FALSE;
|
||||
}
|
||||
#else
|
||||
/* compute and write checksum, which is programmed by the internal driver. */
|
||||
if (FlashWriteChecksum() == BLT_FALSE)
|
||||
{
|
||||
return BLT_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* finish up internal driver operations */
|
||||
return FlashDone();
|
||||
|
|
|
@ -14,6 +14,13 @@ void TimerReset() { }
|
|||
void CopService() { }
|
||||
void TimerUpdate() { }
|
||||
|
||||
extern "C" void __core_init() {
|
||||
// This overrides the built-in __core_init() function
|
||||
// We do this to avoid enabling the D/I caches, which
|
||||
// we'll immediately have to turn back off when jumping
|
||||
// to the main firmware (which will then enable them itself)
|
||||
}
|
||||
|
||||
blt_int32u TimerGet() {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,38 +1,36 @@
|
|||
#include "pch.h"
|
||||
#include "flash_int.h"
|
||||
|
||||
#include <rusefi/crc.h>
|
||||
|
||||
extern "C" {
|
||||
#include "boot.h"
|
||||
#include "flash.h"
|
||||
}
|
||||
|
||||
void FlashInit() { }
|
||||
|
||||
blt_bool FlashVerifyChecksum() {
|
||||
// Naive check: if the first block is blank, there's no code there
|
||||
return intFlashIsErased(FlashGetUserProgBaseAddress(), 4) ? BLT_FALSE : BLT_TRUE;
|
||||
void FlashInit() {
|
||||
// Flash already init by ChibiOS
|
||||
}
|
||||
|
||||
blt_addr FlashGetUserProgBaseAddress() {
|
||||
#ifdef STM32H7XX
|
||||
return 0x08020000;
|
||||
return FLASH_BASE + 128 * 1024;
|
||||
#else // not STM32H7
|
||||
return 0x08008000;
|
||||
return FLASH_BASE + 32 * 1024;
|
||||
#endif
|
||||
}
|
||||
|
||||
blt_bool FlashWrite(blt_addr addr, blt_int32u len, blt_int8u *data) {
|
||||
return (FLASH_RETURN_SUCCESS == intFlashWrite(addr, (const char*)data, len)) ? BLT_TRUE : BLT_FALSE;
|
||||
|
||||
return BLT_TRUE;
|
||||
}
|
||||
|
||||
blt_bool FlashErase(blt_addr addr, blt_int32u len) {
|
||||
if (!intFlashIsErased(addr, len)) {
|
||||
return (FLASH_RETURN_SUCCESS == intFlashErase(addr, len)) ? BLT_TRUE : BLT_FALSE;
|
||||
if (intFlashIsErased(addr, len)) {
|
||||
// Already blank, we can skip the expensive erase operation
|
||||
return BLT_TRUE;
|
||||
}
|
||||
|
||||
return BLT_TRUE;
|
||||
return (FLASH_RETURN_SUCCESS == intFlashErase(addr, len)) ? BLT_TRUE : BLT_FALSE;
|
||||
}
|
||||
|
||||
blt_bool FlashDone() {
|
||||
|
@ -42,3 +40,31 @@ blt_bool FlashDone() {
|
|||
blt_bool FlashWriteChecksum() {
|
||||
return BLT_TRUE;
|
||||
}
|
||||
|
||||
blt_bool FlashVerifyChecksum() {
|
||||
// Naive check: if the first block is blank, there's no code there
|
||||
if (intFlashIsErased(FlashGetUserProgBaseAddress(), 4)) {
|
||||
return BLT_FALSE;
|
||||
}
|
||||
|
||||
static const size_t checksumOffset = 0x1C;
|
||||
|
||||
// Now do the actual CRC check to ensure we didn't get stuck with a half-written firmware image
|
||||
uint8_t* start = reinterpret_cast<uint8_t*>(FlashGetUserProgBaseAddress());
|
||||
|
||||
size_t imageSize = *reinterpret_cast<size_t*>(start + checksumOffset + 4);
|
||||
|
||||
if (imageSize > 1024 * 1024) {
|
||||
// impossibly large size, invalid
|
||||
return BLT_FALSE;
|
||||
}
|
||||
|
||||
// part before checksum+size
|
||||
uint32_t calcChecksum = crc32(start, checksumOffset);
|
||||
// part after checksum+size
|
||||
calcChecksum = crc32inc(start + checksumOffset + 4, calcChecksum, imageSize - (checksumOffset + 4));
|
||||
|
||||
uint32_t storedChecksum = *reinterpret_cast<uint32_t*>(start + checksumOffset);
|
||||
|
||||
return calcChecksum == storedChecksum ? BLT_TRUE : BLT_FALSE;
|
||||
}
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
|
||||
#include "pch.h"
|
||||
#include "usbconsole.h"
|
||||
#include "hardware.h"
|
||||
|
||||
extern "C" {
|
||||
#include "boot.h"
|
||||
#include "shared_params.h"
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
halInit();
|
||||
chSysInit();
|
||||
|
||||
baseMCUInit();
|
||||
|
||||
// Init openblt shared params
|
||||
SharedParamsInit();
|
||||
|
||||
// Init openblt itself
|
||||
BootInit();
|
||||
|
||||
while (true) {
|
||||
BootTask();
|
||||
}
|
||||
}
|
||||
|
||||
// very basic version, supports on chip pins only (really only used for USB)
|
||||
void efiSetPadMode(const char* msg, brain_pin_e brainPin, iomode_t mode) {
|
||||
ioportid_t port = getHwPort(msg, brainPin);
|
||||
ioportmask_t pin = getHwPin(msg, brainPin);
|
||||
/* paranoid */
|
||||
if (port == GPIO_NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
palSetPadMode(port, pin, mode);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
/**
|
||||
* @file boards/48way/board_configuration.cpp
|
||||
*
|
||||
* @brief Configuration defaults for the 48way STM32 board
|
||||
*
|
||||
* @author Ben Brazdziunas, 2022
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = Gpio::E15;
|
||||
engineConfiguration->injectionPins[1] = Gpio::E14;
|
||||
engineConfiguration->injectionPins[2] = Gpio::E13;
|
||||
engineConfiguration->injectionPins[3] = Gpio::E12;
|
||||
engineConfiguration->injectionPins[4] = Gpio::E11;
|
||||
engineConfiguration->injectionPins[5] = Gpio::E10;
|
||||
engineConfiguration->injectionPins[6] = Gpio::E9;
|
||||
engineConfiguration->injectionPins[7] = Gpio::E8;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = Gpio::D12;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::D13;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::B15;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::B14;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::D8;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::D9;
|
||||
engineConfiguration->ignitionPins[6] = Gpio::D11;
|
||||
engineConfiguration->ignitionPins[7] = Gpio::D10;
|
||||
}
|
||||
|
||||
static void setEtbConfig() {
|
||||
|
||||
}
|
||||
|
||||
static void setupVbatt() {
|
||||
// 5.6k high side/10k low side = 1.56 ratio divider
|
||||
engineConfiguration->analogInputDividerCoefficient = 1.56f;
|
||||
|
||||
// 6.34k high side/ 1k low side
|
||||
engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;
|
||||
|
||||
// Battery sense on PA7
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_0;
|
||||
|
||||
engineConfiguration->adcVcc = 3.3f;
|
||||
}
|
||||
|
||||
static void setStepperConfig() {
|
||||
engineConfiguration->idle.stepperDirectionPin = Gpio::C9;
|
||||
engineConfiguration->idle.stepperStepPin = Gpio::C8;
|
||||
engineConfiguration->stepperEnablePin = Gpio::A8;
|
||||
}
|
||||
|
||||
Gpio getRunningLedPin() {
|
||||
return Gpio::C10;
|
||||
}
|
||||
|
||||
void setBoardConfigOverrides() {
|
||||
setupVbatt();
|
||||
//setEtbConfig();
|
||||
setStepperConfig();
|
||||
|
||||
engineConfiguration->clt.config.bias_resistor = 2490;
|
||||
engineConfiguration->iat.config.bias_resistor = 2490;
|
||||
|
||||
//CAN 1 bus overwrites
|
||||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
engineConfiguration->canTxPin = Gpio::D1;
|
||||
|
||||
//CAN 2 bus overwrites
|
||||
engineConfiguration->can2RxPin = Gpio::B12;
|
||||
engineConfiguration->can2TxPin = Gpio::B13;
|
||||
}
|
||||
|
||||
void setBoardDefaultConfiguration(void) {
|
||||
setInjectorPins();
|
||||
setIgnitionPins();
|
||||
engineConfiguration->isSdCardEnabled = false;
|
||||
engineConfiguration->canBaudRate = B500KBPS;
|
||||
engineConfiguration->can2BaudRate = B500KBPS;
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
bash ../common_make.sh 48way ARCH_STM32F4
|
|
@ -1,40 +0,0 @@
|
|||
//DO NOT EDIT MANUALLY, let automation work hard.
|
||||
|
||||
// auto-generated by PinoutLogic.java based on config/boards/48way/connectors/main.yaml
|
||||
#include "pch.h"
|
||||
|
||||
// see comments at declaration in pin_repository.h
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
switch(brainPin) {
|
||||
case Gpio::A1: return "TPS Reference Input (A1)";
|
||||
case Gpio::B14: return "Ignition 4 Output (B14)";
|
||||
case Gpio::B15: return "Ignition 3 Output (B15)";
|
||||
case Gpio::C13: return "CrankShaft Input (C13)";
|
||||
case Gpio::C6: return "Idle1 Output (C6)";
|
||||
case Gpio::C7: return "Boost Controller Output (C7)";
|
||||
case Gpio::D10: return "Ignition 8 Output (D10)";
|
||||
case Gpio::D11: return "Ignition 7 Output (D11)";
|
||||
case Gpio::D12: return "Ignition 1 Output (D12)";
|
||||
case Gpio::D13: return "Ignition 2 Output (D13)";
|
||||
case Gpio::D14: return "HC2 Output (D14)";
|
||||
case Gpio::D15: return "HC1 Output (D15)";
|
||||
case Gpio::D8: return "Ignition 5 Output (D8)";
|
||||
case Gpio::D9: return "Ignition 6 Output (D9)";
|
||||
case Gpio::E1: return "Clutch Input (E1)";
|
||||
case Gpio::E10: return "Injector 6 Output (E10)";
|
||||
case Gpio::E11: return "Injector 5 Output (E11)";
|
||||
case Gpio::E12: return "Injector 4 Output (E12)";
|
||||
case Gpio::E13: return "Injector 3 Output (E13)";
|
||||
case Gpio::E14: return "Injector 2 Output (E14)";
|
||||
case Gpio::E15: return "Injector 1 Output (E15)";
|
||||
case Gpio::E2: return "Fan Relay (E2)";
|
||||
case Gpio::E3: return "Fuel Relay (E3)";
|
||||
case Gpio::E4: return "Launch Control (E4)";
|
||||
case Gpio::E5: return "Tachometer (E5)";
|
||||
case Gpio::E6: return "Camshaft Input (E6)";
|
||||
case Gpio::E8: return "Injector 8 Output (E8)";
|
||||
case Gpio::E9: return "Injector 7 Output (E9)";
|
||||
default: return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -1,112 +0,0 @@
|
|||
pins:
|
||||
- id: E2
|
||||
class: outputs
|
||||
ts_name: Fan Relay (E2)
|
||||
- id: E3
|
||||
class: outputs
|
||||
ts_name: Fuel Relay (E3)
|
||||
- id: E4
|
||||
class: switch_inputs
|
||||
ts_name: Launch Control (E4)
|
||||
- id: E5
|
||||
class: outputs
|
||||
ts_name: Tachometer (E5)
|
||||
- id: [E6, E6]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Camshaft Input (E6)
|
||||
- id: [C13, C13]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: CrankShaft Input (C13)
|
||||
- id: EFI_ADC_0
|
||||
class: analog_inputs
|
||||
ts_name: Battery Reference Input (A0)
|
||||
- id: [A1, EFI_ADC_1]
|
||||
class: [switch_inputs, analog_inputs]
|
||||
ts_name: TPS Reference Input (A1)
|
||||
- id: EFI_ADC_2
|
||||
class: analog_inputs
|
||||
ts_name: CLT Reference Input (A2)
|
||||
- id: EFI_ADC_3
|
||||
class: analog_inputs
|
||||
ts_name: IAT Reference Input (A3)
|
||||
- id: EFI_ADC_4
|
||||
class: analog_inputs
|
||||
ts_name: O2 Reference Input (A4)
|
||||
- id: EFI_ADC_14
|
||||
class: analog_inputs
|
||||
ts_name: Fuel Pressure Reference Input (C4)
|
||||
- id: EFI_ADC_15
|
||||
class: analog_inputs
|
||||
ts_name: Oil Pressure Reference Input (C5)
|
||||
- id: EFI_ADC_8
|
||||
class: analog_inputs
|
||||
ts_name: MAP Pressure Reference Input (B0)
|
||||
- id: EFI_ADC_9
|
||||
class: analog_inputs
|
||||
ts_name: BARO Pressure Reference Input (B1)
|
||||
- id: E8
|
||||
class: outputs
|
||||
ts_name: Injector 8 Output (E8)
|
||||
- id: E9
|
||||
class: outputs
|
||||
ts_name: Injector 7 Output (E9)
|
||||
- id: E10
|
||||
class: outputs
|
||||
ts_name: Injector 6 Output (E10)
|
||||
- id: E11
|
||||
class: outputs
|
||||
ts_name: Injector 5 Output (E11)
|
||||
- id: E12
|
||||
class: outputs
|
||||
ts_name: Injector 4 Output (E12)
|
||||
- id: E13
|
||||
class: outputs
|
||||
ts_name: Injector 3 Output (E13)
|
||||
- id: E14
|
||||
class: outputs
|
||||
ts_name: Injector 2 Output (E14)
|
||||
- id: E15
|
||||
class: outputs
|
||||
ts_name: Injector 1 Output (E15)
|
||||
- id: E1
|
||||
class: switch_inputs
|
||||
ts_name: Clutch Input (E1)
|
||||
- id: C7
|
||||
class: outputs
|
||||
ts_name: Boost Controller Output (C7)
|
||||
- id: C6
|
||||
class: outputs
|
||||
ts_name: Idle1 Output (C6)
|
||||
- id: D15
|
||||
class: outputs
|
||||
ts_name: HC1 Output (D15)
|
||||
- id: D14
|
||||
class: outputs
|
||||
ts_name: HC2 Output (D14)
|
||||
- id: D13
|
||||
class: outputs
|
||||
ts_name: Ignition 2 Output (D13)
|
||||
- id: D12
|
||||
class: outputs
|
||||
ts_name: Ignition 1 Output (D12)
|
||||
- id: D11
|
||||
class: outputs
|
||||
ts_name: Ignition 7 Output (D11)
|
||||
- id: D10
|
||||
class: outputs
|
||||
ts_name: Ignition 8 Output (D10)
|
||||
- id: D9
|
||||
class: outputs
|
||||
ts_name: Ignition 6 Output (D9)
|
||||
- id: D8
|
||||
class: outputs
|
||||
ts_name: Ignition 5 Output (D8)
|
||||
- id: B15
|
||||
class: outputs
|
||||
ts_name: Ignition 3 Output (B15)
|
||||
- id: B14
|
||||
class: outputs
|
||||
ts_name: Ignition 4 Output (B14)
|
||||
|
||||
info:
|
||||
directory: 48way
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
#define ts_show_software_knock true
|
||||
|
||||
#define show_test_presets true
|
||||
#define show_microRusEFI_presets false
|
||||
#define show_Frankenso_presets false
|
||||
#define show_Hellen_presets false
|
||||
#define show_Proteus_presets false
|
|
@ -1,2 +0,0 @@
|
|||
w folderze /firmware
|
||||
gen_config_board.sh BB_V2 BB_V2
|
|
@ -1,491 +0,0 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/board_io.c
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#define BOARD_NAME "BB_V2"
|
||||
|
||||
#ifndef BOARD_IO_H
|
||||
#define BOARD_IO_H
|
||||
|
||||
#define EFI_USB_AF 10U
|
||||
#define EFI_USB_SERIAL_DM Gpio::A11
|
||||
#define EFI_USB_SERIAL_DP Gpio::A12
|
||||
|
||||
#define EFI_USE_OSC TRUE
|
||||
|
||||
#define EFI_CAN_SUPPORT TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
|
||||
#undef EFI_FILE_LOGGING
|
||||
#define EFI_FILE_LOGGING TRUE
|
||||
|
||||
#undef EFI_SDC_DEVICE
|
||||
#define EFI_SDC_DEVICE SDCD1
|
||||
|
||||
#undef EFI_ICU_INPUTS
|
||||
#define EFI_ICU_INPUTS FALSE
|
||||
|
||||
#undef HAL_TRIGGER_USE_PAL
|
||||
#define HAL_TRIGGER_USE_PAL TRUE
|
||||
|
||||
#undef EFI_LOGIC_ANALYZER
|
||||
#define EFI_LOGIC_ANALYZER FALSE
|
||||
|
||||
#undef HAL_VSS_USE_PAL
|
||||
#define HAL_VSS_USE_PAL TRUE
|
||||
|
||||
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN Gpio::Unassigned
|
||||
#endif
|
||||
|
||||
// Ignore USB VBUS pin (we're never a host, only a device)
|
||||
#define BOARD_OTG_NOVBUSSENS TRUE
|
||||
|
||||
/*
|
||||
* Board oscillators-related settings.
|
||||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300U
|
||||
|
||||
|
||||
#define EFI_PIN_MODE_DEFAULT PIN_MODE_INPUT
|
||||
#ifndef EFI_DR_DEFAULT
|
||||
#define EFI_DR_DEFAULT PIN_PUPDR_PULLDOWN
|
||||
#endif
|
||||
|
||||
// See https://github.com/rusefi/rusefi/issues/397
|
||||
#define DEFAULT_GPIO_SPEED PIN_OSPEED_HIGH
|
||||
|
||||
|
||||
/*
|
||||
* 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))
|
||||
|
||||
#define VAL_GPIO_MODER_ALL_DEFAULT (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
|
||||
#define VAL_GPIO_OTYPER_ALL_DEFAULT (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_GPIO_OSPEEDR_ALL_DEFAULT (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_GPIO_ODR_ALL_DEFAULT 0
|
||||
|
||||
#define VAL_GPIO_PUPDR_ALL_DEFAULT (EFI_DR_DEFAULT(0) | \
|
||||
EFI_DR_DEFAULT(1) | \
|
||||
EFI_DR_DEFAULT(2) | \
|
||||
EFI_DR_DEFAULT(3) | \
|
||||
EFI_DR_DEFAULT(4) | \
|
||||
EFI_DR_DEFAULT(5) | \
|
||||
EFI_DR_DEFAULT(6) | \
|
||||
EFI_DR_DEFAULT(7) | \
|
||||
EFI_DR_DEFAULT(8) | \
|
||||
EFI_DR_DEFAULT(9) | \
|
||||
EFI_DR_DEFAULT(10) | \
|
||||
EFI_DR_DEFAULT(11) | \
|
||||
EFI_DR_DEFAULT(12) | \
|
||||
EFI_DR_DEFAULT(13) | \
|
||||
EFI_DR_DEFAULT(14) | \
|
||||
EFI_DR_DEFAULT(15))
|
||||
|
||||
#define VAL_GPIO_AF_ALL_DEFAULT (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_GPIOA_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
PIN_MODE_ALTERNATE(13) | \
|
||||
PIN_MODE_ALTERNATE(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
#define VAL_GPIOA_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOA_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_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, 6U) | \
|
||||
PIN_AFIO_AF(5, 5U) | \
|
||||
PIN_AFIO_AF(6, 5U) | \
|
||||
PIN_AFIO_AF(7, 5U))
|
||||
#define VAL_GPIOA_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOB setup:
|
||||
*/
|
||||
#define VAL_GPIOB_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
#define VAL_GPIOB_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOB_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOB_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOC setup:
|
||||
|
||||
* 8 BIT MODE
|
||||
* PC8 - MMC D0
|
||||
* PC9 - MMC D1
|
||||
* PC10 - MMC D2
|
||||
* PC11 - MMC D3
|
||||
* PC12 - CLK
|
||||
|
||||
* 1 BIT MODE
|
||||
* PC8 - MMC D0
|
||||
* PC12 - CLK
|
||||
|
||||
* NOW IS SETUP FOR 1 BIT SDIO
|
||||
*/
|
||||
#define VAL_GPIOC_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
PIN_MODE_ALTERNATE(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(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) | \
|
||||
PIN_OSPEED_HIGH( 8) | \
|
||||
DEFAULT_GPIO_SPEED( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
PIN_OSPEED_HIGH(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_PULLDOWN( 1) | \
|
||||
PIN_PUPDR_PULLDOWN( 2) | \
|
||||
PIN_PUPDR_PULLDOWN( 3) | \
|
||||
PIN_PUPDR_PULLDOWN( 4) | \
|
||||
PIN_PUPDR_PULLDOWN( 5) | \
|
||||
PIN_PUPDR_PULLDOWN( 6) | \
|
||||
PIN_PUPDR_PULLDOWN( 7) | \
|
||||
PIN_PUPDR_PULLDOWN( 8) | \
|
||||
PIN_PUPDR_PULLDOWN( 9) | \
|
||||
PIN_PUPDR_PULLDOWN(10) | \
|
||||
PIN_PUPDR_PULLDOWN(11) | \
|
||||
PIN_PUPDR_PULLDOWN(12) | \
|
||||
PIN_PUPDR_PULLDOWN(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLDOWN(15))
|
||||
#define VAL_GPIOC_ODR (PIN_ODR_HIGH(0) | \
|
||||
PIN_ODR_LOW(2) | \
|
||||
PIN_ODR_HIGH(3) | \
|
||||
PIN_ODR_HIGH(6) | \
|
||||
PIN_ODR_HIGH(7) | \
|
||||
PIN_ODR_HIGH(8) | \
|
||||
PIN_ODR_HIGH(9) | \
|
||||
PIN_ODR_HIGH(10) | \
|
||||
PIN_ODR_HIGH(11) | \
|
||||
PIN_ODR_HIGH(12) | \
|
||||
PIN_ODR_HIGH(14))
|
||||
#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, 12U) | \
|
||||
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, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOD setup:
|
||||
* PD2 - CMD
|
||||
*/
|
||||
|
||||
#define VAL_GPIOD_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
PIN_MODE_ALTERNATE(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(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) | \
|
||||
PIN_OSPEED_HIGH( 2) | \
|
||||
DEFAULT_GPIO_SPEED( 3) | \
|
||||
DEFAULT_GPIO_SPEED( 4) | \
|
||||
DEFAULT_GPIO_SPEED( 5) | \
|
||||
DEFAULT_GPIO_SPEED( 6) | \
|
||||
DEFAULT_GPIO_SPEED( 7) | \
|
||||
PIN_OSPEED_HIGH( 8) | \
|
||||
PIN_OSPEED_HIGH( 9) | \
|
||||
PIN_OSPEED_HIGH(10) | \
|
||||
PIN_OSPEED_HIGH(11) | \
|
||||
PIN_OSPEED_HIGH(12) | \
|
||||
DEFAULT_GPIO_SPEED(13) | \
|
||||
DEFAULT_GPIO_SPEED(14) | \
|
||||
DEFAULT_GPIO_SPEED(15))
|
||||
#define VAL_GPIOD_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_PULLDOWN( 1) | \
|
||||
PIN_PUPDR_PULLDOWN( 2) | \
|
||||
PIN_PUPDR_PULLDOWN( 3) | \
|
||||
PIN_PUPDR_PULLDOWN( 4) | \
|
||||
PIN_PUPDR_PULLDOWN( 5) | \
|
||||
PIN_PUPDR_PULLDOWN( 6) | \
|
||||
PIN_PUPDR_PULLDOWN( 7) | \
|
||||
PIN_PUPDR_PULLDOWN( 8) | \
|
||||
PIN_PUPDR_PULLDOWN( 9) | \
|
||||
PIN_PUPDR_PULLDOWN(10) | \
|
||||
PIN_PUPDR_PULLDOWN(11) | \
|
||||
PIN_PUPDR_PULLDOWN(12) | \
|
||||
PIN_PUPDR_PULLDOWN(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLDOWN(15))
|
||||
#define VAL_GPIOD_ODR (PIN_ODR_HIGH(0) | \
|
||||
PIN_ODR_HIGH(2) | \
|
||||
PIN_ODR_HIGH(3) | \
|
||||
PIN_ODR_HIGH(6) | \
|
||||
PIN_ODR_HIGH(7) | \
|
||||
PIN_ODR_HIGH(8) | \
|
||||
PIN_ODR_HIGH(9) | \
|
||||
PIN_ODR_HIGH(10) | \
|
||||
PIN_ODR_HIGH(11) | \
|
||||
PIN_ODR_HIGH(12) | \
|
||||
PIN_ODR_HIGH(14))
|
||||
#define VAL_GPIOD_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 12U) | \
|
||||
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_GPIOD_AFRH (PIN_AFIO_AF( 8, 12U) | \
|
||||
PIN_AFIO_AF( 9, 12U) | \
|
||||
PIN_AFIO_AF(10, 12U) | \
|
||||
PIN_AFIO_AF(11, 12U) | \
|
||||
PIN_AFIO_AF(12, 12U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOE setup:
|
||||
*/
|
||||
#define VAL_GPIOE_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOE_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOE_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOE_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOF setup:
|
||||
*/
|
||||
#define VAL_GPIOF_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOF_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOF_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOF_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOG setup:
|
||||
*/
|
||||
#define VAL_GPIOG_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOG_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOG_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOG_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOH setup:
|
||||
*/
|
||||
#define VAL_GPIOH_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOH_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOH_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOH_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOI setup:
|
||||
*/
|
||||
#define VAL_GPIOI_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOI_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOI_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOI_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
#endif /* BOARD_IO_H */
|
|
@ -1,16 +0,0 @@
|
|||
# List of all the board related files.
|
||||
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||
|
||||
# Override DEFAULT_ENGINE_TYPE
|
||||
DDEFS += -DSTM32F407xx
|
||||
DDEFS += -DSHORT_BOARD_NAME=BB_V2 -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||
DDEFS += -DFIRMWARE_ID=\"BB_V2\"
|
||||
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::Unassigned
|
||||
DDEFS += -DHAL_TRIGGER_USE_PAL=TRUE
|
||||
DDEFS += -DHAL_VSS_USE_PAL=TRUE
|
||||
|
||||
DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
|
||||
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE
|
||||
|
||||
# Hardware serial port on UART 2 -> PD5/PD6 LUB PC10/PC11
|
||||
EFI_CONSOLE_TTL_PINS = -DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::C10 -DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::C11
|
|
@ -1,131 +0,0 @@
|
|||
/**
|
||||
* @file boards/BB V2/board_configuration.cpp
|
||||
*
|
||||
* @brief Configuration defaults for the core8 board
|
||||
*
|
||||
* @author Turbo Marian, 2022
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = Gpio::D12;
|
||||
engineConfiguration->injectionPins[1] = Gpio::D13;
|
||||
engineConfiguration->injectionPins[2] = Gpio::D14;
|
||||
engineConfiguration->injectionPins[3] = Gpio::D15;
|
||||
engineConfiguration->injectionPins[4] = Gpio::E9;
|
||||
engineConfiguration->injectionPins[5] = Gpio::E11;
|
||||
engineConfiguration->injectionPins[6] = Gpio::E14;
|
||||
engineConfiguration->injectionPins[7] = Gpio::E13;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = Gpio::D7;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::B9;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::A8;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::D10;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::D9;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::D11;
|
||||
engineConfiguration->ignitionPins[6] = Gpio::D8;
|
||||
engineConfiguration->ignitionPins[7] = Gpio::E8;
|
||||
}
|
||||
|
||||
|
||||
void setSdCardConfigurationOverrides(void) {
|
||||
}
|
||||
|
||||
void setBoardConfigOverrides(void) {
|
||||
|
||||
// TLE9201 driver
|
||||
// This chip has three control pins:
|
||||
// DIR - sets direction of the motor
|
||||
// PWM - pwm control (enable high, coast low)
|
||||
// DIS - disables motor (enable low)
|
||||
|
||||
// Throttle #1
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = Gpio::B14;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::D5;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = Gpio::E4;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// Throttle #2
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[1].controlPin = Gpio::Unassigned;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[1].directionPin1 = Gpio::Unassigned;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[1].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// we only have pwm/dir, no dira/dirb
|
||||
engineConfiguration->etb_use_two_wires = false;
|
||||
}
|
||||
|
||||
void setPinConfigurationOverrides(void) {
|
||||
|
||||
//CAN 1 bus overwrites
|
||||
engineConfiguration->canTxPin = Gpio::D1;
|
||||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
|
||||
//CAN 2 bus overwrites
|
||||
engineConfiguration->can2RxPin = Gpio::Unassigned;
|
||||
engineConfiguration->can2TxPin = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
* See also setDefaultEngineConfiguration
|
||||
*
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
static void setupVbatt() {
|
||||
// 5.6k high side/10k low side = 1.56 ratio divider
|
||||
engineConfiguration->analogInputDividerCoefficient = 1.47f;
|
||||
|
||||
// 6.34k high side/1k low side = 9.2
|
||||
engineConfiguration->vbattDividerCoeff = (6.34f / 1.0f);
|
||||
|
||||
// Battery sense on PC5
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_15;
|
||||
|
||||
engineConfiguration->adcVcc = 3.3f;
|
||||
}
|
||||
|
||||
static void setupDefaultSensorInputs() {
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_14;
|
||||
setEgoSensor(ES_14Point7_Free);
|
||||
|
||||
engineConfiguration->clt.config.bias_resistor = 2490;
|
||||
engineConfiguration->iat.config.bias_resistor = 2490;
|
||||
|
||||
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->lps25BaroSensorScl = Gpio::Unassigned;
|
||||
engineConfiguration->lps25BaroSensorSda = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
void setBoardDefaultConfiguration(void) {
|
||||
setInjectorPins();
|
||||
setIgnitionPins();
|
||||
setupVbatt();
|
||||
|
||||
//engineConfiguration->sdCardPeriodMs = 50;
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
|
||||
|
||||
engineConfiguration->canWriteEnabled = true;
|
||||
engineConfiguration->canReadEnabled = true;
|
||||
engineConfiguration->canSleepPeriodMs = 50;
|
||||
|
||||
engineConfiguration->canBaudRate = B500KBPS;
|
||||
engineConfiguration->can2BaudRate = B500KBPS;
|
||||
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
make clean -j8 PROJECT_BOARD=BB_V2
|
||||
make -j8 PROJECT_BOARD=BB_V2 PROJECT_CPU=ARCH_STM32F4
|
||||
gen_config_board.sh BB_V2 BB_V2
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
//DO NOT EDIT MANUALLY, let automation work hard.
|
||||
|
||||
// auto-generated by PinoutLogic.java based on config\boards\BB_V2\connectors\main.yaml
|
||||
#include "pch.h"
|
||||
|
||||
// see comments at declaration in pin_repository.h
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
switch(brainPin) {
|
||||
case Gpio::A8: return "Ignition 3";
|
||||
case Gpio::B12: return "Low current output 1";
|
||||
case Gpio::B14: return "DBW_PWM";
|
||||
case Gpio::B9: return "Ignition 2";
|
||||
case Gpio::C13: return "Tacho output";
|
||||
case Gpio::C6: return "Boost controler";
|
||||
case Gpio::C7: return "Idle valve 1";
|
||||
case Gpio::D10: return "Ignition 4";
|
||||
case Gpio::D11: return "Ignition 6";
|
||||
case Gpio::D12: return "Injector 1";
|
||||
case Gpio::D13: return "Injector 2";
|
||||
case Gpio::D14: return "Injector 3";
|
||||
case Gpio::D15: return "Injector 4";
|
||||
case Gpio::D3: return "Low side output 1";
|
||||
case Gpio::D4: return "Digital input 1";
|
||||
case Gpio::D5: return "DBW_DIR";
|
||||
case Gpio::D6: return "Digital input 2";
|
||||
case Gpio::D7: return "Ignition 1";
|
||||
case Gpio::D8: return "Ignition 7";
|
||||
case Gpio::D9: return "Ignition 5";
|
||||
case Gpio::E0: return "Crankshaft Sensor";
|
||||
case Gpio::E1: return "Camshaft Sensor";
|
||||
case Gpio::E11: return "Injector 6";
|
||||
case Gpio::E12: return "VVT output";
|
||||
case Gpio::E13: return "Injector 8";
|
||||
case Gpio::E14: return "Injector 7";
|
||||
case Gpio::E3: return "Fuel pump output";
|
||||
case Gpio::E4: return "DBW_DIS";
|
||||
case Gpio::E6: return "Fan output";
|
||||
case Gpio::E8: return "Ignition 8";
|
||||
case Gpio::E9: return "Injector 5";
|
||||
default: return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -1,289 +0,0 @@
|
|||
pins:
|
||||
# Low side outputs
|
||||
- pin: 1
|
||||
id: D12
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 1
|
||||
|
||||
- pin: 2
|
||||
id: D13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 2
|
||||
|
||||
- pin: 3
|
||||
id: D14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 3
|
||||
|
||||
- pin: 4
|
||||
id: D15
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 4
|
||||
|
||||
- pin: 5
|
||||
id: E9
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 5
|
||||
|
||||
- pin: 6
|
||||
id: E11
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 6
|
||||
|
||||
- pin: 7
|
||||
id: E14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 7
|
||||
|
||||
- pin: 8
|
||||
id: E13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 8
|
||||
|
||||
# Low side
|
||||
|
||||
- pin: 9
|
||||
id: C6
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Boost controler
|
||||
|
||||
- pin: 10
|
||||
id: C7
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Idle valve 1
|
||||
|
||||
- pin: 11
|
||||
id: C13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Tacho output
|
||||
|
||||
- pin: 12
|
||||
id: D3
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 1
|
||||
|
||||
- pin: 13
|
||||
id: E12
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: VVT output
|
||||
|
||||
- pin: 14
|
||||
id: E6
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Fan output
|
||||
|
||||
- pin: 15
|
||||
id: E3
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Fuel pump output
|
||||
|
||||
- pin: 16
|
||||
id: B12
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low current output 1
|
||||
|
||||
- pin: 17
|
||||
id: D3
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 1
|
||||
|
||||
- pin: 18
|
||||
id: B14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_PWM
|
||||
|
||||
- pin: 19
|
||||
id: E4
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_DIS
|
||||
|
||||
- pin: 20
|
||||
id: D5
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_DIR
|
||||
|
||||
# High side
|
||||
|
||||
- pin: 21
|
||||
id: D7
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 1
|
||||
|
||||
- pin: 22
|
||||
id: B9
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 2
|
||||
|
||||
- pin: 23
|
||||
id: A8
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 3
|
||||
|
||||
- pin: 24
|
||||
id: D10
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 4
|
||||
|
||||
- pin: 25
|
||||
id: D9
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 5
|
||||
|
||||
- pin: 26
|
||||
id: D11
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 6
|
||||
|
||||
- pin: 27
|
||||
id: D8
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 7
|
||||
|
||||
- pin: 28
|
||||
id: E8
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 8
|
||||
|
||||
# SENSORS
|
||||
|
||||
- pin: 29
|
||||
id: EFI_ADC_15
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Battery reference voltage
|
||||
|
||||
- pin: 30
|
||||
id: EFI_ADC_0
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Fuel Pressure-spare analog input 1
|
||||
|
||||
- pin: 31
|
||||
id: EFI_ADC_1
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Oil pressure-spare analog input 2
|
||||
|
||||
- pin: 32
|
||||
id: EFI_ADC_10
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Iat sensor
|
||||
|
||||
- pin: 33
|
||||
id: EFI_ADC_11
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Tps sensor
|
||||
|
||||
- pin: 34
|
||||
id: EFI_ADC_12
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Map sensor
|
||||
|
||||
- pin: 35
|
||||
id: EFI_ADC_13
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Clt sensor
|
||||
|
||||
- pin: 36
|
||||
id: EFI_ADC_14
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: AFR sensor
|
||||
|
||||
- pin: 37
|
||||
id: EFI_ADC_9
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Baro sensor
|
||||
|
||||
- pin: 38
|
||||
id: [E1, E1]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Camshaft Sensor (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Camshaft Sensor
|
||||
|
||||
- pin: 39
|
||||
id: [E0, E0]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Crankshaft Sensor (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Crankshaft Sensor
|
||||
|
||||
- pin: 40
|
||||
id: [D4, D4]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: CLUTCH_IN
|
||||
type: hall
|
||||
ts_name: Digital input 1
|
||||
|
||||
- pin: 41
|
||||
id: [D6, D6]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: FLEX_IN
|
||||
type: hall
|
||||
ts_name: Digital input 2
|
||||
|
||||
info:
|
||||
directory: BB_V2
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* @file knock_config.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Knock is on ADC3
|
||||
#define KNOCK_ADC ADCD3
|
||||
|
||||
// knock 1 - pin PA2
|
||||
#define KNOCK_ADC_CH1 ADC_CHANNEL_IN2
|
||||
#define KNOCK_PIN_CH1 Gpio::A2
|
||||
|
||||
// knock 2 - pin PA3
|
||||
#define KNOCK_HAS_CH2 true
|
||||
#define KNOCK_ADC_CH2 ADC_CHANNEL_IN3
|
||||
#define KNOCK_PIN_CH2 Gpio::A3
|
||||
|
||||
// Sample rate & time - depends on the exact MCU
|
||||
#define KNOCK_SAMPLE_TIME ADC_SAMPLE_84
|
||||
#define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12)))
|
|
@ -1,4 +0,0 @@
|
|||
#define SIGNATURE_DATE 2022.04.24
|
||||
#define SIGNATURE_BOARD BB_V2
|
||||
// SIGNATURE_HASH is a built-in variable generated by ConfigDefinition.jar
|
||||
#define TS_SIGNATURE "rusEFI DAY58.BB.V2"
|
|
@ -1,19 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
call gen_config.bat
|
||||
call gen_config_board.bat
|
||||
call gen_config_common.sh
|
||||
call gen_config_default.sh
|
||||
call gen_default_everything.sh
|
||||
call gen_enum_to_string.bat
|
||||
call gen_live_documentation.bat
|
||||
call gen_output_channels.sh
|
||||
call gen_ptrace_enums.bat
|
||||
call gen_signature.sh
|
||||
call generate_docs.bat
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
w folderze /firmware
|
||||
gen_config_board.sh BB_V3 BB_V3
|
|
@ -1,492 +0,0 @@
|
|||
/**
|
||||
* @file boards/subaru_eg33/board_io.c
|
||||
*
|
||||
* @date Feb 06, 2021
|
||||
* @author Andrey Gusakov, 2021
|
||||
*/
|
||||
|
||||
#define BOARD_NAME "BB_V3"
|
||||
|
||||
#ifndef BOARD_IO_H
|
||||
#define BOARD_IO_H
|
||||
|
||||
#define EFI_USB_AF 10U
|
||||
#define EFI_USB_SERIAL_DM Gpio::A11
|
||||
#define EFI_USB_SERIAL_DP Gpio::A12
|
||||
|
||||
#define EFI_USE_OSC TRUE
|
||||
|
||||
#define EFI_CAN_SUPPORT TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
|
||||
#undef EFI_FILE_LOGGING
|
||||
#define EFI_FILE_LOGGING TRUE
|
||||
|
||||
#undef EFI_SDC_DEVICE
|
||||
#define EFI_SDC_DEVICE SDCD1
|
||||
|
||||
#undef EFI_ICU_INPUTS
|
||||
#define EFI_ICU_INPUTS FALSE
|
||||
|
||||
#undef HAL_TRIGGER_USE_PAL
|
||||
#define HAL_TRIGGER_USE_PAL TRUE
|
||||
|
||||
#undef EFI_LOGIC_ANALYZER
|
||||
#define EFI_LOGIC_ANALYZER FALSE
|
||||
|
||||
#undef HAL_VSS_USE_PAL
|
||||
#define HAL_VSS_USE_PAL TRUE
|
||||
|
||||
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN Gpio::Unassigned
|
||||
#endif
|
||||
|
||||
|
||||
// Ignore USB VBUS pin (we're never a host, only a device)
|
||||
#define BOARD_OTG_NOVBUSSENS TRUE
|
||||
|
||||
/*
|
||||
* Board oscillators-related settings.
|
||||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300U
|
||||
|
||||
|
||||
#define EFI_PIN_MODE_DEFAULT PIN_MODE_INPUT
|
||||
#ifndef EFI_DR_DEFAULT
|
||||
#define EFI_DR_DEFAULT PIN_PUPDR_PULLDOWN
|
||||
#endif
|
||||
|
||||
// See https://github.com/rusefi/rusefi/issues/397
|
||||
#define DEFAULT_GPIO_SPEED PIN_OSPEED_HIGH
|
||||
|
||||
|
||||
/*
|
||||
* 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))
|
||||
|
||||
#define VAL_GPIO_MODER_ALL_DEFAULT (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
|
||||
#define VAL_GPIO_OTYPER_ALL_DEFAULT (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_GPIO_OSPEEDR_ALL_DEFAULT (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_GPIO_ODR_ALL_DEFAULT 0
|
||||
|
||||
#define VAL_GPIO_PUPDR_ALL_DEFAULT (EFI_DR_DEFAULT(0) | \
|
||||
EFI_DR_DEFAULT(1) | \
|
||||
EFI_DR_DEFAULT(2) | \
|
||||
EFI_DR_DEFAULT(3) | \
|
||||
EFI_DR_DEFAULT(4) | \
|
||||
EFI_DR_DEFAULT(5) | \
|
||||
EFI_DR_DEFAULT(6) | \
|
||||
EFI_DR_DEFAULT(7) | \
|
||||
EFI_DR_DEFAULT(8) | \
|
||||
EFI_DR_DEFAULT(9) | \
|
||||
EFI_DR_DEFAULT(10) | \
|
||||
EFI_DR_DEFAULT(11) | \
|
||||
EFI_DR_DEFAULT(12) | \
|
||||
EFI_DR_DEFAULT(13) | \
|
||||
EFI_DR_DEFAULT(14) | \
|
||||
EFI_DR_DEFAULT(15))
|
||||
|
||||
#define VAL_GPIO_AF_ALL_DEFAULT (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_GPIOA_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
PIN_MODE_ALTERNATE(13) | \
|
||||
PIN_MODE_ALTERNATE(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
#define VAL_GPIOA_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOA_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_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, 6U) | \
|
||||
PIN_AFIO_AF(5, 5U) | \
|
||||
PIN_AFIO_AF(6, 5U) | \
|
||||
PIN_AFIO_AF(7, 5U))
|
||||
#define VAL_GPIOA_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOB setup:
|
||||
*/
|
||||
#define VAL_GPIOB_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
#define VAL_GPIOB_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOB_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOB_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOC setup:
|
||||
|
||||
* 8 BIT MODE
|
||||
* PC8 - MMC D0
|
||||
* PC9 - MMC D1
|
||||
* PC10 - MMC D2
|
||||
* PC11 - MMC D3
|
||||
* PC12 - CLK
|
||||
|
||||
* 1 BIT MODE
|
||||
* PC8 - MMC D0
|
||||
* PC12 - CLK
|
||||
|
||||
* NOW IS SETUP FOR 1 BIT SDIO
|
||||
*/
|
||||
#define VAL_GPIOC_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
PIN_MODE_ALTERNATE(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(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 (PIN_OSPEED_HIGH( 0) | \
|
||||
PIN_OSPEED_HIGH( 1) | \
|
||||
PIN_OSPEED_HIGH( 2) | \
|
||||
PIN_OSPEED_HIGH( 3) | \
|
||||
PIN_OSPEED_HIGH( 4) | \
|
||||
PIN_OSPEED_HIGH( 5) | \
|
||||
PIN_OSPEED_HIGH( 6) | \
|
||||
PIN_OSPEED_HIGH( 7) | \
|
||||
DEFAULT_GPIO_SPEED( 8) | \
|
||||
PIN_OSPEED_HIGH( 9) | \
|
||||
DEFAULT_GPIO_SPEED(10) | \
|
||||
DEFAULT_GPIO_SPEED(11) | \
|
||||
DEFAULT_GPIO_SPEED(12) | \
|
||||
PIN_OSPEED_HIGH(13) | \
|
||||
PIN_OSPEED_HIGH(14) | \
|
||||
PIN_OSPEED_HIGH(15))
|
||||
#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLDOWN( 0) | \
|
||||
PIN_PUPDR_PULLDOWN( 1) | \
|
||||
PIN_PUPDR_PULLDOWN( 2) | \
|
||||
PIN_PUPDR_PULLDOWN( 3) | \
|
||||
PIN_PUPDR_PULLDOWN( 4) | \
|
||||
PIN_PUPDR_PULLDOWN( 5) | \
|
||||
PIN_PUPDR_PULLDOWN( 6) | \
|
||||
PIN_PUPDR_PULLDOWN( 7) | \
|
||||
PIN_PUPDR_FLOATING( 8) | \
|
||||
PIN_PUPDR_PULLDOWN( 9) | \
|
||||
PIN_PUPDR_FLOATING(10) | \
|
||||
PIN_PUPDR_FLOATING(11) | \
|
||||
PIN_PUPDR_FLOATING(12) | \
|
||||
PIN_PUPDR_PULLDOWN(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLDOWN(15))
|
||||
#define VAL_GPIOC_ODR (PIN_ODR_LOW(0) | \
|
||||
PIN_ODR_LOW(2) | \
|
||||
PIN_ODR_LOW(3) | \
|
||||
PIN_ODR_LOW(6) | \
|
||||
PIN_ODR_LOW(7) | \
|
||||
PIN_ODR_LOW(8) | \
|
||||
PIN_ODR_LOW(9) | \
|
||||
PIN_ODR_LOW(10) | \
|
||||
PIN_ODR_LOW(11) | \
|
||||
PIN_ODR_LOW(12) | \
|
||||
PIN_ODR_LOW(14))
|
||||
#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, 12U) | \
|
||||
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, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOD setup:
|
||||
* PD2 - CMD
|
||||
*/
|
||||
|
||||
#define VAL_GPIOD_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
PIN_MODE_ALTERNATE(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(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 (PIN_OSPEED_HIGH( 0) | \
|
||||
PIN_OSPEED_HIGH( 1) | \
|
||||
PIN_OSPEED_HIGH( 2) | \
|
||||
PIN_OSPEED_HIGH( 3) | \
|
||||
PIN_OSPEED_HIGH( 4) | \
|
||||
PIN_OSPEED_HIGH( 5) | \
|
||||
PIN_OSPEED_HIGH( 6) | \
|
||||
PIN_OSPEED_HIGH( 7) | \
|
||||
PIN_OSPEED_HIGH( 8) | \
|
||||
PIN_OSPEED_HIGH( 9) | \
|
||||
PIN_OSPEED_HIGH(10) | \
|
||||
PIN_OSPEED_HIGH(11) | \
|
||||
PIN_OSPEED_HIGH(12) | \
|
||||
PIN_OSPEED_HIGH(13) | \
|
||||
PIN_OSPEED_HIGH(14) | \
|
||||
PIN_OSPEED_HIGH(15))
|
||||
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLDOWN( 0) | \
|
||||
PIN_PUPDR_PULLDOWN( 1) | \
|
||||
PIN_PUPDR_FLOATING( 2) | \
|
||||
PIN_PUPDR_PULLDOWN( 3) | \
|
||||
PIN_PUPDR_PULLDOWN( 4) | \
|
||||
PIN_PUPDR_PULLDOWN( 5) | \
|
||||
PIN_PUPDR_PULLDOWN( 6) | \
|
||||
PIN_PUPDR_PULLDOWN( 7) | \
|
||||
PIN_PUPDR_PULLDOWN( 8) | \
|
||||
PIN_PUPDR_PULLDOWN( 9) | \
|
||||
PIN_PUPDR_PULLDOWN(10) | \
|
||||
PIN_PUPDR_PULLDOWN(11) | \
|
||||
PIN_PUPDR_PULLDOWN(12) | \
|
||||
PIN_PUPDR_PULLDOWN(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLDOWN(15))
|
||||
#define VAL_GPIOD_ODR (PIN_ODR_LOW(0) | \
|
||||
PIN_ODR_LOW(2) | \
|
||||
PIN_ODR_LOW(3) | \
|
||||
PIN_ODR_LOW(6) | \
|
||||
PIN_ODR_LOW(7) | \
|
||||
PIN_ODR_LOW(8) | \
|
||||
PIN_ODR_LOW(9) | \
|
||||
PIN_ODR_LOW(10) | \
|
||||
PIN_ODR_LOW(11) | \
|
||||
PIN_ODR_LOW(12) | \
|
||||
PIN_ODR_LOW(14))
|
||||
#define VAL_GPIOD_AFRL (PIN_AFIO_AF( 0, 0U) | \
|
||||
PIN_AFIO_AF( 1, 0U) | \
|
||||
PIN_AFIO_AF( 2, 12U) | \
|
||||
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_GPIOD_AFRH (PIN_AFIO_AF( 8, 12U) | \
|
||||
PIN_AFIO_AF( 9, 12U) | \
|
||||
PIN_AFIO_AF(10, 12U) | \
|
||||
PIN_AFIO_AF(11, 12U) | \
|
||||
PIN_AFIO_AF(12, 12U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOE setup:
|
||||
*/
|
||||
#define VAL_GPIOE_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOE_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOE_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOE_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOF setup:
|
||||
*/
|
||||
#define VAL_GPIOF_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOF_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOF_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOF_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOG setup:
|
||||
*/
|
||||
#define VAL_GPIOG_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOG_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOG_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOG_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOH setup:
|
||||
*/
|
||||
#define VAL_GPIOH_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOH_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOH_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOH_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOI setup:
|
||||
*/
|
||||
#define VAL_GPIOI_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOI_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOI_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOI_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
#endif /* BOARD_IO_H */
|
|
@ -1,16 +0,0 @@
|
|||
# List of all the board related files.
|
||||
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||
|
||||
# Override DEFAULT_ENGINE_TYPE
|
||||
DDEFS += -DSTM32F407xx
|
||||
DDEFS += -DSHORT_BOARD_NAME=BB_V3 -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||
DDEFS += -DFIRMWARE_ID=\"BB_V3\"
|
||||
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::Unassigned
|
||||
DDEFS += -DHAL_TRIGGER_USE_PAL=TRUE
|
||||
DDEFS += -DHAL_VSS_USE_PAL=TRUE
|
||||
|
||||
DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
|
||||
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE
|
||||
|
||||
# Hardware serial port on UART 2 -> PD5/PD6 LUB PC10/PC11
|
||||
EFI_CONSOLE_TTL_PINS = -DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::C10 -DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::C11
|
|
@ -1,131 +0,0 @@
|
|||
/**
|
||||
* @file boards/BB V3/board_configuration.cpp
|
||||
*
|
||||
* @brief Configuration defaults for the core8 board
|
||||
*
|
||||
* @author Turbo Marian, 2022
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = Gpio::E5;
|
||||
engineConfiguration->injectionPins[1] = Gpio::E6;
|
||||
engineConfiguration->injectionPins[2] = Gpio::E0;
|
||||
engineConfiguration->injectionPins[3] = Gpio::C13;
|
||||
engineConfiguration->injectionPins[4] = Gpio::E1;
|
||||
engineConfiguration->injectionPins[5] = Gpio::A15;
|
||||
engineConfiguration->injectionPins[6] = Gpio::A7;
|
||||
engineConfiguration->injectionPins[7] = Gpio::B8;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = Gpio::B9;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::B6;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::B7;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::B3;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::B5;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::D1;
|
||||
engineConfiguration->ignitionPins[6] = Gpio::D4;
|
||||
engineConfiguration->ignitionPins[7] = Gpio::D7;
|
||||
}
|
||||
|
||||
|
||||
void setSdCardConfigurationOverrides(void) {
|
||||
}
|
||||
|
||||
void setBoardConfigOverrides(void) {
|
||||
|
||||
// TLE9201 driver
|
||||
// This chip has three control pins:
|
||||
// DIR - sets direction of the motor
|
||||
// PWM - pwm control (enable high, coast low)
|
||||
// DIS - disables motor (enable low)
|
||||
|
||||
// Throttle #1
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = Gpio::B14;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::D0;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = Gpio::D3;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// Throttle #2
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[1].controlPin = Gpio::Unassigned;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[1].directionPin1 = Gpio::Unassigned;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[1].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// we only have pwm/dir, no dira/dirb
|
||||
engineConfiguration->etb_use_two_wires = false;
|
||||
}
|
||||
|
||||
void setPinConfigurationOverrides(void) {
|
||||
|
||||
//CAN 1 bus overwrites
|
||||
engineConfiguration->canTxPin = Gpio::B13;
|
||||
engineConfiguration->canRxPin = Gpio::B12;
|
||||
|
||||
//CAN 2 bus overwrites
|
||||
engineConfiguration->can2RxPin = Gpio::Unassigned;
|
||||
engineConfiguration->can2TxPin = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
* See also setDefaultEngineConfiguration
|
||||
*
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
static void setupVbatt() {
|
||||
// 5.6k high side/10k low side = 1.56 ratio divider
|
||||
engineConfiguration->analogInputDividerCoefficient = 1.47f;
|
||||
|
||||
// 6.34k high side/1k low side = 9.2
|
||||
engineConfiguration->vbattDividerCoeff = (6.34f / 1.0f);
|
||||
|
||||
// Battery sense on PC5
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_15;
|
||||
|
||||
engineConfiguration->adcVcc = 3.3f;
|
||||
}
|
||||
|
||||
static void setupDefaultSensorInputs() {
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_14;
|
||||
setEgoSensor(ES_14Point7_Free);
|
||||
|
||||
engineConfiguration->clt.config.bias_resistor = 2490;
|
||||
engineConfiguration->iat.config.bias_resistor = 2490;
|
||||
|
||||
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->lps25BaroSensorScl = Gpio::Unassigned;
|
||||
engineConfiguration->lps25BaroSensorSda = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
void setBoardDefaultConfiguration(void) {
|
||||
setInjectorPins();
|
||||
setIgnitionPins();
|
||||
setupVbatt();
|
||||
|
||||
//engineConfiguration->sdCardPeriodMs = 50;
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
|
||||
|
||||
engineConfiguration->canWriteEnabled = true;
|
||||
engineConfiguration->canReadEnabled = true;
|
||||
engineConfiguration->canSleepPeriodMs = 50;
|
||||
|
||||
engineConfiguration->canBaudRate = B500KBPS;
|
||||
engineConfiguration->can2BaudRate = B500KBPS;
|
||||
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
make clean -j8 PROJECT_BOARD=BB_V3
|
||||
make -j8 PROJECT_BOARD=BB_V3 PROJECT_CPU=ARCH_STM32F4
|
||||
gen_config_board.sh BB_V3 BB_V3
|
||||
|
||||
pause
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
gen_config_board.sh BB_V3 BB_V3
|
||||
|
||||
pause
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
//DO NOT EDIT MANUALLY, let automation work hard.
|
||||
|
||||
// auto-generated by PinoutLogic.java based on config\boards\BB_V3\connectors\main.yaml
|
||||
#include "pch.h"
|
||||
|
||||
// see comments at declaration in pin_repository.h
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
switch(brainPin) {
|
||||
case Gpio::A10: return "Camshaft Sensor";
|
||||
case Gpio::A15: return "Injector 6";
|
||||
case Gpio::A7: return "Injector 7";
|
||||
case Gpio::A8: return "VSS";
|
||||
case Gpio::A9: return "Crankshaft Sensor";
|
||||
case Gpio::B14: return "DBW_PWM";
|
||||
case Gpio::B3: return "Ignition 4";
|
||||
case Gpio::B5: return "Ignition 5";
|
||||
case Gpio::B6: return "Ignition 2";
|
||||
case Gpio::B7: return "Ignition 3";
|
||||
case Gpio::B8: return "Injector 8";
|
||||
case Gpio::B9: return "Ignition 1";
|
||||
case Gpio::C13: return "Injector 4";
|
||||
case Gpio::D0: return "DBW_DIR";
|
||||
case Gpio::D1: return "Ignition 6";
|
||||
case Gpio::D10: return "Digital input 2";
|
||||
case Gpio::D3: return "DBW_DIS";
|
||||
case Gpio::D4: return "Ignition 7";
|
||||
case Gpio::D7: return "Ignition 8";
|
||||
case Gpio::D8: return "Digital input 1";
|
||||
case Gpio::E0: return "Injector 3";
|
||||
case Gpio::E1: return "Injector 5";
|
||||
case Gpio::E10: return "Low side output 2";
|
||||
case Gpio::E11: return "Low side output 1";
|
||||
case Gpio::E12: return "Tacho output";
|
||||
case Gpio::E13: return "Low side output 3";
|
||||
case Gpio::E14: return "Fan output";
|
||||
case Gpio::E15: return "Fuel pump output";
|
||||
case Gpio::E5: return "Injector 1";
|
||||
case Gpio::E6: return "Injector 2";
|
||||
case Gpio::E8: return "Boost controler";
|
||||
case Gpio::E9: return "Idle valve 1";
|
||||
default: return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -1,302 +0,0 @@
|
|||
pins:
|
||||
# Low side outputs
|
||||
- pin: 1
|
||||
id: E5
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 1
|
||||
|
||||
- pin: 2
|
||||
id: E6
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 2
|
||||
|
||||
- pin: 3
|
||||
id: E0
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 3
|
||||
|
||||
- pin: 4
|
||||
id: C13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 4
|
||||
|
||||
- pin: 5
|
||||
id: E1
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 5
|
||||
|
||||
- pin: 6
|
||||
id: A15
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 6
|
||||
|
||||
- pin: 7
|
||||
id: A7
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 7
|
||||
|
||||
- pin: 8
|
||||
id: B8
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 8
|
||||
|
||||
# Low side
|
||||
|
||||
- pin: 9
|
||||
id: E8
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Boost controler
|
||||
|
||||
- pin: 10
|
||||
id: E9
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Idle valve 1
|
||||
|
||||
- pin: 11
|
||||
id: E12
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Tacho output
|
||||
|
||||
- pin: 12
|
||||
id: E11
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 1
|
||||
|
||||
- pin: 13
|
||||
id: E10
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 2
|
||||
|
||||
- pin: 14
|
||||
id: E13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 3
|
||||
|
||||
|
||||
- pin: 15
|
||||
id: E14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Fan output
|
||||
|
||||
- pin: 16
|
||||
id: E15
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Fuel pump output
|
||||
|
||||
- pin: 17
|
||||
id: B14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_PWM
|
||||
|
||||
- pin: 18
|
||||
id: D3
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_DIS
|
||||
|
||||
- pin: 19
|
||||
id: D0
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_DIR
|
||||
|
||||
# High side
|
||||
|
||||
- pin: 20
|
||||
id: B9
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 1
|
||||
|
||||
- pin: 21
|
||||
id: B6
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 2
|
||||
|
||||
- pin: 22
|
||||
id: B7
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 3
|
||||
|
||||
- pin: 23
|
||||
id: B3
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 4
|
||||
|
||||
- pin: 24
|
||||
id: B5
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 5
|
||||
|
||||
- pin: 25
|
||||
id: D1
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 6
|
||||
|
||||
- pin: 26
|
||||
id: D4
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 7
|
||||
|
||||
- pin: 27
|
||||
id: D7
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 8
|
||||
|
||||
# SENSORS
|
||||
|
||||
- pin: 28
|
||||
id: EFI_ADC_15
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Battery reference voltage
|
||||
|
||||
- pin: 29
|
||||
id: EFI_ADC_0
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Fuel Pressure-spare analog input 1
|
||||
|
||||
- pin: 30
|
||||
id: EFI_ADC_1
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Oil pressure-spare analog input 2
|
||||
|
||||
- pin: 31
|
||||
id: EFI_ADC_10
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Iat sensor
|
||||
|
||||
- pin: 32
|
||||
id: EFI_ADC_11
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Tps sensor
|
||||
|
||||
- pin: 33
|
||||
id: EFI_ADC_12
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Map sensor
|
||||
|
||||
- pin: 34
|
||||
id: EFI_ADC_13
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Clt sensor
|
||||
|
||||
- pin: 35
|
||||
id: EFI_ADC_4
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Analog sensor 1
|
||||
|
||||
- pin: 36
|
||||
id: EFI_ADC_5
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Analog sensor 2
|
||||
|
||||
- pin: 37
|
||||
id: EFI_ADC_6
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Analog sensor 3
|
||||
|
||||
- pin: 38
|
||||
id: EFI_ADC_14
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: AFR sensor
|
||||
|
||||
- pin: 39
|
||||
id: [A10, A10]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Camshaft Sensor (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Camshaft Sensor
|
||||
|
||||
- pin: 40
|
||||
id: [A9, A9]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Crankshaft Sensor (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Crankshaft Sensor
|
||||
|
||||
- pin: 41
|
||||
id: [A8, A8]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: VSS (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: VSS
|
||||
|
||||
- pin: 42
|
||||
id: [D8, D8]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: CLUTCH_IN
|
||||
type: hall
|
||||
ts_name: Digital input 1
|
||||
|
||||
- pin: 43
|
||||
id: [D10, D10]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: FLEX_IN
|
||||
type: hall
|
||||
ts_name: Digital input 2
|
||||
|
||||
info:
|
||||
directory: BB_V3
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* @file knock_config.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Knock is on ADC3
|
||||
#define KNOCK_ADC ADCD3
|
||||
|
||||
// knock 1 - pin PA2
|
||||
#define KNOCK_ADC_CH1 ADC_CHANNEL_IN2
|
||||
#define KNOCK_PIN_CH1 Gpio::A2
|
||||
|
||||
// knock 2 - pin PA3
|
||||
#define KNOCK_HAS_CH2 true
|
||||
#define KNOCK_ADC_CH2 ADC_CHANNEL_IN3
|
||||
#define KNOCK_PIN_CH2 Gpio::A3
|
||||
|
||||
// Sample rate & time - depends on the exact MCU
|
||||
#define KNOCK_SAMPLE_TIME ADC_SAMPLE_84
|
||||
#define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12)))
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
#define ts_show_software_knock true
|
||||
|
||||
#define show_test_presets true
|
||||
#define show_microRusEFI_presets false
|
||||
#define show_Frankenso_presets false
|
||||
#define show_Hellen_presets false
|
||||
#define show_Proteus_presets false
|
|
@ -1,4 +0,0 @@
|
|||
#define SIGNATURE_DATE 2022.06.06
|
||||
#define SIGNATURE_BOARD BB_V3
|
||||
// SIGNATURE_HASH is a built-in variable generated by ConfigDefinition.jar
|
||||
#define TS_SIGNATURE "rusEFI DAY98.BB.V3"
|
|
@ -17,7 +17,7 @@ make -j6 -r PROJECT_BOARD=$PROJECT_BOARD PROJECT_CPU=$PROJECT_CPU
|
|||
if [ "$USE_OPENBLT" = "yes" ]; then
|
||||
# TODO: why is this rm necessary?
|
||||
rm -f pch/pch.h.gch/*
|
||||
cd bootloader; make -f src/Makefile PROJECT_BOARD=$PROJECT_BOARD PROJECT_CPU=$PROJECT_CPU -j12; cd ..
|
||||
cd bootloader; make PROJECT_BOARD=$PROJECT_BOARD PROJECT_CPU=$PROJECT_CPU -j12; cd ..
|
||||
[ -e bootloader/blbuild/fome_bl.hex ] || { echo "FAILED to compile OpenBLT by $SCRIPT_NAME with $PROJECT_BOARD"; exit 1; }
|
||||
fi
|
||||
|
||||
|
@ -31,8 +31,25 @@ chmod u+x $HEX2DFU
|
|||
mkdir -p deliver
|
||||
rm -f deliver/*
|
||||
|
||||
echo "$SCRIPT_NAME: invoking hex2dfu for incremental rusEFI image"
|
||||
$HEX2DFU -i build/fome.hex -C 0x1C -o build/fome.dfu
|
||||
# delete everything we're going to regenerate
|
||||
rm build/fome.bin build/fome.srec
|
||||
|
||||
# Extract the firmware's base address from the elf - it may be different depending on exact CPU
|
||||
firmwareBaseAddress="$(objdump -h -j .vectors build/fome.elf | awk '/.vectors/ {print $5 }')"
|
||||
checksumAddress="$(printf "%X\n" $((0x$firmwareBaseAddress+0x1c)))"
|
||||
|
||||
echo "Base address is 0x$firmwareBaseAddress"
|
||||
echo "Checksum address is 0x$checksumAddress"
|
||||
|
||||
echo "$SCRIPT_NAME: invoking hex2dfu to place image checksum"
|
||||
$HEX2DFU -i build/fome.hex -c $checksumAddress -b build/fome.bin
|
||||
rm build/fome.hex
|
||||
# re-make hex, srec with the checksum in place
|
||||
objcopy -I binary -O ihex --change-addresses=0x$firmwareBaseAddress build/fome.bin build/fome.hex
|
||||
objcopy -I binary -O srec --change-addresses=0x$firmwareBaseAddress build/fome.bin build/fome.srec
|
||||
|
||||
# make DFU
|
||||
$HEX2DFU -i build/fome.hex -o build/fome.dfu
|
||||
|
||||
if [ "$USE_OPENBLT" = "yes" ]; then
|
||||
# this image is suitable for update through bootloader only
|
||||
|
@ -45,9 +62,8 @@ else
|
|||
# cp build/fome.hex deliver/
|
||||
fi
|
||||
|
||||
# bootloader and composite image
|
||||
# bootloader and combined image
|
||||
if [ "$USE_OPENBLT" = "yes" ]; then
|
||||
rm -f deliver/fome_bl.dfu
|
||||
echo "$SCRIPT_NAME: invoking hex2dfu for OpenBLT"
|
||||
$HEX2DFU -i bootloader/blbuild/fome_bl.hex -o bootloader/blbuild/fome_bl.dfu
|
||||
|
||||
|
@ -56,10 +72,8 @@ if [ "$USE_OPENBLT" = "yes" ]; then
|
|||
cp bootloader/blbuild/fome_bl.dfu deliver/fome_bl.dfu
|
||||
#cp bootloader/blbuild/fome_bl.hex deliver/fome_bl.hex
|
||||
|
||||
rm -f deliver/fome_openblt.dfu
|
||||
echo "$SCRIPT_NAME: invoking hex2dfu for composite rusEFI+OpenBLT image"
|
||||
$HEX2DFU -i bootloader/blbuild/fome_bl.hex -i build/fome.hex -C 0x1C -o deliver/fome.dfu -b deliver/fome.bin
|
||||
#todo: how to create 'signed' hex and srec? Do we need?
|
||||
echo "$SCRIPT_NAME: invoking hex2dfu for combined OpenBLT+FOME image"
|
||||
$HEX2DFU -i bootloader/blbuild/fome_bl.hex -i build/fome.hex -o deliver/fome.dfu -b deliver/fome.bin
|
||||
fi
|
||||
|
||||
echo "$SCRIPT_NAME: build folder content:"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
5
firmware/config/boards/48way/board.mk → firmware/config/boards/core48/board.mk
Executable file → Normal file
5
firmware/config/boards/48way/board.mk → firmware/config/boards/core48/board.mk
Executable file → Normal file
|
@ -2,6 +2,7 @@
|
|||
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||
|
||||
# Override DEFAULT_ENGINE_TYPE
|
||||
DDEFS += -DSHORT_BOARD_NAME=48way
|
||||
DDEFS += -DFIRMWARE_ID=\"48way\"
|
||||
DDEFS += -DSHORT_BOARD_NAME=core48
|
||||
DDEFS += -DFIRMWARE_ID=\"core48\"
|
||||
DDEFS += -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE
|
|
@ -0,0 +1,196 @@
|
|||
/**
|
||||
* @file boards/core48/board_configuration.cpp
|
||||
*
|
||||
* @brief Configuration defaults for the core48 board
|
||||
*
|
||||
* @author Ben Brazdziunas, 2022
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPinMode = OM_DEFAULT;
|
||||
|
||||
engineConfiguration->injectionPins[0] = Gpio::D6;
|
||||
engineConfiguration->injectionPins[1] = Gpio::D7;
|
||||
engineConfiguration->injectionPins[2] = Gpio::D8;
|
||||
engineConfiguration->injectionPins[3] = Gpio::D9;
|
||||
engineConfiguration->injectionPins[4] = Gpio::D10;
|
||||
engineConfiguration->injectionPins[5] = Gpio::D11;
|
||||
engineConfiguration->injectionPins[6] = Gpio::D12;
|
||||
engineConfiguration->injectionPins[7] = Gpio::D13;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPinMode = OM_DEFAULT;
|
||||
|
||||
engineConfiguration->ignitionPins[0] = Gpio::E15;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::E14;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::E13;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::E12;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::E11;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::E10;
|
||||
engineConfiguration->ignitionPins[6] = Gpio::G8;
|
||||
engineConfiguration->ignitionPins[7] = Gpio::G15;
|
||||
}
|
||||
|
||||
|
||||
// PE3 is error LED, configured in board.mk
|
||||
Gpio getCommsLedPin() {
|
||||
return Gpio::G13;
|
||||
}
|
||||
|
||||
Gpio getRunningLedPin() {
|
||||
return Gpio::G10;
|
||||
}
|
||||
|
||||
Gpio getWarningLedPin() {
|
||||
return Gpio::G11;
|
||||
}
|
||||
|
||||
static void setEtbConfig() {
|
||||
// TLE9201 driver
|
||||
// This chip has three control pins:
|
||||
// DIR - sets direction of the motor
|
||||
// PWM - pwm control (enable high, coast low)
|
||||
// DIS - disables motor (enable low)
|
||||
|
||||
// Throttle #1
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = Gpio::B8;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::B9;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = Gpio::B7;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// Throttle #2
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[1].controlPin = Gpio::Unassigned;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[1].directionPin1 = Gpio::Unassigned;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[1].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// we only have pwm/dir, no dira/dirb
|
||||
engineConfiguration->etb_use_two_wires = false;
|
||||
}
|
||||
|
||||
static void
|
||||
setupVbatt() {
|
||||
// 5.6k high side/10k low side = 1.56 ratio divider
|
||||
engineConfiguration->analogInputDividerCoefficient = 1.56f;
|
||||
|
||||
// 6.34k high side/ 1k low side
|
||||
engineConfiguration->vbattDividerCoeff = (6.34 + 1) / 1;
|
||||
|
||||
// Battery sense on PA7
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_9;
|
||||
|
||||
engineConfiguration->adcVcc = 3.3f;
|
||||
}
|
||||
|
||||
static void setStepperConfig() {
|
||||
engineConfiguration->idle.stepperDirectionPin = Gpio::A8;
|
||||
engineConfiguration->idle.stepperStepPin = Gpio::C6;
|
||||
engineConfiguration->stepperEnablePin = Gpio::C7;
|
||||
}
|
||||
|
||||
static void setupSdCard() {
|
||||
|
||||
//SD CARD overwrites
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
||||
|
||||
engineConfiguration->is_enabled_spi_3 = true;
|
||||
engineConfiguration->spi3sckPin = Gpio::C10;
|
||||
engineConfiguration->spi3misoPin = Gpio::C11;
|
||||
engineConfiguration->spi3mosiPin = Gpio::C12;
|
||||
}
|
||||
|
||||
static void setupEGT() {
|
||||
|
||||
//EGT overwrites
|
||||
|
||||
engineConfiguration->spi2sckPin = Gpio::B13;
|
||||
engineConfiguration->spi2misoPin = Gpio::B14;
|
||||
engineConfiguration->spi2mosiPin = Gpio::B15;
|
||||
engineConfiguration->is_enabled_spi_2 = true;
|
||||
|
||||
engineConfiguration->max31855spiDevice = SPI_DEVICE_2;
|
||||
engineConfiguration->max31855_cs[0] = Gpio::C8;
|
||||
engineConfiguration->max31855_cs[1] = Gpio::C9;
|
||||
}
|
||||
|
||||
|
||||
void setBoardConfigOverrides() {
|
||||
setupVbatt();
|
||||
setupSdCard();
|
||||
setEtbConfig();
|
||||
setStepperConfig();
|
||||
setupEGT();
|
||||
|
||||
engineConfiguration->clt.config.bias_resistor = 2490;
|
||||
engineConfiguration->iat.config.bias_resistor = 2490;
|
||||
|
||||
//SERIAL
|
||||
engineConfiguration->binarySerialTxPin = Gpio::A9;
|
||||
engineConfiguration->binarySerialRxPin = Gpio::A10;
|
||||
engineConfiguration->tunerStudioSerialSpeed = SERIAL_SPEED;
|
||||
engineConfiguration->uartConsoleSerialSpeed = SERIAL_SPEED;
|
||||
|
||||
|
||||
|
||||
//CAN 1 bus overwrites
|
||||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
engineConfiguration->canTxPin = Gpio::D1;
|
||||
|
||||
//CAN 2 bus overwrites
|
||||
engineConfiguration->can2RxPin = Gpio::B5;
|
||||
engineConfiguration->can2TxPin = Gpio::B6;
|
||||
|
||||
//onboard lps22 barometer
|
||||
engineConfiguration->lps25BaroSensorScl = Gpio::B10;
|
||||
engineConfiguration->lps25BaroSensorSda = Gpio::B11;
|
||||
}
|
||||
|
||||
static void setupDefaultSensorInputs() {
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_13; //PC3
|
||||
engineConfiguration->afr.hwChannel2 = EFI_ADC_0; //PA0
|
||||
setEgoSensor(ES_14Point7_Free);
|
||||
|
||||
engineConfiguration->map.sensor.hwChannel = EFI_ADC_2; //PB0
|
||||
engineConfiguration->map.sensor.type = MT_MPXH6400;
|
||||
|
||||
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void setBoardDefaultConfiguration(void) {
|
||||
setInjectorPins();
|
||||
setIgnitionPins();
|
||||
setupDefaultSensorInputs();
|
||||
|
||||
|
||||
engineConfiguration->canWriteEnabled = true;
|
||||
engineConfiguration->canReadEnabled = true;
|
||||
engineConfiguration->canSleepPeriodMs = 50;
|
||||
|
||||
engineConfiguration->canBaudRate = B500KBPS;
|
||||
engineConfiguration->can2BaudRate = B500KBPS;
|
||||
|
||||
//ECU has two SD cards one fixed ine removable
|
||||
engineConfiguration->sdCardCsPin = Gpio::B3;
|
||||
|
||||
strncpy(config->luaScript, R"(
|
||||
|
||||
function onTick()
|
||||
|
||||
end
|
||||
|
||||
)", efi::size(config->luaScript));
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
@echo off
|
||||
|
||||
bash.exe compile_core48.sh
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
bash ../common_make.sh core48 ARCH_STM32F4
|
|
@ -0,0 +1,251 @@
|
|||
pins:
|
||||
- pin: A1
|
||||
function: FUEL PUMP
|
||||
type: out_low
|
||||
ts_name: Low Side 12 (G3)
|
||||
pin_name: PG3
|
||||
|
||||
- pin: A2
|
||||
function: FAN RELAY
|
||||
type: out_low
|
||||
ts_name: Low Side 13 (G4)
|
||||
pin_name: PG4
|
||||
|
||||
- pin: A3
|
||||
function: BOOST
|
||||
type: out_low
|
||||
ts_name: Low Side 14 (G5)
|
||||
pin_name: PG5
|
||||
|
||||
- pin: A4
|
||||
function: IDLE
|
||||
type: out_low
|
||||
ts_name: Low Side 15 (G6)
|
||||
pin_name: PG6
|
||||
|
||||
- pin: A5
|
||||
function: LSU HEATER-
|
||||
alternative1: LSU 4.9 CONNECTOR PIN 3
|
||||
alternative2: WHITE WIRE
|
||||
type: lsu_heater-
|
||||
|
||||
- pin: A6
|
||||
function: LSU IA
|
||||
alternative1: LSU 4.9 CONNECTOR PIN 5
|
||||
alternative2: GREEN WIRE
|
||||
type: lsu_ia
|
||||
|
||||
- pin: A7
|
||||
function: LSU VGND
|
||||
alternative1: LSU 4.9 CONNECTOR PIN 2
|
||||
alternative2: YELLOW WIRE
|
||||
type: lsu_vgnd
|
||||
|
||||
- pin: A8
|
||||
function: LSU HEATER+
|
||||
alternative1: LSU 4.9 CONNECTOR PIN 4
|
||||
alternative2: GREY WIRE
|
||||
type: lsu_heater+
|
||||
|
||||
- pin: B1
|
||||
function: DBW+
|
||||
alternative1: Low Side 11 (G2)
|
||||
type: switch
|
||||
ts_name: Switch SW5
|
||||
|
||||
- pin: B2
|
||||
function: CAN LOW
|
||||
alternative1: Digital Input 1 (D5)
|
||||
alternative2: USB D+
|
||||
type: switch
|
||||
ts_name: Switch SW4
|
||||
|
||||
- pin: B3
|
||||
function: CAN HIGH
|
||||
alternative1: Digital Input 2 (D4)
|
||||
alternative2: USB D-
|
||||
type: switch
|
||||
ts_name: Switch SW3
|
||||
|
||||
- pin: B4
|
||||
function: Digital Input 4 (D2)
|
||||
alternative1: Analogue Input 8 (A4)
|
||||
alternative2: Knock 1 (C0)
|
||||
type: switch
|
||||
ts_name: Switch SW2
|
||||
|
||||
- pin: B5
|
||||
function: Digital Input 3 (D3)
|
||||
alternative1: Analogue Input 9 (A1)
|
||||
alternative2: Knock 2 (C1)
|
||||
type: switch
|
||||
ts_name: Switch SW1
|
||||
|
||||
- pin: B6
|
||||
function: LSU NERMEST
|
||||
alternative1: LSU 4.9 CONNECTOR PIN 6
|
||||
alternative2: BLACK WIRE
|
||||
type: lsu_nermest
|
||||
|
||||
- pin: B7
|
||||
function: LSU IP
|
||||
alternative1: LSU 4.9 CONNECTOR PIN 1
|
||||
alternative2: RED WIRE
|
||||
type: lsu_ip
|
||||
|
||||
- pin: B8
|
||||
function: +12V Battery
|
||||
type: 12v
|
||||
ts_name: +12V from Battery
|
||||
|
||||
- pin: C1
|
||||
function: DBW-
|
||||
alternative1: Low Side 10 (D15)
|
||||
type: switch
|
||||
ts_name: Switch SW6
|
||||
|
||||
- pin: C2
|
||||
function: VR1+
|
||||
alternative1: HALL 1 (PG1)
|
||||
type: in_trigger
|
||||
ts_name: VR1+
|
||||
pin_name: PE2
|
||||
|
||||
- pin: C3
|
||||
function: VR1-
|
||||
alternative1: HALL 2 (PE7)
|
||||
type: in_trigger
|
||||
ts_name: VR1-
|
||||
|
||||
|
||||
- pin: C4
|
||||
function: VR2-
|
||||
alternative1: HALL 4 (PE8)
|
||||
type: in_trigger
|
||||
ts_name: VR2-
|
||||
|
||||
|
||||
- pin: C5
|
||||
function: VR2+
|
||||
alternative1: HALL 3 (PE9)
|
||||
type: in_trigger
|
||||
ts_name: VR2+
|
||||
pin_name: PE3
|
||||
|
||||
- pin: C6
|
||||
function: VVTI
|
||||
type: out_low
|
||||
ts_name: Low Side 16 (G7)
|
||||
pin_name: PG7
|
||||
|
||||
- pin: C7
|
||||
function: Sensor +5v
|
||||
type: 5v
|
||||
ts_name: Sensor +5v Supply
|
||||
|
||||
- pin: C8
|
||||
function: Ground
|
||||
type: gnd
|
||||
ts_name: Ground
|
||||
|
||||
info:
|
||||
title: pinout
|
||||
name: BLACK CONNECTOR
|
||||
image:
|
||||
file: main.jpg
|
||||
pins:
|
||||
- pin: A1
|
||||
x: 560
|
||||
y: 182
|
||||
|
||||
- pin: A2
|
||||
x: 584
|
||||
y: 182
|
||||
|
||||
- pin: A3
|
||||
x: 608
|
||||
y: 182
|
||||
|
||||
- pin: A4
|
||||
x: 632
|
||||
y: 182
|
||||
|
||||
- pin: A5
|
||||
x: 656
|
||||
y: 182
|
||||
|
||||
- pin: A6
|
||||
x: 680
|
||||
y: 182
|
||||
|
||||
- pin: A7
|
||||
x: 704
|
||||
y: 182
|
||||
|
||||
- pin: A8
|
||||
x: 728
|
||||
y: 182
|
||||
|
||||
- pin: B1
|
||||
x: 560
|
||||
y: 146
|
||||
|
||||
- pin: B2
|
||||
x: 584
|
||||
y: 146
|
||||
|
||||
- pin: B3
|
||||
x: 608
|
||||
y: 146
|
||||
|
||||
- pin: B4
|
||||
x: 632
|
||||
y: 146
|
||||
|
||||
- pin: B5
|
||||
x: 656
|
||||
y: 146
|
||||
|
||||
- pin: B6
|
||||
x: 680
|
||||
y: 146
|
||||
|
||||
- pin: B7
|
||||
x: 704
|
||||
y: 146
|
||||
|
||||
- pin: B8
|
||||
x: 728
|
||||
y: 146
|
||||
|
||||
- pin: C1
|
||||
x: 560
|
||||
y: 110
|
||||
|
||||
- pin: C2
|
||||
x: 584
|
||||
y: 110
|
||||
|
||||
- pin: C3
|
||||
x: 608
|
||||
y: 110
|
||||
|
||||
- pin: C4
|
||||
x: 632
|
||||
y: 110
|
||||
|
||||
- pin: C5
|
||||
x: 656
|
||||
y: 110
|
||||
|
||||
- pin: C6
|
||||
x: 680
|
||||
y: 110
|
||||
|
||||
- pin: C7
|
||||
x: 704
|
||||
y: 110
|
||||
|
||||
- pin: C8
|
||||
x: 728
|
||||
y: 110
|
|
@ -0,0 +1,84 @@
|
|||
//DO NOT EDIT MANUALLY, let automation work hard.
|
||||
|
||||
// auto-generated by PinoutLogic.java based on config/boards/core48/connectors/black.yaml
|
||||
// auto-generated by PinoutLogic.java based on config/boards/core48/connectors/grey.yaml
|
||||
// auto-generated by PinoutLogic.java based on config/boards/core48/connectors/main.yaml
|
||||
#include "pch.h"
|
||||
|
||||
// see comments at declaration in pin_repository.h
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
switch(brainPin) {
|
||||
case Gpio::A10: return "USART1 RX (A10)";
|
||||
case Gpio::A8: return "Stepper Direction (A8)";
|
||||
case Gpio::A9: return "USART1 TX (A9)";
|
||||
case Gpio::B10: return "BARO SCL (B10)";
|
||||
case Gpio::B11: return "BARO SDA (B11)";
|
||||
case Gpio::B13: return "SPI2 SCK (B13)";
|
||||
case Gpio::B14: return "SPI2 MISO (B14)";
|
||||
case Gpio::B15: return "SPI2 MOSI (B15)";
|
||||
case Gpio::B3: return "SD CS1 (B3)";
|
||||
case Gpio::B4: return "SD CS2 (B4)";
|
||||
case Gpio::B5: return "CAN 2 RX (B5)";
|
||||
case Gpio::B6: return "CAN 2 TX (B6)";
|
||||
case Gpio::B7: return "DBW Disable (B7)";
|
||||
case Gpio::B8: return "DBW Control (B8)";
|
||||
case Gpio::B9: return "DBW Direction (B9)";
|
||||
case Gpio::C10: return "SPI3 SCK (C10)";
|
||||
case Gpio::C11: return "SPI3 MISO (C11)";
|
||||
case Gpio::C12: return "SPI3 MOSI (C12)";
|
||||
case Gpio::C6: return "Stepper Control (C6)";
|
||||
case Gpio::C7: return "Stepper Disable (C7)";
|
||||
case Gpio::C8: return "EGT1 CS (C8)";
|
||||
case Gpio::C9: return "EGT2 CS (C9)";
|
||||
case Gpio::D0: return "CAN 1 RX (D0)";
|
||||
case Gpio::D1: return "CAN 1 TX (D1)";
|
||||
case Gpio::D10: return "Low Side 5 (D10)";
|
||||
case Gpio::D11: return "Low Side 6 (D11)";
|
||||
case Gpio::D12: return "Low Side 7 (D12)";
|
||||
case Gpio::D13: return "Low Side 8 (D13)";
|
||||
case Gpio::D14: return "Low Side 9 (D14)";
|
||||
case Gpio::D15: return "Low Side 10 (D15)";
|
||||
case Gpio::D2: return "Digital Input 3 (D2)";
|
||||
case Gpio::D3: return "Digital Input 4 (D3)";
|
||||
case Gpio::D4: return "Digital Input 1 (D4)";
|
||||
case Gpio::D5: return "Digital Input 2 (D5)";
|
||||
case Gpio::D6: return "Low Side 1 (D6)";
|
||||
case Gpio::D7: return "Low Side 2 (D7)";
|
||||
case Gpio::D8: return "Low Side 3 (D8)";
|
||||
case Gpio::D9: return "Low Side 4 (D9)";
|
||||
case Gpio::E10: return "High Side 6 (E10)";
|
||||
case Gpio::E11: return "High Side 5 (E11)";
|
||||
case Gpio::E12: return "High Side 4 (E12)";
|
||||
case Gpio::E13: return "High Side 3 (E13)";
|
||||
case Gpio::E14: return "High Side 2 (E14)";
|
||||
case Gpio::E15: return "High Side 1 (E15)";
|
||||
case Gpio::E2: return "VR1 (E2)";
|
||||
case Gpio::E3: return "VR2 (E3)";
|
||||
case Gpio::E4: return "VR3 (E4)";
|
||||
case Gpio::E5: return "VR4 (E5)";
|
||||
case Gpio::E7: return "Hall2 (E7)";
|
||||
case Gpio::E8: return "Hall4 (E8)";
|
||||
case Gpio::E9: return "Hall3 (E9)";
|
||||
case Gpio::F13: return "Hall5 (F13)";
|
||||
case Gpio::F14: return "Hall6 (F14)";
|
||||
case Gpio::F15: return "Hall8 (F15)";
|
||||
case Gpio::G0: return "Hall7 (G0)";
|
||||
case Gpio::G1: return "Hall1 (G1)";
|
||||
case Gpio::G10: return "Running LED (G10)";
|
||||
case Gpio::G11: return "Warning LED (G11)";
|
||||
case Gpio::G12: return "Error LED (G12)";
|
||||
case Gpio::G13: return "Communication LED (G13)";
|
||||
case Gpio::G14: return "USART6 TX (G14)";
|
||||
case Gpio::G15: return "High Side 8 (G15)";
|
||||
case Gpio::G2: return "Low Side 11 (G2)";
|
||||
case Gpio::G3: return "Low Side 12 (G3)";
|
||||
case Gpio::G4: return "Low Side 13 (G4)";
|
||||
case Gpio::G5: return "Low Side 14 (G5)";
|
||||
case Gpio::G6: return "Low Side 15 (G6)";
|
||||
case Gpio::G7: return "Low Side 16 (G7)";
|
||||
case Gpio::G8: return "High Side 7 (G8)";
|
||||
case Gpio::G9: return "USART6 RX (G9)";
|
||||
default: return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -0,0 +1,257 @@
|
|||
pins:
|
||||
- pin: A1
|
||||
function: INJECTOR 1
|
||||
type: out_low
|
||||
ts_name: Low Side 1 (D6)
|
||||
pin_name: PD6
|
||||
|
||||
- pin: A2
|
||||
function: INJECTOR 2
|
||||
type: out_low
|
||||
ts_name: Low Side 2 (D7)
|
||||
pin_name: PD7
|
||||
|
||||
- pin: A3
|
||||
function: INJECTOR 3
|
||||
type: out_low
|
||||
ts_name: Low Side 3 (D8)
|
||||
pin_name: PD8
|
||||
|
||||
- pin: A4
|
||||
function: INJECTOR 4
|
||||
type: out_low
|
||||
ts_name: Low Side 4 (D9)
|
||||
pin_name: PD9
|
||||
|
||||
- pin: A5
|
||||
function: INJECTOR 5
|
||||
type: out_low
|
||||
ts_name: Low Side 5 (D10)
|
||||
pin_name: PD10
|
||||
|
||||
- pin: A6
|
||||
function: INJECTOR 6
|
||||
type: out_low
|
||||
ts_name: Low Side 6 (D11)
|
||||
pin_name: PD11
|
||||
|
||||
- pin: A7
|
||||
function: INJECTOR 7
|
||||
type: out_low
|
||||
ts_name: Low Side 7 (D12)
|
||||
pin_name: PD12
|
||||
|
||||
- pin: A8
|
||||
function: INJECTOR 8
|
||||
type: out_low
|
||||
ts_name: Low Side 8 (D13)
|
||||
pin_name: PD13
|
||||
|
||||
- pin: B1
|
||||
function: COIL 1
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 1 (G15)
|
||||
pin_name: PG15
|
||||
|
||||
- pin: B2
|
||||
function: COIL 2
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 2 (G8)
|
||||
pin_name: PG8
|
||||
|
||||
- pin: B3
|
||||
function: COIL 3
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 3 (E10)
|
||||
pin_name: PE10
|
||||
|
||||
- pin: B4
|
||||
function: COIL 4
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 4 (E11)
|
||||
pin_name: PE11
|
||||
|
||||
- pin: B5
|
||||
function: COIL 5
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 5 (E12)
|
||||
pin_name: PE12
|
||||
|
||||
- pin: B6
|
||||
function: COIL 6
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 6 (E13)
|
||||
pin_name: PE13
|
||||
|
||||
- pin: B7
|
||||
function: COIL 7
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 7 (E14)
|
||||
pin_name: PE14
|
||||
|
||||
- pin: B8
|
||||
function: COIL 8
|
||||
alternative1: +5v or +12v signal depends on selection
|
||||
type: out_high
|
||||
ts_name: High Side 8 (E15)
|
||||
pin_name: PE15
|
||||
|
||||
- pin: C1
|
||||
function: TPS
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 1 (C5)
|
||||
pin_name: PC5
|
||||
|
||||
- pin: C2
|
||||
function: CLT
|
||||
alternative1: turn SW10 B0 ON to enable 2.49k PULL UP
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 2 (B0)
|
||||
pin_name: PB0
|
||||
|
||||
- pin: C3
|
||||
function: IAT
|
||||
alternative1: turn SW10 A7 ON to enable 2.49k PULL UP
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 3 (A7)
|
||||
pin_name: PA7
|
||||
|
||||
- pin: C4
|
||||
function: OIL PRESSURE
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 4 (C4)
|
||||
pin_name: PC4
|
||||
|
||||
- pin: C5
|
||||
function: FUEL PRESSURE
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 5 (A5)
|
||||
pin_name: PA5
|
||||
|
||||
- pin: C6
|
||||
function: SPARE ANALOG INPUT
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 6 (A6)
|
||||
pin_name: PA6
|
||||
|
||||
- pin: C7
|
||||
function: SPARE ANALOG INPUT
|
||||
type: in_adc
|
||||
ts_name: Analog Inputs 7 (A3)
|
||||
pin_name: PA3
|
||||
|
||||
- pin: C8
|
||||
function: TACHO
|
||||
alternative1: PULL UP to +5v or +12v depends on selection
|
||||
type: out_low
|
||||
ts_name: High Side 9 (D14)
|
||||
pin_name: PD14
|
||||
|
||||
info:
|
||||
title: pinout
|
||||
name: GREY CONNECTOR
|
||||
image:
|
||||
file: main.jpg
|
||||
pins:
|
||||
- pin: A1
|
||||
x: 192
|
||||
y: 182
|
||||
|
||||
- pin: A2
|
||||
x: 216
|
||||
y: 182
|
||||
|
||||
- pin: A3
|
||||
x: 240
|
||||
y: 182
|
||||
|
||||
- pin: A4
|
||||
x: 264
|
||||
y: 182
|
||||
|
||||
- pin: A5
|
||||
x: 288
|
||||
y: 182
|
||||
|
||||
- pin: A6
|
||||
x: 312
|
||||
y: 182
|
||||
|
||||
- pin: A7
|
||||
x: 336
|
||||
y: 182
|
||||
|
||||
- pin: A8
|
||||
x: 360
|
||||
y: 182
|
||||
|
||||
- pin: B1
|
||||
x: 192
|
||||
y: 146
|
||||
|
||||
- pin: B2
|
||||
x: 216
|
||||
y: 146
|
||||
|
||||
- pin: B3
|
||||
x: 240
|
||||
y: 146
|
||||
|
||||
- pin: B4
|
||||
x: 264
|
||||
y: 146
|
||||
|
||||
- pin: B5
|
||||
x: 288
|
||||
y: 146
|
||||
|
||||
- pin: B6
|
||||
x: 312
|
||||
y: 146
|
||||
|
||||
- pin: B7
|
||||
x: 336
|
||||
y: 146
|
||||
|
||||
- pin: B8
|
||||
x: 360
|
||||
y: 146
|
||||
|
||||
- pin: C1
|
||||
x: 192
|
||||
y: 110
|
||||
|
||||
- pin: C2
|
||||
x: 216
|
||||
y: 110
|
||||
|
||||
- pin: C3
|
||||
x: 240
|
||||
y: 110
|
||||
|
||||
- pin: C4
|
||||
x: 264
|
||||
y: 110
|
||||
|
||||
- pin: C5
|
||||
x: 288
|
||||
y: 110
|
||||
|
||||
- pin: C6
|
||||
x: 312
|
||||
y: 110
|
||||
|
||||
- pin: C7
|
||||
x: 336
|
||||
y: 110
|
||||
|
||||
- pin: C8
|
||||
x: 360
|
||||
y: 110
|
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
|
@ -0,0 +1,360 @@
|
|||
pins:
|
||||
- function: Power Ground
|
||||
type: gnd
|
||||
color: black
|
||||
|
||||
- function: +12V
|
||||
type: 12v
|
||||
color: red
|
||||
|
||||
- id: D6
|
||||
class: outputs
|
||||
ts_name: Low Side 1 (D6)
|
||||
|
||||
- id: D7
|
||||
class: outputs
|
||||
ts_name: Low Side 2 (D7)
|
||||
|
||||
- id: D8
|
||||
class: outputs
|
||||
ts_name: Low Side 3 (D8)
|
||||
|
||||
- id: D9
|
||||
class: outputs
|
||||
ts_name: Low Side 4 (D9)
|
||||
|
||||
- id: D10
|
||||
class: outputs
|
||||
ts_name: Low Side 5 (D10)
|
||||
|
||||
- id: D11
|
||||
class: outputs
|
||||
ts_name: Low Side 6 (D11)
|
||||
|
||||
- id: D12
|
||||
class: outputs
|
||||
ts_name: Low Side 7 (D12)
|
||||
|
||||
- id: D13
|
||||
class: outputs
|
||||
ts_name: Low Side 8 (D13)
|
||||
|
||||
- id: D14
|
||||
class: outputs
|
||||
function: Tachometer Output
|
||||
ts_name: Low Side 9 (D14)
|
||||
|
||||
- id: D15
|
||||
class: outputs
|
||||
ts_name: Low Side 10 (D15)
|
||||
|
||||
- id: G2
|
||||
class: outputs
|
||||
ts_name: Low Side 11 (G2)
|
||||
|
||||
- id: G3
|
||||
class: outputs
|
||||
ts_name: Low Side 12 (G3)
|
||||
|
||||
- id: G4
|
||||
class: outputs
|
||||
ts_name: Low Side 13 (G4)
|
||||
|
||||
- id: G5
|
||||
class: outputs
|
||||
ts_name: Low Side 14 (G5)
|
||||
|
||||
- id: G6
|
||||
class: outputs
|
||||
ts_name: Low Side 15 (G6)
|
||||
|
||||
- id: G7
|
||||
class: outputs
|
||||
ts_name: Low Side 16 (G7)
|
||||
|
||||
- id: E15
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 1 (E15)
|
||||
|
||||
- id: E14
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 2 (E14)
|
||||
|
||||
- id: E13
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 3 (E13)
|
||||
|
||||
- id: E12
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 4 (E12)
|
||||
|
||||
- id: E11
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 5 (E11)
|
||||
|
||||
- id: E10
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 6 (E10)
|
||||
|
||||
- id: G8
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 7 (G8)
|
||||
|
||||
- id: G15
|
||||
class: outputs
|
||||
type: ign
|
||||
ts_name: High Side 8 (G15)
|
||||
|
||||
- id: A8
|
||||
class: outputs
|
||||
ts_name: Stepper Direction (A8)
|
||||
|
||||
- id: C6
|
||||
class: outputs
|
||||
ts_name: Stepper Control (C6)
|
||||
|
||||
- id: C7
|
||||
class: outputs
|
||||
ts_name: Stepper Disable (C7)
|
||||
|
||||
- id: B7
|
||||
class: outputs
|
||||
ts_name: DBW Disable (B7)
|
||||
|
||||
- id: B8
|
||||
class: outputs
|
||||
ts_name: DBW Control (B8)
|
||||
|
||||
- id: B9
|
||||
class: outputs
|
||||
ts_name: DBW Direction (B9)
|
||||
|
||||
- id: EFI_ADC_9
|
||||
class: analog_inputs
|
||||
ts_name: On-board Battery Sense (B1)
|
||||
|
||||
- id: EFI_ADC_15
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 1 (C5)
|
||||
|
||||
- id: EFI_ADC_8
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 2 (B0)
|
||||
|
||||
- id: EFI_ADC_7
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 3 (A7)
|
||||
|
||||
- id: EFI_ADC_14
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 4 (C4)
|
||||
|
||||
- id: EFI_ADC_5
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 5 (A5)
|
||||
|
||||
- id: EFI_ADC_6
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 6 (A6)
|
||||
|
||||
- id: EFI_ADC_3
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 7 (A3)
|
||||
|
||||
- id: EFI_ADC_2
|
||||
class: analog_inputs
|
||||
function: MAP Sensor Input
|
||||
ts_name: On-board MAP (A2)
|
||||
|
||||
- id: EFI_ADC_13
|
||||
class: analog_inputs
|
||||
function: O2 Sensor Input
|
||||
ts_name: Primary On-board O2 (C3)
|
||||
|
||||
- id: EFI_ADC_0
|
||||
class: analog_inputs
|
||||
function: O2 Sensor Input
|
||||
ts_name: Secondary On-board O2 (A0)
|
||||
|
||||
- id: EFI_ADC_4
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 8 (A4)
|
||||
|
||||
- id: EFI_ADC_1
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs 9 (A1)
|
||||
|
||||
- id: EFI_ADC_10
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs Knock 1 (C0)
|
||||
|
||||
- id: EFI_ADC_11
|
||||
class: analog_inputs
|
||||
ts_name: Analog Inputs Knock 2 (C1)
|
||||
|
||||
- id: [E2, E2]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: VR1 (E2)
|
||||
|
||||
- id: [E3, E3]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: VR2 (E3)
|
||||
|
||||
- id: [E4, E4]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: VR3 (E4)
|
||||
|
||||
- id: [E5, E5]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: VR4 (E5)
|
||||
|
||||
- id: [G1, G1]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall1 (G1)
|
||||
|
||||
- id: [E7, E7]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall2 (E7)
|
||||
|
||||
- id: [E9, E9]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall3 (E9)
|
||||
|
||||
- id: [E8, E8]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall4 (E8)
|
||||
|
||||
- id: [F13, F13]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall5 (F13)
|
||||
|
||||
- id: [F14, F14]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall6 (F14)
|
||||
|
||||
- id: [G0, G0]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall7 (G0)
|
||||
|
||||
- id: [F15, F15]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Hall8 (F15)
|
||||
|
||||
- id: [D4, D4]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Digital Input 1 (D4)
|
||||
|
||||
- id: [D5, D5]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Digital Input 2 (D5)
|
||||
|
||||
- id: [D2, D2]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Digital Input 3 (D2)
|
||||
|
||||
- id: [D3, D3]
|
||||
class: [switch_inputs, event_inputs]
|
||||
ts_name: Digital Input 4 (D3)
|
||||
|
||||
- id: G10
|
||||
class: outputs
|
||||
ts_name: Running LED (G10)
|
||||
|
||||
- id: G11
|
||||
class: outputs
|
||||
ts_name: Warning LED (G11)
|
||||
|
||||
- id: G12
|
||||
class: outputs
|
||||
ts_name: Error LED (G12)
|
||||
|
||||
- id: G13
|
||||
class: outputs
|
||||
ts_name: Communication LED (G13)
|
||||
|
||||
- id: C8
|
||||
class: outputs
|
||||
ts_name: EGT1 CS (C8)
|
||||
|
||||
- id: C9
|
||||
class: outputs
|
||||
ts_name: EGT2 CS (C9)
|
||||
|
||||
- id: C10
|
||||
class: outputs
|
||||
ts_name: SPI3 SCK (C10)
|
||||
|
||||
- id: C11
|
||||
class: outputs
|
||||
ts_name: SPI3 MISO (C11)
|
||||
|
||||
- id: C12
|
||||
class: outputs
|
||||
ts_name: SPI3 MOSI (C12)
|
||||
|
||||
- id: B13
|
||||
class: outputs
|
||||
ts_name: SPI2 SCK (B13)
|
||||
|
||||
- id: B14
|
||||
class: outputs
|
||||
ts_name: SPI2 MISO (B14)
|
||||
|
||||
- id: B15
|
||||
class: outputs
|
||||
ts_name: SPI2 MOSI (B15)
|
||||
|
||||
- id: B10
|
||||
class: outputs
|
||||
ts_name: BARO SCL (B10)
|
||||
|
||||
- id: B11
|
||||
class: outputs
|
||||
ts_name: BARO SDA (B11)
|
||||
|
||||
- id: B3
|
||||
class: outputs
|
||||
ts_name: SD CS1 (B3)
|
||||
|
||||
- id: B4
|
||||
class: outputs
|
||||
ts_name: SD CS2 (B4)
|
||||
|
||||
- id: A9
|
||||
class: outputs
|
||||
ts_name: USART1 TX (A9)
|
||||
|
||||
- id: A10
|
||||
class: outputs
|
||||
ts_name: USART1 RX (A10)
|
||||
|
||||
- id: G9
|
||||
class: outputs
|
||||
ts_name: USART6 RX (G9)
|
||||
|
||||
- id: G14
|
||||
class: outputs
|
||||
ts_name: USART6 TX (G14)
|
||||
|
||||
- id: D0
|
||||
class: outputs
|
||||
ts_name: CAN 1 RX (D0)
|
||||
|
||||
- id: D1
|
||||
class: outputs
|
||||
ts_name: CAN 1 TX (D1)
|
||||
|
||||
- id: B5
|
||||
class: outputs
|
||||
ts_name: CAN 2 RX (B5)
|
||||
|
||||
- id: B6
|
||||
class: outputs
|
||||
ts_name: CAN 2 TX (B6)
|
|
@ -0,0 +1,256 @@
|
|||
|
||||
|
||||
# CORE 48 v2.1
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/5bdb0bb8-2ab7-4919-9121-8c81560b6320)
|
||||
|
||||
## Features
|
||||
|
||||
- 8 Injectors
|
||||
- 8 Coils
|
||||
- 8 Low Side Switch
|
||||
- 4 VR / 8 Hall Triggers
|
||||
- 4 Digital Inputs
|
||||
- 8 Analogue 0-5v inputs (all can be used as temperature inputs via 2.49k pull up resistor SW10 and SW11)
|
||||
- DBW
|
||||
- 2 Wideband (14point7)
|
||||
- 2 Canbus
|
||||
- 2 EGT
|
||||
- 4bar map
|
||||
- Onboard Barometer
|
||||
- Onboard SD card/Removable SD Card
|
||||
- Bluetooth
|
||||
|
||||
## Firmware
|
||||
|
||||
<div align="center">
|
||||
|
||||
<a href="https://github.com/rusefi/rusefi" target="_blank">
|
||||
<img src="https://raw.githubusercontent.com/wiki/rusefi/rusefi/Images/logo_new.png" alt="rusEFI" width="600" />
|
||||
</a>
|
||||
<br/>
|
||||
<b>GPL open-source ECU</b>
|
||||
<br/>
|
||||
</div>
|
||||
|
||||
## Interactive Pinout Manual
|
||||
|
||||
https://opelpanfan.github.io/CORE48/core48_21.html
|
||||
|
||||
### Black Connector
|
||||
|
||||
<div align="center">
|
||||
<a href="https://opelpanfan.github.io/CORE48/core48_21.html" target="_blank">
|
||||
<img src="https://github.com/opelpanfan/CORE48/assets/12942077/cb34225e-63c1-4ae5-84aa-97a96f62b942" alt="black" width="100%" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
| Pin Number | STM32 Pin Number | TS Name | Typical Function | Alternative Function #1 | Alternative Function #2 |
|
||||
| ------ | ------ | ------ | ------ | ------ | ------ |
|
||||
| A1 | PG3 | Low Side 12 (G3) | FUEL PUMP | | |
|
||||
| A2 | PG4 | Low Side 13 (G4) | FAN RELAY | | |
|
||||
| A3 | PG5 | Low Side 14 (G5) | BOOST | | |
|
||||
| A4 | PG6 | Low Side 15 (G6) | IDLE | | |
|
||||
| A5 | | | LSU HEATER- | LSU 4.9 CONNECTOR PIN 3 | WHITE WIRE |
|
||||
| A6 | | | LSU IA | LSU 4.9 CONNECTOR PIN 5 | GREEN WIRE |
|
||||
| A7 | | | LSU VGND | LSU 4.9 CONNECTOR PIN 2 | YELLOW WIRE |
|
||||
| A8 | | | LSU HEATER+ | LSU 4.9 CONNECTOR PIN 4 | GREY WIRE |
|
||||
| B1 | | Switch SW5 | DBW+ | Low Side 11 (G2) | |
|
||||
| B2 | | Switch SW4 | CAN LOW | Digital Input 1 (D5) | USB D+ |
|
||||
| B3 | | Switch SW3 | CAN HIGH | Digital Input 2 (D4) | USB D- |
|
||||
| B4 | | Switch SW2 | Digital Input 4 (D2) | Analogue Input 8 (A4) | Knock 1 (C0) |
|
||||
| B5 | | Switch SW1 | Digital Input 3 (D3) | Analogue Input 9 (A1) | Knock 2 (C1) |
|
||||
| B6 | | | LSU NERMEST | LSU 4.9 CONNECTOR PIN 6 | BLACK WIRE |
|
||||
| B7 | | | LSU IP | LSU 4.9 CONNECTOR PIN 1 | RED WIRE |
|
||||
| B8 | | +12V from Battery | +12V Battery | | |
|
||||
| C1 | | Switch SW6 | DBW- | Low Side 10 (D15) | |
|
||||
| C2 | PE2 | VR1+ | VR1+ | HALL 1 (PG1) | |
|
||||
| C3 | | VR1- | VR1- | HALL 2 (PE7) | |
|
||||
| C4 | | VR2- | VR2- | HALL 4 (PE8) | |
|
||||
| C5 | PE3 | VR2+ | VR2+ | HALL 3 (PE9) | |
|
||||
| C6 | PG7 | Low Side 16 (G7) | VVTI | | |
|
||||
| C7 | | Sensor +5v Supply | Sensor +5v Supply | | |
|
||||
| C8 | | Ground | Ground | | |
|
||||
|
||||
### Grey Connector
|
||||
|
||||
|
||||
<div align="center">
|
||||
<a href="https://opelpanfan.github.io/CORE48/core48_21.html" target="_blank">
|
||||
<img src="https://github.com/opelpanfan/CORE48/assets/12942077/ebb802ea-ebaf-4b2f-a6b5-6568010a384e" alt="grey" width="100%" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
| Pin Number | STM32 Pin Number | TS Name | Typical Function | Alternative Function #1 |
|
||||
| ------ | ------ | ------ | ------ | ------ |
|
||||
| A1 | PD6 | Low Side 1 (D6) |INJECTOR 1 | |
|
||||
| A2 | PD7 | Low Side 2 (D7) |INJECTOR 2 | |
|
||||
| A3 | PD8 | Low Side 3 (D8) |INJECTOR 3 | |
|
||||
| A4 | PD9 | Low Side 4 (D9) |INJECTOR 4 | |
|
||||
| A5 | PD10 | Low Side 5 (D10) |INJECTOR 5 | |
|
||||
| A6 | PD11 | Low Side 6 (D11) |INJECTOR 6 | |
|
||||
| A7 | PD12 | Low Side 7 (D12) |INJECTOR 7 | |
|
||||
| A8 | PD13 | Low Side 8 (D13) |INJECTOR 8 | |
|
||||
| B1 | PG15 | High Side 1 (G15) |COIL 1 | +5v or +12v signal depends on selection |
|
||||
| B2 | PG8 | High Side 2 (G8) |COIL 2 | +5v or +12v signal depends on selection |
|
||||
| B3 | PE10 | High Side 3 (E10) |COIL 3 | +5v or +12v signal depends on selection |
|
||||
| B4 | PE11 | High Side 4 (E11) |COIL 4 | +5v or +12v signal depends on selection |
|
||||
| B5 | PE12 | High Side 5 (E12) |COIL 5 | +5v or +12v signal depends on selection |
|
||||
| B6 | PE13 | High Side 6 (E13) |COIL 6 | +5v or +12v signal depends on selection |
|
||||
| B7 | PE14 | High Side 7 (E14) |COIL 7 | +5v or +12v signal depends on selection |
|
||||
| B8 | PE15 | High Side 8 (E15) |COIL 8 | |
|
||||
| C1 | PC5 | Analog Inputs 1 (C5) |TPS | |
|
||||
| C2 | PB0 | Analog Inputs 2 (B0) |CLT | turn SW10 B0 ON to enable 2.49k PULL UP |
|
||||
| C3 | PA7 | Analog Inputs 3 (A7) |IAT | turn SW10 A7 ON to enable 2.49k PULL UP |
|
||||
| C4 | PC4 | Analog Inputs 4 (C4) |OIL PRESSURE | HALL 4 (PE8) |
|
||||
| C5 | PA5 | Analog Inputs 5 (A5) |FUEL PRESSURE | HALL 3 (PE9) |
|
||||
| C6 | PA6 | Analog Inputs 6 (A6) |SPARE ANALOG INPUT| |
|
||||
| C7 | PA3 | Analog Inputs 7 (A3) |SPARE ANALOG INPUT| |
|
||||
| C8 | PD14 | High Side 9 (D14) |TACHO | PULLUP +5v or +12v depends on selection |
|
||||
|
||||
|
||||
## PCB Layout
|
||||
|
||||
### :warning: **Please check the connector pinout table as some silk prints on the PCB are wrong.**
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/3469a74a-7623-40d8-a7de-25a0a55c2823)
|
||||
|
||||
## Solder jumper configuration
|
||||
|
||||
| Switch ID | Link to Connector | Image | RED | BLUE | GREEN |
|
||||
| ------ | ------ | ------ | ------ | ------ | ------ |
|
||||
| SW1 | B_B5 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/1757576a-7584-4ea2-9035-57acbbaf3b19) | Knock 2 (C1) | Analog Inputs 9 (A1) | Digital Input 3 (D3) |
|
||||
| SW2 | B_C6 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/1b31a344-36ec-4790-a561-0a1140de30eb) | Digital Input 4 (D2) | Analog Inputs 8 (A4) | Knock 1 (C0) |
|
||||
| SW3 | B_B3 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/711358c0-e6ea-4739-a8e7-d2e205c731dd) | USB D+ | Digital Input 1 (D5) | CAN LOW |
|
||||
| SW4 | B_B2 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/13c2c3d5-92b9-4165-abd7-87adfbc2b485) | CAN HIGH | Digital Input 2 (D4) | USB D- |
|
||||
| SW5 | B_B1 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/f82bcf90-6858-464f-9b6d-c5ac517da40f) | Low Side 11 (G2) | DBW+ | |
|
||||
| SW6 | B_C1 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/f0aa1e6a-c734-4d53-98a2-01fd3d8e0ee6) | Low Side 10 (D15) | DBW- | |
|
||||
| SW7 | B_C8 | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/4ac00500-5d3b-4104-9123-b3110029daaf) | TACHO PULL UP to +12v | TACHO PULL UP to +5v | |
|
||||
| SW8 | COIL Signal | ![image](https://github.com/opelpanfan/CORE48/assets/12942077/ce27c313-928a-4be8-b1f0-466bbbb1c55b) | COIL Trigger +12v | COIL Trigger +5v | |
|
||||
|
||||
### VR Trigger Configuration
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/76f164eb-7be7-466e-9e0a-0189acd6b181)
|
||||
|
||||
### HALL Trigger Configuration
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/5c0ed98f-dc9c-4850-972a-7a3a368713a3)
|
||||
|
||||
### SW10 and SW11: Analogue input PULLUP resistors (2.49k) to +5V for Temperature Sensor
|
||||
|
||||
>Analogue input pull up settings to use for temperature inputs:
|
||||
>Most of Analogue inputs can be used as temperature inputs with 2.49Kohm pull up to +5v resistors.
|
||||
>These resistors can be enabled by flipping toggle switch to ON position.
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/feb964ff-f6d2-4a99-856c-991d7fd84f30)
|
||||
|
||||
### SW12 Digital Input PULLUP resistors (680k) to +5v
|
||||
|
||||
>Digital input 680kohm pull up resistors to +5v.
|
||||
>If your digital input requires pull up resistor taht can be enabled by flipping toggle switch to ON possition.
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/7b24b38e-0779-4887-ad61-4abda1b18171)
|
||||
|
||||
### SW9 CAN bus terminator Resistors and Knock Audio Filters
|
||||
|
||||
>1. toggle switch is to ON possition to enable 120ohm terminating resistor on CAN1
|
||||
>2. toggle switch is to ON possition to enable 120ohm terminating resistor on CAN2
|
||||
>3. toggle switch is to ON possition to enable 3.3nF filter capacitor on KNOCK 1 Input
|
||||
>4. toggle switch is to ON possition to enable 3.3nF filter capacitor on KNOCK 2 Input
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/d3dc0053-40e4-4aa0-af15-56401b117058)
|
||||
|
||||
## Additional Connectors
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/232973ae-c908-4171-bbfc-a493dfd78635)
|
||||
|
||||
|
||||
### CAN Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/1f331c42-2952-4920-9695-7dd1e4caabf2)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | CAN 1 LOW |
|
||||
| 2 | | CAN 1 HIGH |
|
||||
| 3 | | CAN 2 LOW |
|
||||
| 4 | | CAN 2 HIGH |
|
||||
|
||||
### USB Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/d67afd6f-4710-4ef0-bb53-0fb0c96deeb1)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | USB +5V |
|
||||
| 2 | | USB D- |
|
||||
| 3 | | USB D+ |
|
||||
| 4 | | GND |
|
||||
|
||||
### Stepper Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/c8108ecd-139e-4c5d-8e20-70fbb49c9b4d)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | STEP 1B |
|
||||
| 2 | | STEP 1A |
|
||||
| 3 | | STEP 2A |
|
||||
| 4 | | STEP 2B |
|
||||
|
||||
### VR3/VR4 Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/c49c41fe-d15f-4377-80a0-b8a9ff652205)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | PE4/PF13 | VR3+/HALL5 (F13) |
|
||||
| 2 | PF14 | VR3-/HALL6 (F14) |
|
||||
| 3 | PF15 | VR4-/HALL8 (F15) |
|
||||
| 4 | PE5/PG0 | VR4+/HALL7 (G0) |
|
||||
|
||||
### EGT Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/1dcf5bb6-c38a-41e1-8293-b87aee4d508b)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | EGT1 T- |
|
||||
| 2 | | EGT1 T+ |
|
||||
| 3 | | EGT2 T- |
|
||||
| 4 | | EGT2 T+ |
|
||||
|
||||
### Knock/Serial Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/24d01a55-a5b8-459b-b840-11c136f379a0)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | UART6 RX |
|
||||
| 2 | | UART6 TX |
|
||||
| 3 | | KNOCK 2 Audio |
|
||||
| 4 | | KNOCK 1 Audio |
|
||||
|
||||
### DBW Connector
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/c65efae5-5758-409d-acdc-784bcb1f960b)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | GND |
|
||||
| 2 | | +5V |
|
||||
| 3 | | ET- |
|
||||
| 4 | | ET+ |
|
||||
| 5 | | Analog Inputs 8 (A4) |
|
||||
| 6 | | Analog Inputs 9 (A1) |
|
||||
|
||||
### LSU Connector
|
||||
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/63d5e15a-5c4e-44d1-8edd-1df03da7e6d4)
|
||||
![image](https://github.com/opelpanfan/CORE48/assets/12942077/05f5cd9a-93ac-4810-8be9-47d00f090758)
|
||||
|
||||
| Pin | STM32 PIN | Function |
|
||||
| ------ | ------ | ------ |
|
||||
| 1 | | LSU Connector 4 |
|
||||
| 2 | | LSU Connector 3 |
|
||||
| 3 | | LSU Connector 2 |
|
||||
| 4 | | LSU Connector 1 |
|
||||
| 5 | | LSU Connector 6 |
|
||||
| 6 | | LSU Connector 5 |
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
/**
|
||||
* @file knock_config.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Knock is on ADC3
|
||||
#define KNOCK_ADC ADCD3
|
||||
|
||||
// knock 1 - pin PC0
|
||||
#define KNOCK_ADC_CH1 ADC_CHANNEL_IN10
|
||||
#define KNOCK_PIN_CH1 Gpio::C0
|
||||
|
||||
// knock 2 - pin PC1
|
||||
#define KNOCK_HAS_CH2 true
|
||||
#define KNOCK_ADC_CH2 ADC_CHANNEL_IN11
|
||||
#define KNOCK_PIN_CH2 Gpio::C1
|
||||
|
||||
// Sample rate & time - depends on the exact MCU
|
||||
#define KNOCK_SAMPLE_TIME ADC_SAMPLE_84
|
||||
#define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12)))
|
|
@ -1,4 +1,9 @@
|
|||
#define ts_show_hip9011 false
|
||||
#define ts_show_cj125 false
|
||||
|
||||
#define ts_show_lcd false
|
||||
#define ts_show_joystick false
|
||||
#define ts_show_gps false
|
||||
#define ts_show_software_knock true
|
||||
|
||||
#define show_test_presets true
|
|
@ -1,3 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
bash ../common_make.sh core8 ARCH_STM32F4
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
bash ../common_make.sh core8 ARCH_STM32F4
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
call gen_config.bat
|
||||
call gen_config_board.bat
|
||||
call gen_config_common.sh
|
||||
call gen_config_default.sh
|
||||
call gen_default_everything.sh
|
||||
call gen_enum_to_string.bat
|
||||
call gen_live_documentation.bat
|
||||
call gen_output_channels.sh
|
||||
call gen_ptrace_enums.bat
|
||||
call gen_signature.sh
|
||||
call generate_docs.bat
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
w folderze /firmware
|
||||
gen_config_board.sh BB_V3 BB_V3
|
|
@ -1,494 +0,0 @@
|
|||
/**
|
||||
* @file boards/coreECU/board.h
|
||||
*
|
||||
* @date Feb 06, 2022
|
||||
* @author Mariusz Podgajny, 2022
|
||||
*/
|
||||
|
||||
#define BOARD_NAME "CORE_ECU"
|
||||
|
||||
#ifndef BOARD_IO_H
|
||||
#define BOARD_IO_H
|
||||
|
||||
#define EFI_USB_AF 10U
|
||||
#define EFI_USB_SERIAL_DM Gpio::A11
|
||||
#define EFI_USB_SERIAL_DP Gpio::A12
|
||||
|
||||
#define EFI_USE_OSC TRUE
|
||||
|
||||
#define EFI_CAN_SUPPORT TRUE
|
||||
#define CAN_USE_SLEEP_MODE FALSE
|
||||
|
||||
#undef EFI_FILE_LOGGING
|
||||
#define EFI_FILE_LOGGING TRUE
|
||||
|
||||
#undef EFI_SDC_DEVICE
|
||||
#define EFI_SDC_DEVICE SDCD1
|
||||
|
||||
#undef EFI_ICU_INPUTS
|
||||
#define EFI_ICU_INPUTS FALSE
|
||||
|
||||
#undef HAL_TRIGGER_USE_PAL
|
||||
#define HAL_TRIGGER_USE_PAL TRUE
|
||||
|
||||
#undef EFI_LOGIC_ANALYZER
|
||||
#define EFI_LOGIC_ANALYZER FALSE
|
||||
|
||||
#undef HAL_VSS_USE_PAL
|
||||
#define HAL_VSS_USE_PAL TRUE
|
||||
|
||||
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
#define LED_CRITICAL_ERROR_BRAIN_PIN Gpio::Unassigned
|
||||
#endif
|
||||
|
||||
// Ignore USB VBUS pin (we're never a host, only a device)
|
||||
#define BOARD_OTG_NOVBUSSENS TRUE
|
||||
|
||||
/*
|
||||
* Board oscillators-related settings.
|
||||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300U
|
||||
|
||||
|
||||
#define EFI_PIN_MODE_DEFAULT PIN_MODE_INPUT
|
||||
#ifndef EFI_DR_DEFAULT
|
||||
#define EFI_DR_DEFAULT PIN_PUPDR_PULLDOWN
|
||||
#endif
|
||||
|
||||
// See https://github.com/rusefi/rusefi/issues/397
|
||||
#define DEFAULT_GPIO_SPEED PIN_OSPEED_HIGH
|
||||
|
||||
|
||||
/*
|
||||
* 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))
|
||||
|
||||
#define VAL_GPIO_MODER_ALL_DEFAULT (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
|
||||
#define VAL_GPIO_OTYPER_ALL_DEFAULT (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_GPIO_OSPEEDR_ALL_DEFAULT (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_GPIO_ODR_ALL_DEFAULT 0
|
||||
|
||||
#define VAL_GPIO_PUPDR_ALL_DEFAULT (EFI_DR_DEFAULT(0) | \
|
||||
EFI_DR_DEFAULT(1) | \
|
||||
EFI_DR_DEFAULT(2) | \
|
||||
EFI_DR_DEFAULT(3) | \
|
||||
EFI_DR_DEFAULT(4) | \
|
||||
EFI_DR_DEFAULT(5) | \
|
||||
EFI_DR_DEFAULT(6) | \
|
||||
EFI_DR_DEFAULT(7) | \
|
||||
EFI_DR_DEFAULT(8) | \
|
||||
EFI_DR_DEFAULT(9) | \
|
||||
EFI_DR_DEFAULT(10) | \
|
||||
EFI_DR_DEFAULT(11) | \
|
||||
EFI_DR_DEFAULT(12) | \
|
||||
EFI_DR_DEFAULT(13) | \
|
||||
EFI_DR_DEFAULT(14) | \
|
||||
EFI_DR_DEFAULT(15))
|
||||
|
||||
#define VAL_GPIO_AF_ALL_DEFAULT (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_GPIOA_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
PIN_MODE_ALTERNATE(13) | \
|
||||
PIN_MODE_ALTERNATE(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
#define VAL_GPIOA_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOA_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOA_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, 6U) | \
|
||||
PIN_AFIO_AF(5, 5U) | \
|
||||
PIN_AFIO_AF(6, 5U) | \
|
||||
PIN_AFIO_AF(7, 5U))
|
||||
#define VAL_GPIOA_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOB setup:
|
||||
*/
|
||||
#define VAL_GPIOB_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(15))
|
||||
#define VAL_GPIOB_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOB_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOB_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOB_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOC setup:
|
||||
|
||||
* 8 BIT MODE
|
||||
* PC8 - MMC D0
|
||||
* PC9 - MMC D1
|
||||
* PC10 - MMC D2
|
||||
* PC11 - MMC D3
|
||||
* PC12 - CLK
|
||||
|
||||
* 1 BIT MODE
|
||||
* PC8 - MMC D0
|
||||
* PC12 - CLK
|
||||
|
||||
* NOW IS SETUP FOR 1 BIT SDIO
|
||||
*/
|
||||
#define VAL_GPIOC_MODER (EFI_PIN_MODE_DEFAULT(0) | \
|
||||
EFI_PIN_MODE_DEFAULT(1) | \
|
||||
EFI_PIN_MODE_DEFAULT(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
PIN_MODE_ALTERNATE(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
PIN_MODE_ALTERNATE(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(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 (PIN_OSPEED_HIGH( 0) | \
|
||||
PIN_OSPEED_HIGH( 1) | \
|
||||
PIN_OSPEED_HIGH( 2) | \
|
||||
PIN_OSPEED_HIGH( 3) | \
|
||||
PIN_OSPEED_HIGH( 4) | \
|
||||
PIN_OSPEED_HIGH( 5) | \
|
||||
PIN_OSPEED_HIGH( 6) | \
|
||||
PIN_OSPEED_HIGH( 7) | \
|
||||
PIN_OSPEED_HIGH( 8) | \
|
||||
PIN_OSPEED_HIGH( 9) | \
|
||||
PIN_OSPEED_HIGH(10) | \
|
||||
PIN_OSPEED_HIGH(11) | \
|
||||
PIN_OSPEED_HIGH(12) | \
|
||||
PIN_OSPEED_HIGH(13) | \
|
||||
PIN_OSPEED_HIGH(14) | \
|
||||
PIN_OSPEED_HIGH(15))
|
||||
#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING( 0) | \
|
||||
PIN_PUPDR_PULLDOWN( 1) | \
|
||||
PIN_PUPDR_PULLDOWN( 2) | \
|
||||
PIN_PUPDR_PULLDOWN( 3) | \
|
||||
PIN_PUPDR_PULLDOWN( 4) | \
|
||||
PIN_PUPDR_PULLDOWN( 5) | \
|
||||
PIN_PUPDR_PULLDOWN( 6) | \
|
||||
PIN_PUPDR_PULLDOWN( 7) | \
|
||||
PIN_PUPDR_PULLDOWN( 8) | \
|
||||
PIN_PUPDR_PULLDOWN( 9) | \
|
||||
PIN_PUPDR_PULLDOWN(10) | \
|
||||
PIN_PUPDR_PULLDOWN(11) | \
|
||||
PIN_PUPDR_PULLDOWN(12) | \
|
||||
PIN_PUPDR_PULLDOWN(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLDOWN(15))
|
||||
#define VAL_GPIOC_ODR (PIN_ODR_HIGH(0) | \
|
||||
PIN_ODR_HIGH(2) | \
|
||||
PIN_ODR_HIGH(3) | \
|
||||
PIN_ODR_HIGH(6) | \
|
||||
PIN_ODR_HIGH(7) | \
|
||||
PIN_ODR_HIGH(8) | \
|
||||
PIN_ODR_HIGH(9) | \
|
||||
PIN_ODR_HIGH(10) | \
|
||||
PIN_ODR_HIGH(11) | \
|
||||
PIN_ODR_HIGH(12) | \
|
||||
PIN_ODR_HIGH(14))
|
||||
#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, 12U) | \
|
||||
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, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOD setup:
|
||||
* PD0 - CAN RX
|
||||
* PD1 - CAN TX
|
||||
* PD2 - CMD
|
||||
*/
|
||||
|
||||
#define VAL_GPIOD_MODER (PIN_MODE_ALTERNATE(0) | \
|
||||
PIN_MODE_ALTERNATE(1) | \
|
||||
PIN_MODE_ALTERNATE(2) | \
|
||||
EFI_PIN_MODE_DEFAULT(3) | \
|
||||
EFI_PIN_MODE_DEFAULT(4) | \
|
||||
EFI_PIN_MODE_DEFAULT(5) | \
|
||||
EFI_PIN_MODE_DEFAULT(6) | \
|
||||
EFI_PIN_MODE_DEFAULT(7) | \
|
||||
EFI_PIN_MODE_DEFAULT(8) | \
|
||||
EFI_PIN_MODE_DEFAULT(9) | \
|
||||
EFI_PIN_MODE_DEFAULT(10) | \
|
||||
EFI_PIN_MODE_DEFAULT(11) | \
|
||||
EFI_PIN_MODE_DEFAULT(12) | \
|
||||
EFI_PIN_MODE_DEFAULT(13) | \
|
||||
EFI_PIN_MODE_DEFAULT(14) | \
|
||||
EFI_PIN_MODE_DEFAULT(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 (PIN_OSPEED_HIGH( 0) | \
|
||||
PIN_OSPEED_HIGH( 1) | \
|
||||
PIN_OSPEED_HIGH( 2) | \
|
||||
PIN_OSPEED_HIGH( 3) | \
|
||||
PIN_OSPEED_HIGH( 4) | \
|
||||
PIN_OSPEED_HIGH( 5) | \
|
||||
PIN_OSPEED_HIGH( 6) | \
|
||||
PIN_OSPEED_HIGH( 7) | \
|
||||
PIN_OSPEED_HIGH( 8) | \
|
||||
PIN_OSPEED_HIGH( 9) | \
|
||||
PIN_OSPEED_HIGH(10) | \
|
||||
PIN_OSPEED_HIGH(11) | \
|
||||
PIN_OSPEED_HIGH(12) | \
|
||||
PIN_OSPEED_HIGH(13) | \
|
||||
PIN_OSPEED_HIGH(14) | \
|
||||
PIN_OSPEED_HIGH(15))
|
||||
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLDOWN( 0) | \
|
||||
PIN_PUPDR_PULLDOWN( 1) | \
|
||||
PIN_PUPDR_PULLDOWN( 2) | \
|
||||
PIN_PUPDR_PULLDOWN( 3) | \
|
||||
PIN_PUPDR_PULLDOWN( 4) | \
|
||||
PIN_PUPDR_PULLDOWN( 5) | \
|
||||
PIN_PUPDR_PULLDOWN( 6) | \
|
||||
PIN_PUPDR_PULLDOWN( 7) | \
|
||||
PIN_PUPDR_PULLDOWN( 8) | \
|
||||
PIN_PUPDR_PULLDOWN( 9) | \
|
||||
PIN_PUPDR_PULLDOWN(10) | \
|
||||
PIN_PUPDR_PULLDOWN(11) | \
|
||||
PIN_PUPDR_PULLDOWN(12) | \
|
||||
PIN_PUPDR_PULLDOWN(13) | \
|
||||
PIN_PUPDR_PULLDOWN(14) | \
|
||||
PIN_PUPDR_PULLDOWN(15))
|
||||
#define VAL_GPIOD_ODR (PIN_ODR_LOW(0) | \
|
||||
PIN_ODR_LOW(1) | \
|
||||
PIN_ODR_LOW(2) | \
|
||||
PIN_ODR_LOW(3) | \
|
||||
PIN_ODR_LOW(6) | \
|
||||
PIN_ODR_LOW(7) | \
|
||||
PIN_ODR_LOW(8) | \
|
||||
PIN_ODR_LOW(9) | \
|
||||
PIN_ODR_LOW(10) | \
|
||||
PIN_ODR_LOW(11) | \
|
||||
PIN_ODR_LOW(12) | \
|
||||
PIN_ODR_LOW(14))
|
||||
#define VAL_GPIOD_AFRL (PIN_AFIO_AF( 0, 9U) | \
|
||||
PIN_AFIO_AF( 1, 9U) | \
|
||||
PIN_AFIO_AF( 2, 12U) | \
|
||||
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_GPIOD_AFRH (PIN_AFIO_AF( 8, 0U) | \
|
||||
PIN_AFIO_AF( 9, 0U) | \
|
||||
PIN_AFIO_AF(10, 12U) | \
|
||||
PIN_AFIO_AF(11, 12U) | \
|
||||
PIN_AFIO_AF(12, 12U) | \
|
||||
PIN_AFIO_AF(13, 0U) | \
|
||||
PIN_AFIO_AF(14, 0U) | \
|
||||
PIN_AFIO_AF(15, 0U))
|
||||
|
||||
/*
|
||||
* GPIOE setup:
|
||||
*/
|
||||
#define VAL_GPIOE_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOE_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOE_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOE_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOE_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOF setup:
|
||||
*/
|
||||
#define VAL_GPIOF_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOF_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOF_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOF_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOF_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOG setup:
|
||||
*/
|
||||
#define VAL_GPIOG_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOG_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOG_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOG_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOG_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOH setup:
|
||||
*/
|
||||
#define VAL_GPIOH_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOH_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOH_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOH_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOH_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
/*
|
||||
* GPIOI setup:
|
||||
*/
|
||||
#define VAL_GPIOI_MODER VAL_GPIO_MODER_ALL_DEFAULT
|
||||
#define VAL_GPIOI_OTYPER VAL_GPIO_OTYPER_ALL_DEFAULT
|
||||
#define VAL_GPIOI_OSPEEDR VAL_GPIO_OSPEEDR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_PUPDR VAL_GPIO_PUPDR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_ODR VAL_GPIO_ODR_ALL_DEFAULT
|
||||
#define VAL_GPIOI_AFRL VAL_GPIO_AF_ALL_DEFAULT
|
||||
#define VAL_GPIOI_AFRH VAL_GPIO_AF_ALL_DEFAULT
|
||||
|
||||
#endif /* BOARD_IO_H */
|
|
@ -1,16 +0,0 @@
|
|||
# List of all the board related files.
|
||||
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||
|
||||
# Override DEFAULT_ENGINE_TYPE
|
||||
DDEFS += -DSTM32F407xx
|
||||
DDEFS += -DSHORT_BOARD_NAME=BB_V3 -DDEFAULT_ENGINE_TYPE=MINIMAL_PINS
|
||||
DDEFS += -DFIRMWARE_ID=\"BB_V3\"
|
||||
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::Unassigned
|
||||
DDEFS += -DHAL_TRIGGER_USE_PAL=TRUE
|
||||
DDEFS += -DHAL_VSS_USE_PAL=TRUE
|
||||
|
||||
DDEFS += -DSTM32_ADC_USE_ADC3=TRUE
|
||||
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE
|
||||
|
||||
# Hardware serial port on UART 2 -> PD5/PD6 LUB PC10/PC11
|
||||
EFI_CONSOLE_TTL_PINS = -DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::C10 -DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::C11
|
|
@ -1,145 +0,0 @@
|
|||
/**
|
||||
* @file boards/coreECU/board_configuration.cpp
|
||||
*
|
||||
* @brief Configuration defaults for the coreECU board
|
||||
*
|
||||
* @author Turbo Marian, 2022
|
||||
*/
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
static void setInjectorPins() {
|
||||
engineConfiguration->injectionPins[0] = Gpio::D12;
|
||||
engineConfiguration->injectionPins[1] = Gpio::D13;
|
||||
engineConfiguration->injectionPins[2] = Gpio::D14;
|
||||
engineConfiguration->injectionPins[3] = Gpio::D15;
|
||||
engineConfiguration->injectionPins[4] = Gpio::C6;
|
||||
engineConfiguration->injectionPins[5] = Gpio::C7;
|
||||
engineConfiguration->injectionPins[6] = Gpio::C9;
|
||||
engineConfiguration->injectionPins[7] = Gpio::A8;
|
||||
}
|
||||
|
||||
static void setIgnitionPins() {
|
||||
engineConfiguration->ignitionPins[0] = Gpio::E15;
|
||||
engineConfiguration->ignitionPins[1] = Gpio::E14;
|
||||
engineConfiguration->ignitionPins[2] = Gpio::E13;
|
||||
engineConfiguration->ignitionPins[3] = Gpio::E12;
|
||||
engineConfiguration->ignitionPins[4] = Gpio::E11;
|
||||
engineConfiguration->ignitionPins[5] = Gpio::E10;
|
||||
engineConfiguration->ignitionPins[6] = Gpio::E9;
|
||||
engineConfiguration->ignitionPins[7] = Gpio::E8;
|
||||
}
|
||||
|
||||
|
||||
void setSdCardConfigurationOverrides(void) {
|
||||
}
|
||||
|
||||
void setBoardConfigOverrides(void) {
|
||||
|
||||
// TLE9201 driver
|
||||
// This chip has three control pins:
|
||||
// DIR - sets direction of the motor
|
||||
// PWM - pwm control (enable high, coast low)
|
||||
// DIS - disables motor (enable low)
|
||||
|
||||
// Throttle #1
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[0].controlPin = Gpio::E7;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[0].directionPin1 = Gpio::B1;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[0].disablePin = Gpio::B0;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// Throttle #2
|
||||
// PWM pin
|
||||
engineConfiguration->etbIo[1].controlPin = Gpio::Unassigned;
|
||||
// DIR pin
|
||||
engineConfiguration->etbIo[1].directionPin1 = Gpio::Unassigned;
|
||||
// Disable pin
|
||||
engineConfiguration->etbIo[1].disablePin = Gpio::Unassigned;
|
||||
// Unused
|
||||
engineConfiguration->etbIo[1].directionPin2 = Gpio::Unassigned;
|
||||
|
||||
// we only have pwm/dir, no dira/dirb
|
||||
engineConfiguration->etb_use_two_wires = false;
|
||||
}
|
||||
|
||||
void setPinConfigurationOverrides(void) {
|
||||
|
||||
//CAN 1 bus overwrites
|
||||
engineConfiguration->canTxPin = Gpio::D1;
|
||||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
|
||||
//CAN 2 bus overwrites
|
||||
engineConfiguration->can2RxPin = Gpio::Unassigned;
|
||||
engineConfiguration->can2TxPin = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Board-specific configuration defaults.
|
||||
*
|
||||
* See also setDefaultEngineConfiguration
|
||||
*
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
static void setupVbatt() {
|
||||
// 5.6k high side/10k low side = 1.56 ratio divider
|
||||
engineConfiguration->analogInputDividerCoefficient = 1.47f;
|
||||
|
||||
// 6.34k high side/1k low side = 9.2
|
||||
engineConfiguration->vbattDividerCoeff = (6.34f / 1.0f);
|
||||
|
||||
// Battery sense on PC4
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_14;
|
||||
|
||||
engineConfiguration->adcVcc = 3.3f;
|
||||
}
|
||||
|
||||
static void setupDefaultSensorInputs() {
|
||||
|
||||
engineConfiguration->afr.hwChannel = EFI_ADC_6;
|
||||
setEgoSensor(ES_14Point7_Free);
|
||||
|
||||
engineConfiguration->clt.config.bias_resistor = 2490;
|
||||
engineConfiguration->iat.config.bias_resistor = 2490;
|
||||
|
||||
engineConfiguration->baroSensor.hwChannel = EFI_ADC_NONE;
|
||||
|
||||
engineConfiguration->lps25BaroSensorScl = Gpio::Unassigned;
|
||||
engineConfiguration->lps25BaroSensorSda = Gpio::Unassigned;
|
||||
}
|
||||
|
||||
// PE3 is error LED, configured in board.mk
|
||||
Gpio getCommsLedPin() {
|
||||
return Gpio::B8;
|
||||
}
|
||||
|
||||
Gpio getRunningLedPin() {
|
||||
return Gpio::B7;
|
||||
}
|
||||
|
||||
Gpio getWarningLedPin() {
|
||||
return Gpio::B6;
|
||||
}
|
||||
|
||||
void setBoardDefaultConfiguration(void) {
|
||||
setInjectorPins();
|
||||
setIgnitionPins();
|
||||
setupVbatt();
|
||||
|
||||
|
||||
//engineConfiguration->sdCardPeriodMs = 50;
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
|
||||
|
||||
engineConfiguration->canWriteEnabled = true;
|
||||
engineConfiguration->canReadEnabled = true;
|
||||
engineConfiguration->canSleepPeriodMs = 50;
|
||||
|
||||
engineConfiguration->canBaudRate = B500KBPS;
|
||||
engineConfiguration->can2BaudRate = B500KBPS;
|
||||
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
gen_config_board.sh coreECU coreECU
|
||||
|
||||
pause
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
@echo off
|
||||
|
||||
cd ../../../
|
||||
make clean -j8 PROJECT_BOARD=coreECU
|
||||
make -j8 PROJECT_BOARD=coreECU PROJECT_CPU=ARCH_STM32F4
|
||||
gen_config_board.sh coreECU coreECU
|
||||
pause
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
//DO NOT EDIT MANUALLY, let automation work hard.
|
||||
|
||||
// auto-generated by PinoutLogic.java based on config\boards\coreECU\connectors\main.yaml
|
||||
#include "pch.h"
|
||||
|
||||
// see comments at declaration in pin_repository.h
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
switch(brainPin) {
|
||||
case Gpio::A14: return "Camshaft Sensor";
|
||||
case Gpio::A15: return "Crankshaft Sensor";
|
||||
case Gpio::A8: return "Injector 8";
|
||||
case Gpio::B0: return "DBW_DIS";
|
||||
case Gpio::B1: return "DBW_DIR";
|
||||
case Gpio::B12: return "Tacho output";
|
||||
case Gpio::B13: return "Idle valve 1";
|
||||
case Gpio::B14: return "Low side output 2";
|
||||
case Gpio::B15: return "Low side output 3";
|
||||
case Gpio::B9: return "Digital Input 1";
|
||||
case Gpio::C6: return "Injector 5";
|
||||
case Gpio::C7: return "Injector 6";
|
||||
case Gpio::C9: return "Injector 7";
|
||||
case Gpio::D10: return "Boost controler";
|
||||
case Gpio::D11: return "Fuel pump output";
|
||||
case Gpio::D12: return "Injector 1";
|
||||
case Gpio::D13: return "Injector 2";
|
||||
case Gpio::D14: return "Injector 3";
|
||||
case Gpio::D15: return "Injector 4";
|
||||
case Gpio::D3: return "Spare trigger input";
|
||||
case Gpio::D4: return "VSS";
|
||||
case Gpio::D5: return "Digital Input 3";
|
||||
case Gpio::D6: return "Digital Input 4";
|
||||
case Gpio::D8: return "Low side output 1";
|
||||
case Gpio::D9: return "Fan output";
|
||||
case Gpio::E0: return "Digital Input 2";
|
||||
case Gpio::E10: return "Ignition 6";
|
||||
case Gpio::E11: return "Ignition 5";
|
||||
case Gpio::E12: return "Ignition 4";
|
||||
case Gpio::E13: return "Ignition 3";
|
||||
case Gpio::E14: return "Ignition 2";
|
||||
case Gpio::E15: return "Ignition 1";
|
||||
case Gpio::E7: return "DBW_PWM";
|
||||
case Gpio::E8: return "Ignition 8";
|
||||
case Gpio::E9: return "Ignition 7";
|
||||
default: return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -1,328 +0,0 @@
|
|||
pins:
|
||||
# Low side outputs
|
||||
- pin: 1
|
||||
id: D12
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 1
|
||||
|
||||
- pin: 2
|
||||
id: D13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 2
|
||||
|
||||
- pin: 3
|
||||
id: D14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 3
|
||||
|
||||
- pin: 4
|
||||
id: D15
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 4
|
||||
|
||||
- pin: 5
|
||||
id: C6
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 5
|
||||
|
||||
- pin: 6
|
||||
id: C7
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 6
|
||||
|
||||
- pin: 7
|
||||
id: C9
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 7
|
||||
|
||||
- pin: 8
|
||||
id: A8
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: inj
|
||||
ts_name: Injector 8
|
||||
|
||||
# Low side
|
||||
|
||||
- pin: 9
|
||||
id: D10
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Boost controler
|
||||
|
||||
- pin: 10
|
||||
id: B13
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Idle valve 1
|
||||
|
||||
- pin: 11
|
||||
id: B12
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Tacho output
|
||||
|
||||
- pin: 12
|
||||
id: D8
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 1
|
||||
|
||||
- pin: 13
|
||||
id: B14
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 2
|
||||
|
||||
- pin: 14
|
||||
id: B15
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Low side output 3
|
||||
|
||||
|
||||
- pin: 15
|
||||
id: D9
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Fan output
|
||||
|
||||
- pin: 16
|
||||
id: D11
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: Fuel pump output
|
||||
|
||||
- pin: 17
|
||||
id: E7
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_PWM
|
||||
|
||||
- pin: 18
|
||||
id: B0
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_DIS
|
||||
|
||||
- pin: 19
|
||||
id: B1
|
||||
class: outputs
|
||||
function: Low Side Output
|
||||
type: ls
|
||||
ts_name: DBW_DIR
|
||||
|
||||
# High side
|
||||
|
||||
- pin: 20
|
||||
id: E15
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 1
|
||||
|
||||
- pin: 21
|
||||
id: E14
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 2
|
||||
|
||||
- pin: 22
|
||||
id: E13
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 3
|
||||
|
||||
- pin: 23
|
||||
id: E12
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 4
|
||||
|
||||
- pin: 24
|
||||
id: E11
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 5
|
||||
|
||||
- pin: 25
|
||||
id: E10
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 6
|
||||
|
||||
- pin: 26
|
||||
id: E9
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 7
|
||||
|
||||
- pin: 27
|
||||
id: E8
|
||||
class: outputs
|
||||
function: High Side Output
|
||||
type: ign
|
||||
ts_name: Ignition 8
|
||||
|
||||
# SENSORS
|
||||
|
||||
- pin: 28
|
||||
id: EFI_ADC_14
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Battery reference voltage
|
||||
|
||||
- pin: 29
|
||||
id: EFI_ADC_0
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Spare analog input 1
|
||||
|
||||
- pin: 30
|
||||
id: EFI_ADC_1
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Spare analog input 2
|
||||
|
||||
- pin: 31
|
||||
id: EFI_ADC_10
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Clt sensor
|
||||
|
||||
- pin: 32
|
||||
id: EFI_ADC_11
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Iat sensor
|
||||
|
||||
- pin: 33
|
||||
id: EFI_ADC_12
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Oilpress sensor
|
||||
|
||||
- pin: 34
|
||||
id: EFI_ADC_13
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Fuelpress sensor
|
||||
|
||||
- pin: 35
|
||||
id: EFI_ADC_4
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Spare analog input 3
|
||||
|
||||
- pin: 36
|
||||
id: EFI_ADC_5
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: MAP sensor
|
||||
|
||||
- pin: 37
|
||||
id: EFI_ADC_6
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Build-in wideband sensor
|
||||
|
||||
- pin: 38
|
||||
id: EFI_ADC_7
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: Baro sensor
|
||||
|
||||
- pin: 39
|
||||
id: [A14, A14]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Camshaft Sensor (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Camshaft Sensor
|
||||
|
||||
- pin: 40
|
||||
id: [A15, A15]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Crankshaft Sensor (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Crankshaft Sensor
|
||||
|
||||
- pin: 41
|
||||
id: [D4, D4]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: VSS (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: VSS
|
||||
|
||||
- pin: 42
|
||||
id: [D3, D3]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Spare trigger input (VR+/Hall)
|
||||
type: hall
|
||||
ts_name: Spare trigger input
|
||||
|
||||
- pin: 43
|
||||
id: EFI_ADC_15
|
||||
class: analog_inputs
|
||||
function: Sensor Input
|
||||
ts_name: TPS sensor
|
||||
|
||||
- pin: 44
|
||||
id: B9
|
||||
class: switch_inputs
|
||||
function: Digital Input
|
||||
type: hall
|
||||
ts_name: Digital Input 1
|
||||
|
||||
- pin: 45
|
||||
id: E0
|
||||
class: switch_inputs
|
||||
function: Digital Input
|
||||
type: hall
|
||||
ts_name: Digital Input 2
|
||||
|
||||
- pin: 46
|
||||
id: D5
|
||||
class: switch_inputs
|
||||
function: Digital Input
|
||||
type: hall
|
||||
ts_name: Digital Input 3
|
||||
|
||||
- pin: 47
|
||||
id: D6
|
||||
class: switch_inputs
|
||||
function: Digital Input
|
||||
type: hall
|
||||
ts_name: Digital Input 4
|
||||
|
||||
info:
|
||||
directory: coreECU
|
|
@ -1,21 +0,0 @@
|
|||
/**
|
||||
* @file knock_config.h
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// Knock is on ADC3
|
||||
#define KNOCK_ADC ADCD3
|
||||
|
||||
// knock 1 - pin PA2
|
||||
#define KNOCK_ADC_CH1 ADC_CHANNEL_IN2
|
||||
#define KNOCK_PIN_CH1 Gpio::A2
|
||||
|
||||
// knock 2 - pin PA3
|
||||
#define KNOCK_HAS_CH2 true
|
||||
#define KNOCK_ADC_CH2 ADC_CHANNEL_IN3
|
||||
#define KNOCK_PIN_CH2 Gpio::A3
|
||||
|
||||
// Sample rate & time - depends on the exact MCU
|
||||
#define KNOCK_SAMPLE_TIME ADC_SAMPLE_84
|
||||
#define KNOCK_SAMPLE_RATE (STM32_PCLK2 / (4 * (84 + 12)))
|
|
@ -1,8 +0,0 @@
|
|||
|
||||
#define ts_show_software_knock true
|
||||
|
||||
#define show_test_presets true
|
||||
#define show_microRusEFI_presets false
|
||||
#define show_Frankenso_presets false
|
||||
#define show_Hellen_presets false
|
||||
#define show_Proteus_presets false
|
|
@ -1,4 +0,0 @@
|
|||
#define SIGNATURE_DATE 2022.04.24
|
||||
#define SIGNATURE_BOARD coreECU
|
||||
// SIGNATURE_HASH is a built-in variable generated by ConfigDefinition.jar
|
||||
#define TS_SIGNATURE "rusEFI DAY58.coreECU"
|
|
@ -1,5 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
export EXTRA_PARAMS="-DDUMMY -DSHORT_BOARD_NAME=f407-discovery"
|
||||
|
||||
bash ../common_make.sh f407-discovery ARCH_STM32F4
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/alphax-2chan ARCH_STM32F4
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/alphax-4chan ARCH_STM32F4
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/alphax-8chan ARCH_STM32F4
|
||||
|
|
|
@ -8,4 +8,6 @@ DDEFS += $(LED_CRITICAL_ERROR_BRAIN_PIN)
|
|||
|
||||
PRIMARY_COMMUNICATION_PORT_USART2=-DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::D6 -DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::D5 -DTS_PRIMARY_UxART_PORT=UARTD2 -DSTM32_UART_USE_USART2=1
|
||||
|
||||
DDEFS += -DHELLEN_BOARD_ID_PIN_1=Gpio::F0 -DHELLEN_BOARD_ID_PIN_2=Gpio::F1
|
||||
|
||||
include $(BOARDS_DIR)/hellen/hellen-common.mk
|
|
@ -6,4 +6,6 @@ endif
|
|||
|
||||
DDEFS += $(LED_CRITICAL_ERROR_BRAIN_PIN)
|
||||
|
||||
DDEFS += -DHELLEN_BOARD_ID_PIN_1=Gpio::F0 -DHELLEN_BOARD_ID_PIN_2=Gpio::F1
|
||||
|
||||
include $(BOARDS_DIR)/hellen/hellen-common.mk
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
|
||||
ifeq ($(LED_CRITICAL_ERROR_BRAIN_PIN),)
|
||||
LED_CRITICAL_ERROR_BRAIN_PIN = -DLED_CRITICAL_ERROR_BRAIN_PIN=H64_LED1_RED
|
||||
endif
|
||||
|
||||
DDEFS += $(LED_CRITICAL_ERROR_BRAIN_PIN)
|
||||
|
||||
PRIMARY_COMMUNICATION_PORT_USART3=-DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::C10 -DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::C11 -DTS_PRIMARY_UxART_PORT=UARTD3 -DSTM32_UART_USE_USART3=1
|
||||
|
||||
DDEFS += -DHELLEN_BOARD_ID_PIN_1=Gpio::C2 -DHELLEN_BOARD_ID_PIN_2=Gpio::C3
|
||||
|
||||
include $(BOARDS_DIR)/hellen/hellen-common.mk
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/hellen-nb1 ARCH_STM32F4
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/hellen64_miataNA6_94 ARCH_STM32F4
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/hellen72 ARCH_STM32F4
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/hellenNA8_96 ARCH_STM32F4
|
||||
|
|
|
@ -304,13 +304,12 @@ bool HellenBoardIdFinder<NumPins>::measureChargingTimesAveraged(int i, float & T
|
|||
|
||||
int detectHellenBoardId() {
|
||||
int boardId = -1;
|
||||
#if EFI_PROD_CODE
|
||||
#ifdef HELLEN_BOARD_ID_PIN_1
|
||||
efiPrintf("Starting Hellen Board ID detection...");
|
||||
efitick_t beginNt = getTimeNowNt();
|
||||
|
||||
// Hellen boards use Gpio::F0 and Gpio::F1.
|
||||
const int numPins = 2;
|
||||
Gpio rPins[numPins] = { Gpio::F0, Gpio::F1 };
|
||||
Gpio rPins[numPins] = { HELLEN_BOARD_ID_PIN_1, HELLEN_BOARD_ID_PIN_2};
|
||||
|
||||
// We start from the estimated capacitance, but the real one can be +-10%
|
||||
float C = HELLEN_BOARD_ID_CAPACITOR;
|
||||
|
@ -381,6 +380,6 @@ int detectHellenBoardId() {
|
|||
}
|
||||
|
||||
efiPrintf("* RESULT: BoardId = %d, R1 = %.0f, R2 = %.0f (Elapsed time: %d ms)", boardId, R[0], R[1], elapsed_Ms);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
#endif /* HELLEN_BOARD_ID_PIN_1 */
|
||||
return boardId;
|
||||
}
|
||||
|
|
|
@ -13,12 +13,45 @@ void setHellenCan() {
|
|||
engineConfiguration->canRxPin = Gpio::D0;
|
||||
}
|
||||
|
||||
void setHellen64Can() {
|
||||
engineConfiguration->canTxPin = Gpio::B9;
|
||||
engineConfiguration->canRxPin = Gpio::B8;
|
||||
}
|
||||
|
||||
void setHellenEnPin(Gpio pin) {
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
megaEn.initPin("EN", pin);
|
||||
megaEn.setValue(1);
|
||||
}
|
||||
}
|
||||
|
||||
void setHellenMegaEnPin() {
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
megaEn.initPin("mm-EN", H144_GP8); // OUT_PWR_EN
|
||||
megaEn.setValue(1);
|
||||
setHellenEnPin(H144_GP8); // OUT_PWR_EN
|
||||
}
|
||||
|
||||
void setHellen64MegaEnPin() {
|
||||
setHellenEnPin(H64_IO1); // OUT_PWR_EN
|
||||
}
|
||||
|
||||
void hellenBoardStandBy() {
|
||||
// we need to turn 'megaEn' and pause for a bit to make sure that WBO is off and does not wake main firmware right away
|
||||
megaEn.setValue(0);
|
||||
// todo: 200ms is totally random what's the science for this sleep duration?
|
||||
chThdSleepMilliseconds(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* dirty hack
|
||||
*/
|
||||
void configureHellenMegaAccCS2Pin() {
|
||||
static bool initialized = false;
|
||||
static OutputPin cs2pin;
|
||||
if (!initialized) {
|
||||
initialized = true;
|
||||
cs2pin.initPin("mm-CS2", H_SPI1_CS2);
|
||||
cs2pin.setValue(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
Gpio getCommsLedPin() {
|
||||
return H64_LED2_BLUE;
|
||||
}
|
||||
|
||||
Gpio getWarningLedPin() {
|
||||
// this board has no warning led
|
||||
return Gpio::Unassigned;
|
||||
}
|
||||
|
||||
Gpio getRunningLedPin() {
|
||||
// this board has no running led
|
||||
return Gpio::Unassigned;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
|
||||
|
||||
DDEFS += -DFIRMWARE_ID=\"small-can-board\"
|
||||
DDEFS += -DSHORT_BOARD_NAME=small-can-board -DSTATIC_BOARD_ID=STATIC_BOARD_ID_SMALL_CAN_BOARD
|
||||
|
||||
#DDEFS += -DEFI_SENT_SUPPORT=TRUE
|
||||
|
||||
DDEFS += -DEFI_SENSOR_CHART=FALSE
|
||||
DDEFS += -DLUA_USER_HEAP=50000
|
||||
DDEFS += -DEFI_LOGIC_ANALYZER=FALSE
|
||||
DDEFS += -DEFI_MALFUNCTION_INDICATOR=FALSE
|
||||
DDEFS += -DEFI_ENGINE_SNIFFER=FALSE
|
||||
DDEFS += -DEFI_TCU=FALSE
|
||||
DDEFS += -DEFI_ENGINE_EMULATOR=FALSE
|
||||
DDEFS += -DEFI_SHAFT_POSITION_INPUT=FALSE
|
||||
DDEFS += -DEFI_ALTERNATOR_CONTROL=FALSE
|
||||
DDEFS += -DEFI_VVT_PID=FALSE
|
||||
DDEFS += -DEFI_EMULATE_POSITION_SENSORS=FALSE
|
||||
DDEFS += -DEFI_MAP_AVERAGING=FALSE
|
||||
DDEFS += -DEFI_HPFP=FALSE
|
||||
DDEFS += -DEFI_TOOTH_LOGGER=FALSE
|
||||
DDEFS += -DRAM_UNUSED_SIZE=100
|
||||
|
||||
DDEFS += -DHW_SMALL_CAN_BOARD=1
|
||||
|
||||
#Mass Storage
|
||||
DDEFS += -DEFI_EMBED_INI_MSD=FALSE -DEFI_FILE_LOGGING=FALSE
|
||||
USE_FATFS = no
|
||||
|
||||
#DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART3)
|
||||
|
||||
#DDEFS += -DEFI_KLINE=TRUE
|
||||
DDEFS += -DKLINE_SERIAL_DEVICE_RX=Gpio::С7 -DKLINE_SERIAL_DEVICE_TX=Gpio::С6
|
||||
DDEFS += -DKLINE_SERIAL_DEVICE=SD6
|
||||
DDEFS += -DSTM32_SERIAL_USE_USART6=TRUE
|
||||
|
||||
include $(BOARDS_DIR)/hellen/hellen-common64.mk
|
|
@ -0,0 +1,32 @@
|
|||
#include "pch.h"
|
||||
#include "hellen_meta.h"
|
||||
|
||||
#include "hellen_leds_64.cpp"
|
||||
|
||||
void setBoardConfigOverrides() {
|
||||
setHellen64Can();
|
||||
setHellen64MegaEnPin();
|
||||
setHellen64SdCardSpi1();
|
||||
|
||||
// 4.7k high side/4.7k low side = 2.0 ratio divider
|
||||
engineConfiguration->analogInputDividerCoefficient = 2.0f;
|
||||
|
||||
// 33k / 6.8k = 5.835
|
||||
engineConfiguration->vbattDividerCoeff = (33 + 6.8) / 6.8;
|
||||
engineConfiguration->vbattAdcChannel = EFI_ADC_11;
|
||||
|
||||
// Force I/O for Lua - so no TS is required
|
||||
engineConfiguration->luaOutputPins[0] = H64_OUT_PWM1;
|
||||
engineConfiguration->luaOutputPins[1] = H64_OUT_PWM2;
|
||||
engineConfiguration->luaOutputPins[2] = H64_OUT_PWM3;
|
||||
engineConfiguration->luaOutputPins[3] = H64_OUT_PWM4;
|
||||
|
||||
engineConfiguration->auxAnalogInputs[0] = EFI_ADC_2;
|
||||
engineConfiguration->auxAnalogInputs[1] = EFI_ADC_3;
|
||||
engineConfiguration->auxAnalogInputs[2] = EFI_ADC_4;
|
||||
engineConfiguration->auxAnalogInputs[3] = EFI_ADC_5;
|
||||
engineConfiguration->auxAnalogInputs[4] = EFI_ADC_6;
|
||||
engineConfiguration->auxAnalogInputs[5] = EFI_ADC_7;
|
||||
engineConfiguration->auxAnalogInputs[6] = EFI_ADC_14;
|
||||
engineConfiguration->auxAnalogInputs[7] = EFI_ADC_15;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# export USE_OPENBLT=yes
|
||||
|
||||
cd ..
|
||||
bash ../common_make.sh hellen/small-can-board ARCH_STM32F4
|
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
|
@ -0,0 +1,18 @@
|
|||
//DO NOT EDIT MANUALLY, let automation work hard.
|
||||
|
||||
// auto-generated by PinoutLogic.java based on config/boards/hellen/small-can-board/connectors/small.yaml
|
||||
#include "pch.h"
|
||||
|
||||
// see comments at declaration in pin_repository.h
|
||||
const char * getBoardSpecificPinName(brain_pin_e brainPin) {
|
||||
switch(brainPin) {
|
||||
case Gpio::C8: return "C1 - Low Side";
|
||||
case Gpio::E12: return "C3 - Digital Input 2";
|
||||
case Gpio::E14: return "C2 - Digital Input 1";
|
||||
case Gpio::F11: return "C4 - Digital Input 3";
|
||||
case Gpio::G7: return "A8 - Low Side";
|
||||
case Gpio::G8: return "B8 - Low Side";
|
||||
default: return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
|
@ -0,0 +1,199 @@
|
|||
meta: config/boards/hellen_meta.h
|
||||
|
||||
pins:
|
||||
- pin: A1
|
||||
function: Power Ground
|
||||
type: gnd
|
||||
color: black
|
||||
|
||||
- pin: A2
|
||||
id: EFI_ADC_5
|
||||
class: analog_inputs
|
||||
function: +12V
|
||||
ts_name: A2 Battery Sense
|
||||
type: 12v
|
||||
color: red
|
||||
|
||||
- pin: A3
|
||||
id: C6
|
||||
function: CAN bus2 high (CANH2)
|
||||
type: can
|
||||
ts_name: A3 - CAN2 High
|
||||
color: black
|
||||
|
||||
- pin: A4
|
||||
id: C7
|
||||
type: can
|
||||
function: CAN bus2 low (CANL2)
|
||||
ts_name: A4 - CAN2 Low
|
||||
color: yellow
|
||||
|
||||
- pin: A5
|
||||
function: Sensor Ground
|
||||
type: gnd
|
||||
color: brown
|
||||
|
||||
- pin: A6
|
||||
class: outputs
|
||||
function: LIN bus
|
||||
ts_name: A6 - Lin Bus
|
||||
color: yellow
|
||||
|
||||
- pin: A8
|
||||
# H144_LS_1
|
||||
id: G7
|
||||
function: Low Side Output 1 5A
|
||||
class: outputs
|
||||
ts_name: A8 - Low Side
|
||||
color: green
|
||||
|
||||
- pin: B2
|
||||
# H144_IN_MAP2 AIN10 PC1
|
||||
id: EFI_ADC_11
|
||||
class: analog_inputs
|
||||
function: Analog input 1
|
||||
ts_name: B2 - Analog input
|
||||
color: orange
|
||||
|
||||
- pin: B4
|
||||
# H144_IN_O2S2 AIN12 PA1
|
||||
id: EFI_ADC_1
|
||||
class: analog_inputs
|
||||
function: Analog input 2
|
||||
ts_name: B4 - Analog input
|
||||
color: orange
|
||||
|
||||
- pin: B8
|
||||
# H144_LS_2
|
||||
id: G8
|
||||
function: Low Side Output 2 5A
|
||||
class: outputs
|
||||
type: inj
|
||||
ts_name: B8 - Low Side
|
||||
color: blue
|
||||
|
||||
- pin: C1
|
||||
# H144_OUT_PWM4
|
||||
id: C8
|
||||
class: outputs
|
||||
function: Low Side Output 3 5A
|
||||
type: ls
|
||||
ts_name: C1 - Low Side
|
||||
color: purple
|
||||
|
||||
- pin: C2
|
||||
# H144_IN_D_3
|
||||
id: [E14, E14]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Digital Input 1
|
||||
type: hall
|
||||
ts_name: C2 - Digital Input 1
|
||||
|
||||
- pin: C3
|
||||
# H144_IN_D_1
|
||||
id: [E12, E12]
|
||||
class: [event_inputs, switch_inputs]
|
||||
function: Digital Input 2 / SENT
|
||||
type: hall
|
||||
ts_name: C3 - Digital Input 2
|
||||
|
||||
- pin: C4
|
||||
# H144_IN_VSS
|
||||
id: F11
|
||||
class: switch_inputs
|
||||
function: Digital Input 3
|
||||
type: hall
|
||||
ts_name: C4 - Digital Input 3
|
||||
color: gray
|
||||
|
||||
- pin: C5
|
||||
function: CAN bus high (CANH)
|
||||
type: can
|
||||
color: green
|
||||
|
||||
- pin: C6
|
||||
function: CAN bus low (CANL)
|
||||
type: can
|
||||
color: blue
|
||||
|
||||
info:
|
||||
title: Small CAN
|
||||
name: Small CAN
|
||||
directory: hellen/small-can-board
|
||||
image:
|
||||
file: alphax-2chan.jpg
|
||||
pins:
|
||||
- pin: A8
|
||||
x: 316
|
||||
y: 239
|
||||
- pin: A7
|
||||
x: 413
|
||||
y: 239
|
||||
- pin: A6
|
||||
x: 489
|
||||
y: 239
|
||||
- pin: A5
|
||||
x: 564
|
||||
y: 239
|
||||
- pin: A4
|
||||
x: 635
|
||||
y: 239
|
||||
- pin: A3
|
||||
x: 710
|
||||
y: 239
|
||||
- pin: A2
|
||||
x: 786
|
||||
y: 239
|
||||
- pin: A1
|
||||
x: 882
|
||||
y: 239
|
||||
|
||||
- pin: B8
|
||||
x: 316
|
||||
y: 352
|
||||
- pin: B7
|
||||
x: 413
|
||||
y: 352
|
||||
- pin: B6
|
||||
x: 489
|
||||
y: 352
|
||||
- pin: B5
|
||||
x: 564
|
||||
y: 352
|
||||
- pin: B4
|
||||
x: 635
|
||||
y: 352
|
||||
- pin: B3
|
||||
x: 710
|
||||
y: 352
|
||||
- pin: B2
|
||||
x: 786
|
||||
y: 352
|
||||
- pin: B1
|
||||
x: 882
|
||||
y: 352
|
||||
|
||||
- pin: C8
|
||||
x: 316
|
||||
y: 466
|
||||
- pin: C7
|
||||
x: 413
|
||||
y: 466
|
||||
- pin: C6
|
||||
x: 489
|
||||
y: 466
|
||||
- pin: C5
|
||||
x: 564
|
||||
y: 466
|
||||
- pin: C4
|
||||
x: 635
|
||||
y: 466
|
||||
- pin: C3
|
||||
x: 710
|
||||
y: 466
|
||||
- pin: C2
|
||||
x: 786
|
||||
y: 466
|
||||
- pin: C1
|
||||
x: 882
|
||||
y: 466
|
|
@ -0,0 +1,6 @@
|
|||
#define ts_show_egt false
|
||||
|
||||
#define ts_show_etb_pins false
|
||||
#define ts_show_analog_divider false
|
||||
|
||||
#define LUA_SCRIPT_SIZE 25000
|
|
@ -0,0 +1 @@
|
|||
https://rusefi.com/forum/viewtopic.php?f=4&t=2570
|
|
@ -7,18 +7,52 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// see https://github.com/andreika-git/hellen-one/blob/master/board_id/board_ids.csv
|
||||
#define BOARD_ID_154hyundai_c 10
|
||||
#define BOARD_ID_154hyundai_d 201
|
||||
|
||||
#define BOARD_ID_2chan_b 3
|
||||
#define BOARD_ID_2chan_c 5
|
||||
#define BOARD_ID_2chan_d 107
|
||||
// mega-module starts here
|
||||
#define BOARD_ID_2chan_e 112
|
||||
#define BOARD_ID_2chan_f 115
|
||||
#define BOARD_ID_2chan_g 210
|
||||
|
||||
#define BOARD_ID_4chan_d 103
|
||||
#define BOARD_ID_4chan_e 105
|
||||
#define BOARD_ID_4chan_f 113
|
||||
#define BOARD_ID_4chan_g 203
|
||||
#define BOARD_ID_4chan_h 114
|
||||
|
||||
void hellenWbo();
|
||||
|
||||
void setHellenMegaEnPin();
|
||||
void setHellenEnPin(Gpio pin);
|
||||
void setHellen64MegaEnPin();
|
||||
void hellenBoardStandBy();
|
||||
void configureHellenMegaAccCS2Pin();
|
||||
void configureHellenCanTerminator();
|
||||
|
||||
void setHellenCan();
|
||||
void setHellen64Can();
|
||||
|
||||
int detectHellenBoardId();
|
||||
void detectHellenBoardType();
|
||||
|
||||
#define H64_LED1_RED Gpio::B0
|
||||
#define H64_LED2_BLUE Gpio::B1
|
||||
|
||||
#define H64_IO1 Gpio::C13
|
||||
#define H64_SPI1_CS1 Gpio::D2
|
||||
|
||||
#define H64_OUT_PWM1 Gpio::B7
|
||||
#define H64_OUT_PWM2 Gpio::C8
|
||||
#define H64_OUT_PWM3 Gpio::C9
|
||||
#define H64_OUT_PWM4 Gpio::A8
|
||||
#define H64_OUT_PWM5 Gpio::A9
|
||||
#define H64_OUT_PWM6 Gpio::A15
|
||||
|
||||
// stm32 UART8
|
||||
#define H144_UART1_RX Gpio::E0
|
||||
#define H144_UART1_TX Gpio::E1
|
||||
|
@ -32,6 +66,8 @@ void detectHellenBoardType();
|
|||
#define H144_LED3 Gpio::E7
|
||||
#define H144_LED4 Gpio::E8
|
||||
|
||||
#define H144_USB1ID Gpio::A10
|
||||
|
||||
#define H176_LED1_RED Gpio::H8
|
||||
|
||||
#define H144_LS_1 Gpio::G7
|
||||
|
@ -115,12 +151,16 @@ void detectHellenBoardType();
|
|||
// VIGN PA5
|
||||
#define H144_IN_VBATT EFI_ADC_5
|
||||
|
||||
// muxed
|
||||
#define H144_IN_TPS2 EFI_ADC_20
|
||||
|
||||
// IN_MAP1 AIN9 PC0
|
||||
#define H144_IN_MAP1 EFI_ADC_10
|
||||
// AIN10 PC1
|
||||
#define H144_IN_MAP2 EFI_ADC_11
|
||||
// AIN15 A15 PA2
|
||||
#define H144_IN_MAP3 EFI_ADC_2
|
||||
#define H144_IN_MAP3_DIGITAL Gpio::A2
|
||||
|
||||
// AIN7
|
||||
#define H144_IN_RES1 Gpio::F9
|
||||
|
@ -157,9 +197,9 @@ void detectHellenBoardType();
|
|||
// IN_O2S2 AIN12 PA1
|
||||
#define H144_IN_O2S2 EFI_ADC_1
|
||||
|
||||
// IN_D1(old) or IN_DIG8(new)
|
||||
// IN_D1(old) or IN_DIG8(new/mega-module)
|
||||
#define H144_IN_D_1 Gpio::E12
|
||||
// IN_D2(old) or IN_DIG9(new)
|
||||
// IN_D2(old) or IN_DIG9(new/mm)
|
||||
#define H144_IN_D_2 Gpio::E13
|
||||
// IN_D3(old) or IN_DIG10(new)
|
||||
#define H144_IN_D_3 Gpio::E14
|
||||
|
@ -211,16 +251,27 @@ void detectHellenBoardType();
|
|||
#define H_SPI3_SCK Gpio::C10
|
||||
#define H_SPI3_CS Gpio::A15
|
||||
|
||||
static void setHellenSdCardSpi1() {
|
||||
static void setHellenSdCardSpi1NoCS() {
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_1;
|
||||
engineConfiguration->spi1mosiPin = H_SPI1_MOSI;
|
||||
engineConfiguration->spi1misoPin = H_SPI1_MISO;
|
||||
engineConfiguration->spi1sckPin = H_SPI1_SCK;
|
||||
engineConfiguration->sdCardCsPin = H_SPI1_CS1;
|
||||
engineConfiguration->is_enabled_spi_1 = true;
|
||||
}
|
||||
|
||||
static void setHellenSdCardSpi1() {
|
||||
setHellenSdCardSpi1NoCS();
|
||||
engineConfiguration->sdCardCsPin = H_SPI1_CS1;
|
||||
}
|
||||
|
||||
static void setHellen64SdCardSpi1() {
|
||||
setHellenSdCardSpi1NoCS();
|
||||
engineConfiguration->sdCardCsPin = H64_SPI1_CS1;
|
||||
}
|
||||
|
||||
static void setHellenSdCardSpi2() {
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_2;
|
||||
engineConfiguration->spi2mosiPin = H_SPI2_MOSI;
|
||||
engineConfiguration->spi2misoPin = H_SPI2_MISO;
|
||||
|
@ -230,6 +281,7 @@ static void setHellenSdCardSpi2() {
|
|||
}
|
||||
|
||||
static void setHellenSdCardSpi3() {
|
||||
engineConfiguration->isSdCardEnabled = true;
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
||||
engineConfiguration->spi3mosiPin = H_SPI3_MOSI;
|
||||
engineConfiguration->spi3misoPin = H_SPI3_MISO;
|
||||
|
@ -245,3 +297,8 @@ static void setDefaultHellenAtPullUps(){
|
|||
engineConfiguration->clt.config.bias_resistor = HELLEN_DEFAULT_AT_PULLUP;
|
||||
engineConfiguration->iat.config.bias_resistor = HELLEN_DEFAULT_AT_PULLUP;
|
||||
}
|
||||
|
||||
static void setHellenMMbaro() {
|
||||
engineConfiguration->lps25BaroSensorScl = Gpio::B10;
|
||||
engineConfiguration->lps25BaroSensorSda = Gpio::B11;
|
||||
}
|
||||
|
|
|
@ -202,10 +202,18 @@ void setBoardDefaultConfiguration() {
|
|||
engineConfiguration->injectionMode = IM_SIMULTANEOUS;//IM_BATCH;// IM_SEQUENTIAL;
|
||||
}
|
||||
|
||||
static Gpio MRE_OUTPUTS[] = {
|
||||
MRE_INJ_1,
|
||||
MRE_INJ_2,
|
||||
MRE_INJ_3,
|
||||
MRE_INJ_4,
|
||||
MRE_LS_1,
|
||||
};
|
||||
|
||||
int getBoardMetaOutputsCount() {
|
||||
return efi::size(MRE_OUTPUTS);
|
||||
return efi::size(MRE_OUTPUTS);
|
||||
}
|
||||
|
||||
Gpio* getBoardMetaOutputs() {
|
||||
return MRE_OUTPUTS;
|
||||
return MRE_OUTPUTS;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
bash ../common_make.sh microrusefi ARCH_STM32F7
|
||||
|
|
|
@ -53,13 +53,3 @@
|
|||
|
||||
// 28 - AN volt 10
|
||||
#define MRE_IN_ANALOG_VOLT_10 EFI_ADC_4
|
||||
|
||||
#if HW_MICRO_RUSEFI
|
||||
static Gpio MRE_OUTPUTS[] = {
|
||||
MRE_INJ_1,
|
||||
MRE_INJ_2,
|
||||
MRE_INJ_3,
|
||||
MRE_INJ_4,
|
||||
MRE_LS_1,
|
||||
};
|
||||
#endif // HW_MICRO_RUSEFI
|
|
@ -11,6 +11,11 @@ Gpio getRunningLedPin() {
|
|||
return Gpio::B0;
|
||||
}
|
||||
|
||||
Gpio getWarningLedPin() {
|
||||
// this board has no warning led
|
||||
return Gpio::Unassigned;
|
||||
}
|
||||
|
||||
void preHalInit() {
|
||||
efiSetPadMode("Ethernet", Gpio::A1, PAL_MODE_ALTERNATE(0xb));
|
||||
efiSetPadMode("Ethernet", Gpio::A2, PAL_MODE_ALTERNATE(0xb));
|
||||
|
|
|
@ -185,10 +185,29 @@ void boardPrepareForStop() {
|
|||
palEnableLineEvent(PAL_LINE(GPIOD, 0), PAL_EVENT_MODE_RISING_EDGE);
|
||||
}
|
||||
|
||||
static Gpio PROTEUS_OUTPUTS[] = {
|
||||
PROTEUS_LS_1,
|
||||
PROTEUS_LS_2,
|
||||
PROTEUS_LS_3,
|
||||
PROTEUS_LS_4,
|
||||
PROTEUS_LS_5,
|
||||
PROTEUS_LS_6,
|
||||
PROTEUS_LS_7,
|
||||
PROTEUS_LS_8,
|
||||
PROTEUS_LS_9,
|
||||
PROTEUS_LS_10,
|
||||
PROTEUS_LS_11,
|
||||
PROTEUS_LS_12,
|
||||
PROTEUS_LS_13,
|
||||
PROTEUS_LS_14,
|
||||
PROTEUS_LS_15,
|
||||
PROTEUS_LS_16,
|
||||
};
|
||||
|
||||
int getBoardMetaOutputsCount() {
|
||||
return efi::size(PROTEUS_OUTPUTS);
|
||||
return efi::size(PROTEUS_OUTPUTS);
|
||||
}
|
||||
|
||||
Gpio* getBoardMetaOutputs() {
|
||||
return PROTEUS_OUTPUTS;
|
||||
return PROTEUS_OUTPUTS;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
# does not fit into 512K flash, and we use 512K because of st DFU client bug :(
|
||||
# export USE_OPENBLT=yes
|
||||
export USE_OPENBLT=yes
|
||||
|
||||
bash ../common_make.sh proteus ARCH_STM32F7
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue