Skip to content

Commit

Permalink
Merge pull request #622 from Paciente8159/621-bug-spi-configuration-o…
Browse files Browse the repository at this point in the history
…f-stm32f4-incorrectincomplete

STM32F4 SPI configuration AFIO fixed
  • Loading branch information
Paciente8159 authored Feb 13, 2024
2 parents 459ad8d + 96ccfe8 commit b8cf4e3
Show file tree
Hide file tree
Showing 2 changed files with 611 additions and 177 deletions.
9 changes: 6 additions & 3 deletions uCNC/src/hal/mcus/stm32f4x/mcu_stm32f4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,12 @@ void mcu_init(void)
#endif
#ifdef MCU_HAS_SPI
SPI_ENREG |= SPI_ENVAL;
mcu_config_af(SPI_SDI, SPI_AFIO);
mcu_config_af(SPI_CLK, SPI_AFIO);
mcu_config_af(SPI_SDO, SPI_AFIO);
mcu_config_af(SPI_SDI, SPI_SDI_AFIO);
mcu_config_af(SPI_CLK, SPI_CLK_AFIO);
mcu_config_af(SPI_SDO, SPI_SDO_AFIO);
#if ASSERT_PIN_IO(SPI_CS)
mcu_config_af(SPI_CS, SPI_CS_AFIO);
#endif
// initialize the SPI configuration register
SPI_REG->CR1 = SPI_CR1_SSM // software slave management enabled
| SPI_CR1_SSI // internal slave select
Expand Down
Loading

0 comments on commit b8cf4e3

Please sign in to comment.