boards: arm: lpcxpresso55s16: enable I2C support
Enable I2C support for the NXP LPCXpresso55S16 EVK development board. Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit is contained in:
parent
b782b2b7c6
commit
144dcdd02b
5 changed files with 62 additions and 2 deletions
|
@ -28,4 +28,8 @@ config GPIO_MCUX_LPC_PORT1
|
|||
|
||||
endif # GPIO_MCUX_LPC
|
||||
|
||||
config FXOS8700_DRDY_INT1
|
||||
default y
|
||||
depends on FXOS8700_TRIGGER
|
||||
|
||||
endif # BOARD_LPCXPRESSO55S16
|
||||
|
|
|
@ -63,8 +63,12 @@ hardware features:
|
|||
+-----------+------------+-------------------------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| I2C | on-chip | i2c |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| USART | on-chip | serial port |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SENSOR | off-chip | fxos8700 trigger |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
Other hardware features are not currently enabled.
|
||||
|
||||
|
@ -97,6 +101,12 @@ the functionality of a pin.
|
|||
+---------+-----------------+----------------------------+
|
||||
| PIO1_18 | GPIO | Wakeup SW1 |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_20 | I2C | I2C SCL |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_21 | I2C | I2C SDA |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PIO1_26 | GPIO | FXOS8700 INT1 |
|
||||
+---------+-----------------+----------------------------+
|
||||
|
||||
System Clock
|
||||
============
|
||||
|
@ -109,8 +119,8 @@ Serial Port
|
|||
===========
|
||||
|
||||
The LPC55S16 SoC has 8 FLEXCOMM interfaces for serial
|
||||
communication. One is configured as USART for the console and the
|
||||
remaining are not used.
|
||||
communication. One is configured as USART for the console, one is
|
||||
configured for I2C, and the remaining are not used.
|
||||
|
||||
Programming and Debugging
|
||||
*************************
|
||||
|
|
|
@ -61,3 +61,18 @@
|
|||
compatible = "nxp,lpc-usart";
|
||||
current-speed = <115200>;
|
||||
};
|
||||
|
||||
arduino_i2c: &flexcomm4 {
|
||||
status = "okay";
|
||||
compatible = "nxp,lpc-i2c";
|
||||
clock-frequency = <I2C_BITRATE_STANDARD>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
fxos8700@1e {
|
||||
compatible = "nxp,fxos8700";
|
||||
reg = <0x1e>;
|
||||
label = "FXOS8700";
|
||||
int1-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -15,4 +15,6 @@ toolchain:
|
|||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- arduino_i2c
|
||||
- gpio
|
||||
- i2c
|
||||
|
|
|
@ -118,6 +118,35 @@ static int lpcxpresso_55s16_pinmux_init(struct device *dev)
|
|||
pinmux_pin_set(port0, 30, port0_pin30_config);
|
||||
#endif
|
||||
|
||||
#if DT_HAS_NODE(DT_NODELABEL(flexcomm4)) && \
|
||||
DT_NODE_HAS_COMPAT(DT_NODELABEL(flexcomm4), nxp_lpc_i2c)
|
||||
/* 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
|
||||
|
||||
#ifdef CONFIG_FXOS8700_TRIGGER
|
||||
pinmux_pin_set(port1, 26, 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
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue