aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/stm32f1/include/series
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/stm32f1/include/series')
-rw-r--r--libmaple/stm32f1/include/series/spi.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/libmaple/stm32f1/include/series/spi.h b/libmaple/stm32f1/include/series/spi.h
index 167df0c..8cc4c4d 100644
--- a/libmaple/stm32f1/include/series/spi.h
+++ b/libmaple/stm32f1/include/series/spi.h
@@ -34,6 +34,8 @@
#ifndef _LIBMAPLE_STM32F1_SPI_H_
#define _LIBMAPLE_STM32F1_SPI_H_
+#include <libmaple/libmaple_types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -63,6 +65,36 @@ extern struct spi_dev *SPI2;
extern struct spi_dev *SPI3;
#endif
+/*
+ * Routines
+ */
+
+/* spi_gpio_cfg(): Backwards compatibility shim to spi_config_gpios() */
+struct gpio_dev;
+extern void spi_config_gpios(struct spi_dev*, uint8,
+ struct gpio_dev*, uint8,
+ struct gpio_dev*, uint8, uint8, uint8);
+/**
+ * @brief Deprecated. Use spi_config_gpios() instead.
+ * @see spi_config_gpios()
+ */
+static __always_inline void spi_gpio_cfg(uint8 as_master,
+ struct gpio_dev *nss_dev,
+ uint8 nss_bit,
+ struct gpio_dev *comm_dev,
+ uint8 sck_bit,
+ uint8 miso_bit,
+ uint8 mosi_bit) {
+ /* We switched style globally to foo_config_gpios() and always
+ * taking a foo_dev* argument (that last bit is the important
+ * part) after this function was written.
+ *
+ * However, spi_config_gpios() just ignores the spi_dev* on F1, so
+ * we can still keep this around for older code. */
+ spi_config_gpios(NULL, as_master, nss_dev, nss_bit,
+ comm_dev, sck_bit, miso_bit, mosi_bit);
+}
+
#ifdef __cplusplus
}
#endif