summaryrefslogtreecommitdiffstats
path: root/drivers/chibios/spi_master.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/chibios/spi_master.h')
-rw-r--r--drivers/chibios/spi_master.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/chibios/spi_master.h b/drivers/chibios/spi_master.h
index e93580e319..b5a6ef1437 100644
--- a/drivers/chibios/spi_master.h
+++ b/drivers/chibios/spi_master.h
@@ -21,6 +21,7 @@
#include <stdbool.h>
#include "gpio.h"
+#include "chibios_config.h"
#ifndef SPI_DRIVER
# define SPI_DRIVER SPID2
@@ -31,7 +32,11 @@
#endif
#ifndef SPI_SCK_PAL_MODE
-# define SPI_SCK_PAL_MODE 5
+# if defined(USE_GPIOV1)
+# define SPI_SCK_PAL_MODE PAL_MODE_STM32_ALTERNATE_PUSHPULL
+# else
+# define SPI_SCK_PAL_MODE 5
+# endif
#endif
#ifndef SPI_MOSI_PIN
@@ -39,7 +44,11 @@
#endif
#ifndef SPI_MOSI_PAL_MODE
-# define SPI_MOSI_PAL_MODE 5
+# if defined(USE_GPIOV1)
+# define SPI_MOSI_PAL_MODE PAL_MODE_STM32_ALTERNATE_PUSHPULL
+# else
+# define SPI_MOSI_PAL_MODE 5
+# endif
#endif
#ifndef SPI_MISO_PIN
@@ -47,7 +56,11 @@
#endif
#ifndef SPI_MISO_PAL_MODE
-# define SPI_MISO_PAL_MODE 5
+# if defined(USE_GPIOV1)
+# define SPI_MISO_PAL_MODE PAL_MODE_STM32_ALTERNATE_PUSHPULL
+# else
+# define SPI_MISO_PAL_MODE 5
+# endif
#endif
typedef int16_t spi_status_t;