Skip to content
Permalink
Browse files

boards: twr_ke18f: configure SPI CS pins as GPIO if not used for SPI

Configure the LPSPI PCSx pins as GPIO if not dedicated to SPI CS. This
allows using them for SPI GPIO CS.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
  • Loading branch information...
henrikbrixandersen authored and MaureenHelm committed Jun 1, 2019
1 parent d1681d8 commit 219fa3c18dc45fc1d61b4729c6cbdcda087ee1b1
Showing with 6 additions and 0 deletions.
  1. +6 −0 boards/arm/twr_ke18f/pinmux.c
@@ -62,6 +62,8 @@ static int twr_ke18f_pinmux_init(struct device *dev)
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_0_PCS2
/* SPI0 PCS2 */
pinmux_pin_set(porte, 6, PORT_PCR_MUX(kPORT_MuxAlt2));
#else
pinmux_pin_set(porte, 6, PORT_PCR_MUX(kPORT_MuxAsGpio));
#endif

#ifdef CONFIG_SPI_1
@@ -73,10 +75,14 @@ static int twr_ke18f_pinmux_init(struct device *dev)
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_1_PCS0
/* SPI1 PCS0 */
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAlt3));
#else
pinmux_pin_set(portd, 3, PORT_PCR_MUX(kPORT_MuxAsGpio));
#endif
#ifdef CONFIG_BOARD_TWR_KE18F_SPI_1_PCS2
/* SPI1 PCS2 */
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAlt3));
#else
pinmux_pin_set(porta, 16, PORT_PCR_MUX(kPORT_MuxAsGpio));
#endif

#ifdef CONFIG_BOARD_TWR_KE18F_FLEXIO_CLKOUT

0 comments on commit 219fa3c

Please sign in to comment.
You can’t perform that action at this time.