diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-07-01 17:49:43 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-07-01 17:49:43 -0600 |
commit | c006b90a4cd2abf0e698db9f5fd99dd21f146016 (patch) | |
tree | 1ddddfae20d0ec5ed386006633f9e4956cff8b8d /nuttx/drivers/spi | |
parent | aeebc7eb724e902efd4bbb6dc34fc57e2a66c9d4 (diff) | |
download | px4-nuttx-c006b90a4cd2abf0e698db9f5fd99dd21f146016.tar.gz px4-nuttx-c006b90a4cd2abf0e698db9f5fd99dd21f146016.tar.bz2 px4-nuttx-c006b90a4cd2abf0e698db9f5fd99dd21f146016.zip |
clean up of SPI bit bang logic
Diffstat (limited to 'nuttx/drivers/spi')
-rw-r--r-- | nuttx/drivers/spi/Kconfig | 10 | ||||
-rwxr-xr-x | nuttx/drivers/spi/spi_bitbang.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/nuttx/drivers/spi/Kconfig b/nuttx/drivers/spi/Kconfig index fbba4e253..2dd09bd5b 100644 --- a/nuttx/drivers/spi/Kconfig +++ b/nuttx/drivers/spi/Kconfig @@ -36,4 +36,14 @@ config SPI_BITBANG Enable support for a generic SPI bit-bang device. See include/nuttx/spi/spi_bitbang.h for further information. +if SPI_BITBANG + +config SPI_BITBANG_VARWIDTH + bool "SPI bit-bang variable width transfers" + default n + ---help--- + Enable support for a variable dat width transfers. Default: 8-bit + only. + +endif endif diff --git a/nuttx/drivers/spi/spi_bitbang.c b/nuttx/drivers/spi/spi_bitbang.c index 813292b77..76046a56a 100755 --- a/nuttx/drivers/spi/spi_bitbang.c +++ b/nuttx/drivers/spi/spi_bitbang.c @@ -312,7 +312,7 @@ static void spi_setbits(FAR struct spi_dev_s *dev, int nbits) FAR struct spi_bitbang_s *priv = (FAR struct spi_bitbang_s *)dev; spivdbg("nbits=%d\n", nbits); - DEBUGASSERT(priv && nbits > 0); + DEBUGASSERT(priv && nbits > 0 && nbits <= 16); priv->nbits = nbits; #else spivdbg("nbits=%d\n", nbits); |