From c28cbdb22fa310eab375b9bb7913a9e9999112bb Mon Sep 17 00:00:00 2001 From: "Daniel P. Carvalho" Date: Wed, 24 Oct 2018 17:25:30 -0600 Subject: [PATCH] configs/nucleo-l432kc/include/board.h: Fix SPI pin definitions. --- configs/nucleo-l432kc/include/board.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/configs/nucleo-l432kc/include/board.h b/configs/nucleo-l432kc/include/board.h index 350ad6dc89..af99458cfd 100644 --- a/configs/nucleo-l432kc/include/board.h +++ b/configs/nucleo-l432kc/include/board.h @@ -133,15 +133,26 @@ /* SPI */ -/* SPI1 is available on the Arduino protocol at positions D11/12/13 */ +#if 1 +/* On Arduino the SPI bus is available at positions D10 (SPI_CS), D11 + * (SPI_MOSI), D12 (SPI_MISO), D13 (SPI_SCK). On the nucleo-1432kc board + * the SPI bus is available at PA11 (SPI_CS, made by GPIO), PB5 (SPI1_MOSI), + * PB4 (SPI1_MISO), PB3 (SPI1_SCK). + */ -#define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /*PA6*/ -#define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /*PA7*/ -#define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /*PA5*/ +# define GPIO_SPI1_MISO GPIO_SPI1_MISO_3 /* PB4 */ +# define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_3 /* PB5 */ +# define GPIO_SPI1_SCK GPIO_SPI1_SCK_3 /* PB3 */ -#define GPIO_SPI2_MISO GPIO_SPI2_MISO_1 /*PB14*/ -#define GPIO_SPI2_MOSI GPIO_SPI2_MOSI_1 /*PB15*/ -#define GPIO_SPI2_SCK GPIO_SPI2_SCK_2 /*PB13*/ +#else +/* Optionally it is possible to use SPI bus on pins PA5, PA6 and PA7 but this + * is incompatible with Arduino nano specification. + */ + +# define GPIO_SPI1_MISO GPIO_SPI1_MISO_1 /* PA6 */ +# define GPIO_SPI1_MOSI GPIO_SPI1_MOSI_1 /* PA7 */ +# define GPIO_SPI1_SCK GPIO_SPI1_SCK_1 /* PA5 */ +#endif /* LEDs *