-
-
Notifications
You must be signed in to change notification settings - Fork 46
add APEX board #564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TurboMarian
wants to merge
1
commit into
FOME-Tech:master
Choose a base branch
from
TurboMarian:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add APEX board #564
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # List of all the board related files. | ||
| BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp | ||
|
|
||
| # Override DEFAULT_ENGINE_TYPE | ||
|
|
||
| DDEFS += -DFIRMWARE_ID=\"APEX\" | ||
| IS_STM32F429 = yes | ||
|
|
||
| DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE -DSTM32_ADC_USE_ADC3=TRUE | ||
| DDEFS += -DEFI_CONSOLE_TX_BRAIN_PIN=Gpio::D5 -DEFI_CONSOLE_RX_BRAIN_PIN=Gpio::D6 -DTS_PRIMARY_UxART_PORT=UARTD2 -DSTM32_UART_USE_USART2=1 | ||
| # EGT chip | ||
| DDEFS += -DEFI_MAX_31855=TRUE | ||
|
|
||
| SHORT_BOARD_NAME = apex | ||
|
|
||
| # 48K would not fit | ||
| # DDEFS += -DLUA_USER_HEAP=45000 need to be done in efifutures.h | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| /** | ||
| * @file boards/apex/board_configuration.cpp | ||
| * | ||
| * @brief Configuration defaults for the core48 board | ||
| * | ||
| * @author Turbo Marian, 2022 | ||
| */ | ||
|
|
||
| #include "pch.h" | ||
|
|
||
| static void setInjectorPins() { | ||
| engineConfiguration->injectionPinMode = OM_DEFAULT; | ||
|
|
||
| engineConfiguration->injectionPins[0] = Gpio::G6; | ||
| engineConfiguration->injectionPins[1] = Gpio::G5; | ||
| engineConfiguration->injectionPins[2] = Gpio::G4; | ||
| engineConfiguration->injectionPins[3] = Gpio::G3; | ||
| engineConfiguration->injectionPins[4] = Gpio::G2; | ||
| engineConfiguration->injectionPins[5] = Gpio::D15; | ||
| engineConfiguration->injectionPins[6] = Gpio::D14; | ||
| 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::E9; | ||
| engineConfiguration->ignitionPins[7] = Gpio::E8; | ||
| } | ||
|
|
||
|
|
||
| // PE3 is error LED, configured in board.mk | ||
| Gpio getCommsLedPin() { | ||
| return Gpio::B7; | ||
| } | ||
|
|
||
| Gpio getRunningLedPin() { | ||
| return Gpio::B8; | ||
| } | ||
|
|
||
| Gpio getWarningLedPin() { | ||
| return Gpio::B9; | ||
| } | ||
|
|
||
| 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::E7; | ||
| // DIR pin | ||
| engineConfiguration->etbIo[0].directionPin1 = Gpio::G0; | ||
| // Disable pin | ||
| engineConfiguration->etbIo[0].disablePin = Gpio::G1; | ||
| // Unused | ||
| engineConfiguration->etbIo[0].directionPin2 = Gpio::Unassigned; | ||
|
|
||
| // Throttle #2 | ||
| // PWM pin | ||
| engineConfiguration->etbIo[1].controlPin = Gpio::F15; | ||
| // DIR pin | ||
| engineConfiguration->etbIo[1].directionPin1 = Gpio::F13; | ||
| // Disable pin | ||
| engineConfiguration->etbIo[1].disablePin = Gpio::F14; | ||
| // 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.6f; | ||
|
|
||
| // 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::Unassigned; | ||
| engineConfiguration->idle.stepperStepPin = Gpio::Unassigned; | ||
| engineConfiguration->stepperEnablePin = Gpio::Unassigned; | ||
| } | ||
|
|
||
| static void setupSdCard() { | ||
|
|
||
| //SD CARD overwrites | ||
| engineConfiguration->sdCardSpiDevice = SPI_DEVICE_2; | ||
|
|
||
| engineConfiguration->is_enabled_spi_2 = true; | ||
| engineConfiguration->spi2sckPin = Gpio::B13; | ||
| engineConfiguration->spi2misoPin = Gpio::B14; | ||
| engineConfiguration->spi2mosiPin = Gpio::B15; | ||
| } | ||
|
|
||
| static void setupEGT() { | ||
|
|
||
| //EGT overwrites | ||
|
|
||
| engineConfiguration->spi1sckPin = Gpio::B3; | ||
| engineConfiguration->spi1misoPin = Gpio::B4; | ||
| engineConfiguration->spi1mosiPin = Gpio::Unassigned; | ||
| engineConfiguration->is_enabled_spi_1 = true; | ||
|
|
||
| engineConfiguration->max31855spiDevice = SPI_DEVICE_1; | ||
| engineConfiguration->max31855_cs[0] = Gpio::D2; | ||
| engineConfiguration->max31855_cs[1] = Gpio::D3; | ||
| } | ||
|
|
||
|
|
||
| void setBoardConfigOverrides() { | ||
| setupVbatt(); | ||
| setupSdCard(); | ||
| setEtbConfig(); | ||
| setStepperConfig(); | ||
| setupEGT(); | ||
|
|
||
| engineConfiguration->clt.config.bias_resistor = 2490; | ||
| engineConfiguration->iat.config.bias_resistor = 2490; | ||
|
|
||
| //SERIAL | ||
| engineConfiguration->binarySerialTxPin = Gpio::D5; | ||
| engineConfiguration->binarySerialRxPin = Gpio::D6; | ||
| engineConfiguration->tunerStudioSerialSpeed = 230400; | ||
| //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::A8; | ||
| engineConfiguration->lps25BaroSensorSda = Gpio::C9; | ||
| } | ||
|
|
||
| static void setupDefaultSensorInputs() { | ||
|
|
||
| engineConfiguration->afr.hwChannel = EFI_ADC_11; //PC1 | ||
| engineConfiguration->afr.hwChannel2 = EFI_ADC_10; //PC0 | ||
| setEgoSensor(ES_14Point7_Free); | ||
|
|
||
| engineConfiguration->map.sensor.hwChannel = EFI_ADC_12; //PC2 | ||
| 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; | ||
|
|
||
| engineConfiguration->sdCardCsPin = Gpio::G7; | ||
|
|
||
| strncpy(config->luaScript, R"( | ||
|
|
||
| function onTick() | ||
|
|
||
| end | ||
|
|
||
| )", efi::size(config->luaScript)); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
|
|
||
| export USE_OPENBLT=no | ||
|
|
||
| bash ../common_make.sh APEX ARCH_STM32F4 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
55 changes: 55 additions & 0 deletions
55
firmware/config/boards/APEX/connectors/generated_outputs.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| //DO NOT EDIT MANUALLY, let automation work hard. | ||
|
|
||
| // auto-generated by PinoutLogic.java based on config/boards/APEX/connectors/main.yaml | ||
| #pragma once | ||
|
|
||
| Gpio GENERATED_OUTPUTS = { | ||
| Gpio::G6, // Injector 1 | ||
| Gpio::G5, // Injector 2 | ||
| Gpio::G4, // Injector 3 | ||
| Gpio::G3, // Injector 4 | ||
| Gpio::G2, // Injector 5 | ||
| Gpio::D15, // Injector 6 | ||
| Gpio::D14, // Injector 7 | ||
| Gpio::D13, // Injector 8 | ||
| Gpio::D12, // AUX 1 | ||
| Gpio::D11, // AUX 2 | ||
| Gpio::D10, // AUX 3 | ||
| Gpio::D9, // AUX 4 (TACHO) | ||
| Gpio::D8, // AUX 5 | ||
| Gpio::B12, // AUX 6 | ||
| Gpio::B11, // AUX 7 | ||
| Gpio::B10, // AUX 8 | ||
| Gpio::E15, // Ignition 1 | ||
| Gpio::E14, // Ignition 2 | ||
| Gpio::E13, // Ignition 3 | ||
| Gpio::E12, // Ignition 4 | ||
| Gpio::E11, // Ignition 5 | ||
| Gpio::E10, // Ignition 6 | ||
| Gpio::E9, // Ignition 7 | ||
| Gpio::E8, // Ignition 8 | ||
| // "Injector 1", | ||
| // "Injector 2", | ||
| // "Injector 3", | ||
| // "Injector 4", | ||
| // "Injector 5", | ||
| // "Injector 6", | ||
| // "Injector 7", | ||
| // "Injector 8", | ||
| // "AUX 1", | ||
| // "AUX 2", | ||
| // "AUX 3", | ||
| // "AUX 4 (TACHO)", | ||
| // "AUX 5", | ||
| // "AUX 6", | ||
| // "AUX 7", | ||
| // "AUX 8", | ||
| // "Ignition 1", | ||
| // "Ignition 2", | ||
| // "Ignition 3", | ||
| // "Ignition 4", | ||
| // "Ignition 5", | ||
| // "Ignition 6", | ||
| // "Ignition 7", | ||
| // "Ignition 8", | ||
| } | ||
Empty file.
48 changes: 48 additions & 0 deletions
48
firmware/config/boards/APEX/connectors/generated_ts_name_by_pin.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| //DO NOT EDIT MANUALLY, let automation work hard. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't check in generated files |
||
|
|
||
| // auto-generated by PinoutLogic.java based on /home/gmx/fome-fw/firmware/config/boards/APEX/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::B10: return "AUX 8"; | ||
| case Gpio::B11: return "AUX 7"; | ||
| case Gpio::B12: return "AUX 6"; | ||
| case Gpio::C13: return "Spare trigger input 2"; | ||
| case Gpio::D10: return "AUX 3"; | ||
| case Gpio::D11: return "AUX 2"; | ||
| case Gpio::D12: return "AUX 1"; | ||
| case Gpio::D13: return "Injector 8"; | ||
| case Gpio::D14: return "Injector 7"; | ||
| case Gpio::D15: return "Injector 6"; | ||
| case Gpio::D8: return "AUX 5"; | ||
| case Gpio::D9: return "AUX 4 (TACHO)"; | ||
| case Gpio::E0: return "Digital Input 2"; | ||
| case Gpio::E1: return "Digital Input 1"; | ||
| 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::E2: return "Digital Input 3"; | ||
| case Gpio::E3: return "Digital Input 4"; | ||
| case Gpio::E4: return "Spare trigger input 1"; | ||
| case Gpio::E5: return "Camshaft Sensor"; | ||
| case Gpio::E6: return "Crankshaft Sensor"; | ||
| case Gpio::E8: return "Ignition 8"; | ||
| case Gpio::E9: return "Ignition 7"; | ||
| case Gpio::F0: return "Digital Input 5"; | ||
| case Gpio::F1: return "Digital Input 6"; | ||
| case Gpio::F2: return "Digital Input 7"; | ||
| case Gpio::F6: return "Digital Input 8"; | ||
| case Gpio::G2: return "Injector 5"; | ||
| case Gpio::G3: return "Injector 4"; | ||
| case Gpio::G4: return "Injector 3"; | ||
| case Gpio::G5: return "Injector 2"; | ||
| case Gpio::G6: return "Injector 1"; | ||
| default: return nullptr; | ||
| } | ||
| return nullptr; | ||
| } | ||
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't check in generated files