sdCardSpiDevice
This commit is contained in:
parent
45a60578ce
commit
22f2754034
|
@ -205,33 +205,16 @@
|
|||
//#define EFI_CAN_RX_AF 9
|
||||
//#define EFI_CAN_TX_AF 9
|
||||
|
||||
/**
|
||||
* This section is for bottom-left corner SPI
|
||||
*/
|
||||
//#define SPI_CS1_PORT GPIOE
|
||||
//#define SPI_CS1_PIN 13
|
||||
//#define SPI_CS2_PORT GPIOE
|
||||
//#define SPI_CS2_PIN 14
|
||||
//#define SPI_CS3_PORT GPIOE
|
||||
//#define SPI_CS3_PIN 15
|
||||
//#define SPI_CS4_PORT GPIOD
|
||||
//#define SPI_CS4_PIN 10
|
||||
|
||||
#define EFI_SPI1_AF 5
|
||||
|
||||
#define EFI_SPI2_AF 5
|
||||
|
||||
|
||||
/**
|
||||
* This section is for right-side center SPI
|
||||
*/
|
||||
// this is pointing into the sky for now - conflict with I2C
|
||||
#define SPI_CS2_PORT GPIOH
|
||||
// this is pointing into the sky for now - conflict with I2C
|
||||
#define SPI_CS2_PIN 0
|
||||
#define SPI_CS4_PORT GPIOD
|
||||
#define SPI_CS4_PIN 3
|
||||
|
||||
#define EFI_SPI3_AF 6
|
||||
// todo: finish migration to sdCardSpiDevice one day
|
||||
#define MMC_CARD_SPI SPID3
|
||||
|
||||
#define EFI_I2C_SCL_PORT GPIOB
|
||||
|
|
|
@ -841,6 +841,7 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_F) {
|
|||
setHip9011FrankensoPinout();
|
||||
#endif
|
||||
|
||||
engineConfiguration->sdCardSpiDevice = SPI_DEVICE_3;
|
||||
boardConfiguration->sdCardCsPin = GPIOD_4;
|
||||
boardConfiguration->isSdCardEnabled = true;
|
||||
boardConfiguration->isFastAdcEnabled = true;
|
||||
|
|
|
@ -111,11 +111,6 @@ void initOutputPins(void) {
|
|||
// outputPinRegister("ext led 3", LED_EXT_3, EXTRA_LED_2_PORT, EXTRA_LED_3_PIN);
|
||||
// outputPinRegister("alive1", LED_DEBUG, GPIOD, 6);
|
||||
|
||||
// todo: are these needed here? todo: make configurable
|
||||
// outputPinRegister("spi CS1", SPI_CS_1, SPI_CS1_PORT, SPI_CS1_PIN);
|
||||
// outputPinRegister("spi CS2", SPI_CS_2, SPI_CS2_PORT, SPI_CS2_PIN);
|
||||
// outputPinRegister("spi CS3", SPI_CS_3, SPI_CS3_PORT, SPI_CS3_PIN);
|
||||
// outputPinRegister("spi CS4", SPI_CS_4, SPI_CS4_PORT, SPI_CS4_PIN);
|
||||
#if HAL_USE_SPI || defined(__DOXYGEN__)
|
||||
outputPinRegisterExt2("spi CS5", &enginePins.sdCsPin, boardConfiguration->sdCardCsPin, &DEFAULT_OUTPUT);
|
||||
#endif
|
||||
|
|
|
@ -416,6 +416,9 @@ void initMmcCard(void) {
|
|||
|
||||
hs_spicfg.ssport = ls_spicfg.ssport = getHwPort(boardConfiguration->sdCardCsPin);
|
||||
hs_spicfg.sspad = ls_spicfg.sspad = getHwPin(boardConfiguration->sdCardCsPin);
|
||||
/* todo: un-comment this one day. incompatible configuration change for existing users :(
|
||||
mmccfg.spip = getSpiDevice(engineConfiguration->sdCardSpiDevice);
|
||||
*/
|
||||
|
||||
/**
|
||||
* FYI: SPI does not work with CCM memory, be sure to have main() stack in RAM, not in CCMRAM
|
||||
|
|
Loading…
Reference in New Issue