boards: lpcxpresso54114: Enable i2c instance 4

Enables i2c instance 4 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:
Maureen Helm 2019-12-08 14:38:02 -06:00 committed by Kumar Gala
commit c5ef6dc73f
8 changed files with 49 additions and 0 deletions

View file

@ -33,6 +33,10 @@ config GPIO_MCUX_LPC_PORT1
endif # GPIO_MCUX_LPC endif # GPIO_MCUX_LPC
config I2C_4
default y
depends on I2C
config SPI_5 config SPI_5
default y default y
depends on SPI depends on SPI

View file

@ -62,6 +62,8 @@ features:
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio | | GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi | | SPI | on-chip | spi |
+-----------+------------+-------------------------------------+ +-----------+------------+-------------------------------------+
| USART | on-chip | serial port-polling | | USART | on-chip | serial port-polling |
@ -93,6 +95,10 @@ functionality of a pin.
+---------+-----------------+----------------------------+ +---------+-----------------+----------------------------+
| PIO0_20 | SPI | SPI MOSI | | PIO0_20 | SPI | SPI MOSI |
+---------+-----------------+----------------------------+ +---------+-----------------+----------------------------+
| PIO0_25 | I2C | I2C SCL |
+---------+-----------------+----------------------------+
| PIO0_26 | I2C | I2C SDA |
+---------+-----------------+----------------------------+
| PIO0_29 | GPIO | RED LED | | PIO0_29 | GPIO | RED LED |
+---------+-----------------+----------------------------+ +---------+-----------------+----------------------------+
| PIO1_1 | SPI | SPI SSEL2 | | PIO1_1 | SPI | SPI SSEL2 |

View file

@ -31,4 +31,6 @@
}; };
}; };
arduino_i2c: &i2c4 {};
arduino_spi: &spi5 {}; arduino_spi: &spi5 {};

View file

@ -68,6 +68,10 @@
status = "okay"; status = "okay";
}; };
&i2c4 {
status = "okay";
};
&spi5 { &spi5 {
status = "okay"; status = "okay";
}; };

View file

@ -15,6 +15,8 @@ toolchain:
- gnuarmemb - gnuarmemb
- xtools - xtools
supported: supported:
- arduino_i2c
- arduino_spi - arduino_spi
- gpio - gpio
- i2c
- spi - spi

View file

@ -107,6 +107,26 @@ static int lpcxpresso_54114_pinmux_init(struct device *dev)
pinmux_pin_set(port1, 10, port1_pin10_config); pinmux_pin_set(port1, 10, port1_pin10_config);
#endif #endif
#ifdef CONFIG_I2C_4
/* PORT0 PIN25 is configured as FC4_RTS_SCL_SSEL1 */
pinmux_pin_set(port0, 25, IOCON_PIO_FUNC1 |
IOCON_PIO_I2CSLEW_I2C |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_INPFILT_OFF |
IOCON_PIO_I2CDRIVE_LOW |
IOCON_PIO_I2CFILTER_EN);
/* PORT0 PIN26 is configured as FC4_CTS_SDA_SSEL0 */
pinmux_pin_set(port0, 26, IOCON_PIO_FUNC1 |
IOCON_PIO_I2CSLEW_I2C |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_INPFILT_OFF |
IOCON_PIO_I2CDRIVE_LOW |
IOCON_PIO_I2CFILTER_EN);
#endif /* CONFIG_I2C_4 */
#ifdef CONFIG_SPI_5 #ifdef CONFIG_SPI_5
/* PORT0 PIN18 is configured as FC5_TXD_SCL_MISO */ /* PORT0 PIN18 is configured as FC5_TXD_SCL_MISO */
pinmux_pin_set(port0, 18, IOCON_PIO_FUNC1 | pinmux_pin_set(port0, 18, IOCON_PIO_FUNC1 |

View file

@ -66,6 +66,14 @@ static ALWAYS_INLINE void clock_init(void)
/* Attach 12 MHz clock to FLEXCOMM0 */ /* Attach 12 MHz clock to FLEXCOMM0 */
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0); CLOCK_AttachClk(kFRO12M_to_FLEXCOMM0);
#ifdef CONFIG_I2C_4
/* attach 12 MHz clock to FLEXCOMM4 */
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM4);
/* reset FLEXCOMM for I2C */
RESET_PeripheralReset(kFC4_RST_SHIFT_RSTn);
#endif /* CONFIG_I2C_4 */
#ifdef CONFIG_SPI_5 #ifdef CONFIG_SPI_5
/* Attach 12 MHz clock to FLEXCOMM5 */ /* Attach 12 MHz clock to FLEXCOMM5 */
CLOCK_AttachClk(kFRO12M_to_FLEXCOMM5); CLOCK_AttachClk(kFRO12M_to_FLEXCOMM5);

View file

@ -30,6 +30,9 @@
#define IOCON_PIO_FUNC2 0x02u #define IOCON_PIO_FUNC2 0x02u
#define IOCON_PIO_FUNC3 0x03u #define IOCON_PIO_FUNC3 0x03u
#define IOCON_PIO_FUNC4 0x04u #define IOCON_PIO_FUNC4 0x04u
#define IOCON_PIO_I2CDRIVE_LOW 0x00u
#define IOCON_PIO_I2CFILTER_EN 0x00u
#define IOCON_PIO_I2CSLEW_I2C 0x00u
#define IOCON_PIO_INPFILT_OFF 0x0100u #define IOCON_PIO_INPFILT_OFF 0x0100u
#define IOCON_PIO_INV_DI 0x00u #define IOCON_PIO_INV_DI 0x00u
#define IOCON_PIO_MODE_INACT 0x00u #define IOCON_PIO_MODE_INACT 0x00u