boards: lpcxpresso54114: Enable spi instance 5
Enables spi instance 5 on the lpcxpresso54114 board. Configures pinmuxes and clocks, and updates board documentation accordingly. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
ea5c3b6e04
commit
5472961ca0
8 changed files with 71 additions and 0 deletions
|
@ -36,4 +36,11 @@ config GPIO_MCUX_LPC_PORT1
|
|||
|
||||
endif # GPIO_MCUX_LPC
|
||||
|
||||
if SPI
|
||||
|
||||
config SPI_5
|
||||
default y
|
||||
|
||||
endif # SPI
|
||||
|
||||
endif # BOARD_LPCXPRESSO54114_M4 || BOARD_LPCXPRESSO54114_M0
|
||||
|
|
|
@ -62,6 +62,8 @@ features:
|
|||
+-----------+------------+-------------------------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SPI | on-chip | spi |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| USART | on-chip | serial port-polling |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
|
@ -85,8 +87,16 @@ functionality of a pin.
|
|||
+---------+-----------------+----------------------------+
|
||||
| PIO0_1 | USART | USART TX |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO0_18 | SPI | SPI MISO |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO0_19 | SPI | SPI SCK |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO0_20 | SPI | SPI MOSI |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO0_29 | GPIO | RED LED |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_1 | SPI | SPI SSEL2 |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_9 | GPIO | BLUE_LED |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_10 | GPIO | GREEN LED |
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
led0 = &red_led;
|
||||
led1 = &green_led;
|
||||
led2 = &blue_led;
|
||||
spi-5 = &spi5;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
@ -32,3 +33,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
arduino_spi: &spi5 {};
|
||||
|
|
|
@ -67,3 +67,7 @@
|
|||
&blue_led {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi5 {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -15,4 +15,6 @@ toolchain:
|
|||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- arduino_spi
|
||||
- gpio
|
||||
- spi
|
||||
|
|
|
@ -106,6 +106,40 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)
|
|||
pinmux_pin_set(port1, 10, port1_pin10_config);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SPI_5
|
||||
/* PORT0 PIN18 is configured as FC5_TXD_SCL_MISO */
|
||||
pinmux_pin_set(port0, 18, IOCON_PIO_FUNC1 |
|
||||
IOCON_PIO_MODE_PULLUP |
|
||||
IOCON_PIO_INV_DI |
|
||||
IOCON_PIO_DIGITAL_EN |
|
||||
IOCON_PIO_SLEW_STANDARD |
|
||||
IOCON_PIO_OPENDRAIN_DI);
|
||||
|
||||
/* PORT0 PIN19 is configured as FC5_SCK-SPIFI_CSn */
|
||||
pinmux_pin_set(port0, 19, IOCON_PIO_FUNC1 |
|
||||
IOCON_PIO_MODE_PULLUP |
|
||||
IOCON_PIO_INV_DI |
|
||||
IOCON_PIO_DIGITAL_EN |
|
||||
IOCON_PIO_SLEW_STANDARD |
|
||||
IOCON_PIO_OPENDRAIN_DI);
|
||||
|
||||
/* PORT0 PIN20 is configured as FC5_RXD_SDA_MOSI */
|
||||
pinmux_pin_set(port0, 20, IOCON_PIO_FUNC1 |
|
||||
IOCON_PIO_MODE_PULLUP |
|
||||
IOCON_PIO_INV_DI |
|
||||
IOCON_PIO_DIGITAL_EN |
|
||||
IOCON_PIO_SLEW_STANDARD |
|
||||
IOCON_PIO_OPENDRAIN_DI);
|
||||
|
||||
/* PORT1 PIN1 is configured as FC5_SSEL2 */
|
||||
pinmux_pin_set(port1, 1, IOCON_PIO_FUNC4 |
|
||||
IOCON_PIO_MODE_PULLUP |
|
||||
IOCON_PIO_INV_DI |
|
||||
IOCON_PIO_DIGITAL_EN |
|
||||
IOCON_PIO_SLEW_STANDARD |
|
||||
IOCON_PIO_OPENDRAIN_DI);
|
||||
#endif /* CONFIG_SPI_5 */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,15 @@ static ALWAYS_INLINE void clock_init(void)
|
|||
|
||||
/* Attach 12 MHz clock to FLEXCOMM0 */
|
||||
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
|
||||
|
||||
#ifdef CONFIG_SPI_5
|
||||
/* Attach 12 MHz clock to FLEXCOMM5 */
|
||||
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM5);
|
||||
|
||||
/* reset FLEXCOMM for SPI */
|
||||
RESET_PeripheralReset(kFC5_RST_SHIFT_RSTn);
|
||||
#endif /* CONFIG_SPI_5 */
|
||||
|
||||
#endif /* CONFIG_SOC_LPC54114_M4 */
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#define IOCON_PIO_FUNC0 0x00u
|
||||
#define IOCON_PIO_FUNC1 0x01u
|
||||
#define IOCON_PIO_FUNC2 0x02u
|
||||
#define IOCON_PIO_FUNC3 0x03u
|
||||
#define IOCON_PIO_FUNC4 0x04u
|
||||
#define IOCON_PIO_INPFILT_OFF 0x0100u
|
||||
#define IOCON_PIO_INV_DI 0x00u
|
||||
#define IOCON_PIO_MODE_INACT 0x00u
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue