aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-09-03 15:48:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-09-03 15:48:09 +0000
commit9d9a04e4645b9f4b70e74dd4245a1412e82c902a (patch)
treefd48c875d30f2895654697ef6562c19dd6189282 /os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h
parent4b148d3cbcd338dd5d72fac683e712f448d08341 (diff)
downloadChibiOS-9d9a04e4645b9f4b70e74dd4245a1412e82c902a.tar.gz
ChibiOS-9d9a04e4645b9f4b70e74dd4245a1412e82c902a.tar.bz2
ChibiOS-9d9a04e4645b9f4b70e74dd4245a1412e82c902a.zip
SPI driver improvements.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10545 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h')
-rw-r--r--os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h b/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h
index 2f3435ea2..b2755f31b 100644
--- a/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h
+++ b/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.h
@@ -396,6 +396,10 @@
#define STM32_DMA_REQUIRED
#endif
+#if SPI_SELECT_MODE == SPI_SELECT_MODE_LLD
+#error "SPI_SELECT_MODE_LLD not supported by this driver"
+#endif
+
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@@ -421,15 +425,33 @@ typedef struct {
* @brief Operation complete callback or @p NULL.
*/
spicallback_t end_cb;
- /* End of the mandatory fields.*/
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_LINE) || defined(__DOXYGEN__)
+ /**
+ * @brief The chip select line.
+ */
+ ioportid_t ssline;
+#endif
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_PORT) || defined(__DOXYGEN__)
/**
- * @brief The chip select line port.
+ * @brief The chip select port.
*/
ioportid_t ssport;
/**
- * @brief The chip select line pad number.
+ * @brief The chip select port mask.
*/
- uint16_t sspad;
+ uint8fast_t ssmask;
+#endif
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_PAD) || defined(__DOXYGEN__)
+ /**
+ * @brief The chip select port.
+ */
+ ioportid_t ssport;
+ /**
+ * @brief The chip select pad number.
+ */
+ uint_fast8_t sspad;
+#endif
+ /* End of the mandatory fields.*/
/**
* @brief SPI CR1 register initialization data.
*/
@@ -528,8 +550,10 @@ extern "C" {
void spi_lld_init(void);
void spi_lld_start(SPIDriver *spip);
void spi_lld_stop(SPIDriver *spip);
+#if (SPI_SELECT_MODE == SPI_SELECT_MODE_LLD) || defined(__DOXYGEN__)
void spi_lld_select(SPIDriver *spip);
void spi_lld_unselect(SPIDriver *spip);
+#endif
void spi_lld_ignore(SPIDriver *spip, size_t n);
void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf);