boards: arm: mimxrt1024_evk: enable onboard fxos8700 sensor

Enable the onboard 6-axis FXOS8700CQ digital accelerometer and
magnetometer sensor.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2021-09-20 11:33:54 +02:00 committed by Christopher Friedt
commit 36619c024d
3 changed files with 36 additions and 0 deletions

View file

@ -51,6 +51,10 @@ Hardware
- JTAG 10-pin connector - JTAG 10-pin connector
- OpenSDA with DAPLink - OpenSDA with DAPLink
- Sensor
- 6-axis FXOS8700CQ digital accelerometer and magnetometer
For more information about the MIMXRT1024 SoC and MIMXRT1024-EVK board, see For more information about the MIMXRT1024 SoC and MIMXRT1024-EVK board, see
these references: these references:
@ -135,6 +139,10 @@ The MIMXRT1024 SoC has five pairs of pinmux/gpio controllers.
+---------------+-----------------+---------------------------+ +---------------+-----------------+---------------------------+
| GPIO_SD_B1_01 | FLEXCAN1_RX | CAN RX | | GPIO_SD_B1_01 | FLEXCAN1_RX | CAN RX |
+---------------+-----------------+---------------------------+ +---------------+-----------------+---------------------------+
| GPIO_SD_B1_02 | LPI2C4_SCL | I2C SCL |
+---------------+-----------------+---------------------------+
| GPIO_SD_B1_03 | LPI2C4_SDA | I2C SDA |
+---------------+-----------------+---------------------------+
System Clock System Clock
============ ============

View file

@ -97,3 +97,13 @@
status = "okay"; status = "okay";
bus-speed = <125000>; bus-speed = <125000>;
}; };
&lpi2c4 {
status = "okay";
fxos8700: fxos8700@1f {
compatible = "nxp,fxos8700";
reg = <0x1f>;
label = "FXOS8700";
};
};

View file

@ -97,6 +97,24 @@ static int mimxrt1024_evk_init(const struct device *dev)
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_01_FLEXCAN1_RX, 0x10B0u); IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_01_FLEXCAN1_RX, 0x10B0u);
#endif #endif
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c4), okay) && CONFIG_I2C
/* LPI2C4 SCL, SDA - FXOS8700 */
IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_02_LPI2C4_SCL, 1);
IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_03_LPI2C4_SDA, 1);
IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_02_LPI2C4_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_SD_B1_03_LPI2C4_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
return 0; return 0;
} }