drivers/spi/stm32_ll: Configure NSS behavior according to cs pointer

If CS (Chip Select, known also as Slave Select...) is managed externaly
of the stm32_ll SPI controller, just config NSS line management
accordingly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-09-28 13:06:28 +02:00 committed by Anas Nashif
commit 24199b234c
2 changed files with 2 additions and 15 deletions

View file

@ -16,8 +16,7 @@
#include <clock_control/stm32_clock_control.h>
#include <clock_control.h>
#include <drivers/spi/spi_ll_stm32.h>
#include "spi_ll_stm32.h"
#include <spi_ll_stm32.h>
#define CONFIG_CFG(cfg) \
((const struct spi_stm32_config * const)(cfg)->dev->config->config_info)
@ -252,7 +251,7 @@ static int spi_stm32_configure(struct spi_config *config)
LL_SPI_SetMode(spi, LL_SPI_MODE_MASTER);
}
if (config->vendor & STM32_SPI_NSS_IGNORE) {
if (config->cs) {
LL_SPI_SetNSSMode(spi, LL_SPI_NSS_SOFT);
} else {
if (config->operation & SPI_OP_MODE_SLAVE) {

View file

@ -1,12 +0,0 @@
/*
* Copyright (c) 2016 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _DRIVERS_STM32_SPI_H_
#define _DRIVERS_STM32_SPI_H_
#define STM32_SPI_NSS_IGNORE BIT(0)
#endif /* _DRIVERS_STM32_SPI_H_ */