boards: arm: lpcxpress55s16: enable SPI support

Enable the high-speed SPI controller on the NXP LPCXpresso55S16 board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
Henrik Brix Andersen 2020-05-02 22:49:57 +02:00 committed by Maureen Helm
commit b30fea4dc9
4 changed files with 50 additions and 0 deletions

View file

@ -65,6 +65,8 @@ hardware features:
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
| USART | on-chip | serial port |
+-----------+------------+-------------------------------------+
| SENSOR | off-chip | fxos8700 trigger |
@ -87,10 +89,18 @@ the functionality of a pin.
+=========+=================+============================+
| PIO0_5 | GPIO | ISP SW4 |
+---------+-----------------+----------------------------+
| PIO0_26 | SPI | SPI MOSI |
+---------+-----------------+----------------------------+
| PIO0_29 | USART | USART RX |
+---------+-----------------+----------------------------+
| PIO0_30 | USART | USART TX |
+---------+-----------------+----------------------------+
| PIO1_1 | SPI | SPI SSEL1 |
+---------+-----------------+----------------------------+
| PIO1_2 | SPI | SPI SCK |
+---------+-----------------+----------------------------+
| PIO1_3 | SPI | SPI MISO |
+---------+-----------------+----------------------------+
| PIO1_4 | GPIO | RED LED |
+---------+-----------------+----------------------------+
| PIO1_6 | GPIO | BLUE_LED |

View file

@ -76,3 +76,7 @@ arduino_i2c: &flexcomm4 {
int1-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
};
};
arduino_spi: &hs_lspi {
status = "okay";
};

View file

@ -16,5 +16,7 @@ toolchain:
- xtools
supported:
- arduino_i2c
- arduino_spi
- gpio
- i2c
- spi

View file

@ -147,6 +147,40 @@ static int lpcxpresso_55s16_pinmux_init(struct device *dev)
IOCON_PIO_OPENDRAIN_DI);
#endif
#if DT_HAS_NODE(DT_NODELABEL(hs_lspi))
/* PORT0 PIN26 is configured as HS_SPI_MOSI */
pinmux_pin_set(port0, 26, IOCON_PIO_FUNC9 |
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 HS_SPI_SSEL1 */
pinmux_pin_set(port1, 1, IOCON_PIO_FUNC5 |
IOCON_PIO_MODE_PULLUP |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN2 is configured as HS_SPI_SCK */
pinmux_pin_set(port1, 2, IOCON_PIO_FUNC6 |
IOCON_PIO_MODE_PULLUP |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN3 is configured as HS_SPI_MISO */
pinmux_pin_set(port1, 3, IOCON_PIO_FUNC6 |
IOCON_PIO_MODE_PULLUP |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_OPENDRAIN_DI);
#endif
return 0;
}