Skip to content
Permalink
Browse files

soc: nxp_imx: mimxrt1064_evk: Add I2C support

I2C1 is routed to J24 Arduino interface (D14/I2C_SDA, D15/I2C_SCL).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
  • Loading branch information...
Loic Poulain authored and galak committed Feb 26, 2019
1 parent a0ba654 commit e5609997e0804d1195ca15c8439a7ffbaaba5482
@@ -28,6 +28,13 @@ config GPIO_MCUX_IGPIO_5

endif # GPIO_MCUX_IGPIO

if I2C_MCUX_LPI2C

config I2C_1
default y

endif # I2C_MCUX_LPI2C

if UART_MCUX_LPUART

config UART_MCUX_LPUART_1
@@ -62,6 +62,8 @@
};
};

arduino_i2c: &i2c1 {};

&lcdif1 {
status = "ok";
port {
@@ -71,6 +73,10 @@
};
};

&i2c1 {
status = "ok";
};

&uart1 {
status = "ok";
current-speed = <115200>;
@@ -18,3 +18,4 @@ supported:
- display
- hwinfo
- netif:eth
- i2c
@@ -111,6 +111,26 @@ static int mimxrt1064_evk_init(struct device *dev)
GPIO_PinInit(GPIO2, 31, &config);
#endif

#ifdef CONFIG_I2C_1
/* LPI2C1 SCL, SDA */
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_00_LPI2C1_SCL, 1);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B1_01_LPI2C1_SDA, 1);

IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_00_LPI2C1_SCL,
IOMUXC_SW_PAD_CTL_PAD_PUS(3) |
IOMUXC_SW_PAD_CTL_PAD_PKE_MASK |
IOMUXC_SW_PAD_CTL_PAD_ODE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SPEED(2) |
IOMUXC_SW_PAD_CTL_PAD_DSE(6));

IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_B1_01_LPI2C1_SDA,
IOMUXC_SW_PAD_CTL_PAD_PUS(3) |
IOMUXC_SW_PAD_CTL_PAD_PKE_MASK |
IOMUXC_SW_PAD_CTL_PAD_ODE_MASK |
IOMUXC_SW_PAD_CTL_PAD_SPEED(2) |
IOMUXC_SW_PAD_CTL_PAD_DSE(6));
#endif

#ifdef CONFIG_ETH_MCUX_0
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_09_GPIO1_IO09, 0U);
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_B0_10_GPIO1_IO10, 0U);
@@ -120,6 +120,7 @@ config SOC_MIMXRT1064
select HAS_MCUX_ELCDIF
select HAS_MCUX_ENET
select HAS_MCUX_IGPIO
select HAS_MCUX_LPI2C
select HAS_MCUX_LPUART
select HAS_MCUX_TRNG
select CPU_HAS_FPU_DOUBLE_PRECISION

0 comments on commit e560999

Please sign in to comment.
You can’t perform that action at this time.