From 60807efc85c626c03f4cae207097cf81fc5fc9d2 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Sun, 28 Jan 2024 15:44:40 +0100 Subject: [PATCH] mrf24j40: always use SPI MODE(0,0) Other SPI modes are not supported. From doc: "The MRF24J40 supports SPI (mode 0,0) which requires that SCK idles in a low state." --- drivers/wireless/ieee802154/mrf24j40/mrf24j40.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h b/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h index cfcc731eb4..5a3db74f22 100644 --- a/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h +++ b/drivers/wireless/ieee802154/mrf24j40/mrf24j40.h @@ -76,6 +76,8 @@ #define MRF24J40_SYMBOL_DURATION_PS 16000000 +#define MRF24J40_SPIMODE SPIDEV_MODE0 + /* Clock configuration macros */ #define MRF24J40_BEACONINTERVAL_NSEC(beaconorder) \ @@ -90,10 +92,6 @@ # error High priority work queue required in this driver #endif -#ifndef CONFIG_IEEE802154_MRF24J40_SPIMODE -# define CONFIG_IEEE802154_MRF24J40_SPIMODE SPIDEV_MODE0 -#endif - #ifndef CONFIG_IEEE802154_MRF24J40_FREQUENCY # define CONFIG_IEEE802154_MRF24J40_FREQUENCY 8000000 #endif @@ -174,7 +172,7 @@ static inline void mrf24j40_spi_lock(FAR struct spi_dev_s *spi) { SPI_LOCK(spi, 1); SPI_SETBITS(spi, 8); - SPI_SETMODE(spi, CONFIG_IEEE802154_MRF24J40_SPIMODE); + SPI_SETMODE(spi, MRF24J40_SPIMODE); SPI_SETFREQUENCY(spi, CONFIG_IEEE802154_MRF24J40_FREQUENCY); }