From fb1a365423a2533de7d85a7a63d160394fb2055c Mon Sep 17 00:00:00 2001 From: Chuck McManis Date: Fri, 6 Feb 2015 08:26:27 -0800 Subject: [PATCH] stm32: Disable SSOE if slave management is enabled As called out by flixr, if you want slave select management then you don't want SSOE active. This turns it off when enable_slave_management is called. --- lib/stm32/common/spi_common_all.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/stm32/common/spi_common_all.c b/lib/stm32/common/spi_common_all.c index c488d04f..1619fecb 100644 --- a/lib/stm32/common/spi_common_all.c +++ b/lib/stm32/common/spi_common_all.c @@ -392,7 +392,7 @@ void spi_set_receive_only_mode(uint32_t spi) } /*---------------------------------------------------------------------------*/ -/** @brief SPI Enable Slave Management by Hardware +/** @brief SPI Disable Slave Management by Hardware In slave mode the NSS hardware input is used as a select enable for the slave. @@ -416,6 +416,8 @@ enable/disable of the slave (@ref spi_set_nss_high). void spi_enable_software_slave_management(uint32_t spi) { SPI_CR1(spi) |= SPI_CR1_SSM; + /* allow slave select to be an input */ + SPI_CR2(spi) &= ~SPI_CR2_SSOE; } /*---------------------------------------------------------------------------*/