Skip to content

Commit

Permalink
set MRE overrides for spi2/3 pins (rusefi#4136)
Browse files Browse the repository at this point in the history
* set overrides for spi2/3 pins

* don't enable SPI3, just set the pins

* s
  • Loading branch information
mck1117 authored May 4, 2022
1 parent 240ea7c commit b35e1ac
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions firmware/config/boards/microrusefi/board_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,9 @@ static void setupVbatt() {
static void setupTle8888() {
// on microRusEFI SPI3 is exposed on PC10/PC11 and there is interest to use SD card there
// PB3/PB4 could be either SPI1 or SP3, let's use not SPI3 to address the contention
// Enable spi1
engineConfiguration->is_enabled_spi_1 = true;

// Wire up spi1
// Enable and wire up SPI1
engineConfiguration->is_enabled_spi_1 = true;
engineConfiguration->spi1mosiPin = Gpio::B5;
engineConfiguration->spi1misoPin = Gpio::B4;
engineConfiguration->spi1sckPin = Gpio::B3;
Expand Down Expand Up @@ -163,16 +162,22 @@ void setBoardConfigOverrides() {
engineConfiguration->canTxPin = Gpio::B6;
engineConfiguration->canRxPin = Gpio::B12;

// SPI2 for onboard SD card on v0.6.0
engineConfiguration->is_enabled_spi_2 = true;
engineConfiguration->spi2mosiPin = Gpio::B15;
engineConfiguration->spi2misoPin = Gpio::B14;
engineConfiguration->spi2sckPin = Gpio::B13;

// SPI3 for expansion header
// Don't override enable since you might want these pins for something else
engineConfiguration->spi3mosiPin = Gpio::C12;
engineConfiguration->spi3misoPin = Gpio::C11;
engineConfiguration->spi3sckPin = Gpio::C10;
}

void setSerialConfigurationOverrides() {
// why would MRE disable serial by default? we definitely have pads exposed
engineConfiguration->useSerialPort = false;




}


Expand Down Expand Up @@ -207,17 +212,14 @@ void setBoardDefaultConfiguration() {
// "required" hardware is done - set some reasonable defaults
setupDefaultSensorInputs();


// SPI for SD card
engineConfiguration->is_enabled_spi_2 = true;
// Enable onboard SD card on v0.6.0
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_2;
engineConfiguration->isSdCardEnabled = true;

engineConfiguration->spi2mosiPin = Gpio::B15;
engineConfiguration->spi2misoPin = Gpio::B14;
engineConfiguration->spi2sckPin = Gpio::B13;
engineConfiguration->sdCardCsPin = Gpio::E15;

// Don't enable expansion header SPI by default
engineConfiguration->is_enabled_spi_3 = false;

engineConfiguration->specs.cylindersCount = 4;
engineConfiguration->specs.firingOrder = FO_1_3_4_2;

Expand Down

0 comments on commit b35e1ac

Please sign in to comment.