boards: lpcxpresso55s69: Enable i2c instance 4

Enables i2c instance 4 on the lpcxpresso55s69 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 13:58:29 -06:00 committed by Kumar Gala
commit ab949b023b
7 changed files with 65 additions and 0 deletions

View file

@ -33,8 +33,16 @@ config GPIO_MCUX_LPC_PORT1
endif # GPIO_MCUX_LPC
config I2C_4
default y
depends on I2C
config SPI_8
default y
depends on SPI
config FXOS8700_DRDY_INT1
default y
depends on FXOS8700_TRIGGER
endif # BOARD_LPCXPRESSO55S69_CPU0 || BOARD_LPCXPRESSO55S69_CPU1

View file

@ -62,6 +62,8 @@ features:
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| I2C | on-chip | i2c |
+-----------+------------+-------------------------------------+
| SPI | on-chip | spi |
+-----------+------------+-------------------------------------+
| USART | on-chip | serial port-polling |
@ -108,6 +110,10 @@ functionality of a pin.
+---------+-----------------+----------------------------+
| PIO1_7 | GPIO | GREEN LED |
+---------+-----------------+----------------------------+
| PIO1_20 | I2C | I2C SCL |
+---------+-----------------+----------------------------+
| PIO1_21 | I2C | I2C SDA |
+---------+-----------------+----------------------------+
System Clock
============

View file

@ -31,4 +31,13 @@
};
};
arduino_i2c: &i2c4 {
mma8652fc@1d {
compatible = "nxp,fxos8700","nxp,mma8652fc";
reg = <0x1d>;
label = "MMA8652FC";
int1-gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;
};
};
arduino_spi: &spi8 {};

View file

@ -69,6 +69,10 @@
status = "okay";
};
&i2c4 {
status = "okay";
};
&spi8 {
status = "okay";
};

View file

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

View file

@ -87,6 +87,34 @@ static int lpcxpresso_55s69_pinmux_init(struct device *dev)
pinmux_pin_set(port1, DT_ALIAS_SW2_GPIOS_PIN, sw2_config);
#endif
#ifdef CONFIG_I2C_4
/* PORT1 PIN20 is configured as FC4_TXD_SCL_MISO_WS */
pinmux_pin_set(port1, 20, IOCON_PIO_FUNC5 |
IOCON_PIO_MODE_INACT |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_OPENDRAIN_DI);
/* PORT1 PIN21 is configured as FC4_RXD_SDA_MOSI_DATA */
pinmux_pin_set(port1, 21, IOCON_PIO_FUNC5 |
IOCON_PIO_MODE_INACT |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_OPENDRAIN_DI);
#endif /* CONFIG_I2C_4 */
#ifdef CONFIG_FXOS8700_TRIGGER
pinmux_pin_set(port1, 19, IOCON_PIO_FUNC0 |
IOCON_PIO_MODE_PULLUP |
IOCON_PIO_INV_DI |
IOCON_PIO_DIGITAL_EN |
IOCON_PIO_INPFILT_OFF |
IOCON_PIO_SLEW_STANDARD |
IOCON_PIO_OPENDRAIN_DI);
#endif
#ifdef CONFIG_SPI_8
/* PORT0 PIN26 is configured as HS_SPI_MOSI */
pinmux_pin_set(port0, 26, IOCON_PIO_FUNC9 |

View file

@ -61,6 +61,14 @@ static ALWAYS_INLINE void clock_init(void)
/* Enables the clock for the I/O controller.: Enable Clock. */
CLOCK_EnableClock(kCLOCK_Iocon);
#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_8
/* Attach 12 MHz clock to FLEXCOMM8 */
CLOCK_AttachClk(kFRO12M_to_HSLSPI);