boards: mimxrt11xx: Enabled FXOS8700 Accelerometer
Enables the FXOS8700 accelerometer included on the RT1160 EVK and RT1170 EVK. Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
parent
cb8c995235
commit
6608e68af5
10 changed files with 79 additions and 0 deletions
|
@ -148,6 +148,10 @@ The MIMXRT1160 SoC has six pairs of pinmux/gpio controllers.
|
|||
+---------------+-----------------+---------------------------+
|
||||
| GPIO_AD_09 | LPI2C1_SDA | i2c |
|
||||
+---------------+-----------------+---------------------------+
|
||||
| GPIO_LPSR_05 | LPI2C5_SCL | i2c |
|
||||
+---------------+-----------------+---------------------------+
|
||||
| GPIO_LPSR_04 | LPI2C5_SDA | i2c |
|
||||
+---------------+-----------------+---------------------------+
|
||||
|
||||
System Clock
|
||||
============
|
||||
|
|
|
@ -39,3 +39,21 @@
|
|||
&green_led {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&lpi2c5 {
|
||||
status = "okay";
|
||||
|
||||
fxos8700@1f {
|
||||
compatible = "nxp,fxos8700";
|
||||
reg = <0x1f>;
|
||||
label = "FXOS8700";
|
||||
|
||||
/* Two zero ohm resistors (R256 and R270) isolate sensor
|
||||
* interrupt gpios from the soc and are unpopulated by default.
|
||||
* Note that if you populate them, they conflict with camera and
|
||||
* ethernet PHY reset signals.
|
||||
*/
|
||||
int1-gpios = <&gpio11 14 GPIO_ACTIVE_LOW>;
|
||||
int2-gpios = <&gpio11 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -58,6 +58,19 @@ static int mimxrt1160_evk_init(const struct device *dev)
|
|||
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_09_LPI2C1_SDA, 0x10U);
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c5), okay) && CONFIG_FXOS8700
|
||||
#if !defined(CONFIG_FXOS8700_TRIGGER_NONE)
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_DISP_B2_13_GPIO11_IO14, 0U);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_DISP_B2_14_GPIO11_IO15, 0U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_DISP_B2_13_GPIO11_IO14, 0x02U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_DISP_B2_14_GPIO11_IO15, 0x02U);
|
||||
#endif
|
||||
/* LPI2C5 SDA, SCL */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_04_LPI2C5_SDA, 1U);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_05_LPI2C5_SCL, 1U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_04_LPI2C5_SDA, 0x20U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_05_LPI2C5_SCL, 0x20U);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -147,6 +147,10 @@ The MIMXRT1170 SoC has six pairs of pinmux/gpio controllers.
|
|||
+---------------+-----------------+---------------------------+
|
||||
| GPIO_AD_09 | LPI2C1_SDA | i2c |
|
||||
+---------------+-----------------+---------------------------+
|
||||
| GPIO_LPSR_05 | LPI2C5_SCL | i2c |
|
||||
+---------------+-----------------+---------------------------+
|
||||
| GPIO_LPSR_04 | LPI2C5_SDA | i2c |
|
||||
+---------------+-----------------+---------------------------+
|
||||
|
||||
|
||||
System Clock
|
||||
|
|
|
@ -27,6 +27,24 @@
|
|||
};
|
||||
};
|
||||
|
||||
&lpi2c5 {
|
||||
status = "okay";
|
||||
|
||||
fxos8700@1f {
|
||||
compatible = "nxp,fxos8700";
|
||||
reg = <0x1f>;
|
||||
label = "FXOS8700";
|
||||
|
||||
/* Two zero ohm resistors (R256 and R270) isolate sensor
|
||||
* interrupt gpios from the soc and are unpopulated by default.
|
||||
* Note that if you populate them, they conflict with camera and
|
||||
* ethernet PHY reset signals.
|
||||
*/
|
||||
int1-gpios = <&gpio11 14 GPIO_ACTIVE_LOW>;
|
||||
int2-gpios = <&gpio11 15 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
&lpuart1 {
|
||||
status = "okay";
|
||||
current-speed = <115200>;
|
||||
|
|
|
@ -121,6 +121,20 @@ static int mimxrt1170_evk_init(const struct device *dev)
|
|||
IOMUXC_SetPinConfig(IOMUXC_GPIO_AD_09_LPI2C1_SDA, 0x10U);
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpi2c5), okay) && CONFIG_FXOS8700
|
||||
#if !defined(CONFIG_FXOS8700_TRIGGER_NONE)
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_DISP_B2_13_GPIO11_IO14, 0U);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_DISP_B2_14_GPIO11_IO15, 0U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_DISP_B2_13_GPIO11_IO14, 0x02U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_DISP_B2_14_GPIO11_IO15, 0x02U);
|
||||
#endif
|
||||
/* LPI2C5 SDA, SCL */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_04_LPI2C5_SDA, 1U);
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_05_LPI2C5_SCL, 1U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_04_LPI2C5_SDA, 0x20U);
|
||||
IOMUXC_SetPinConfig(IOMUXC_GPIO_LPSR_05_LPI2C5_SCL, 0x20U);
|
||||
#endif
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(lpspi1), okay) && CONFIG_SPI
|
||||
/* LPIPI1 SCK, PCS0, SIN, SOUT */
|
||||
IOMUXC_SetPinMux(IOMUXC_GPIO_AD_28_LPSPI1_SCK, 0U);
|
||||
|
|
2
samples/sensor/fxos8700/boards/mimxrt1160_evk_cm4.conf
Normal file
2
samples/sensor/fxos8700/boards/mimxrt1160_evk_cm4.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
|
||||
CONFIG_FXOS8700_TRIGGER_NONE=y
|
2
samples/sensor/fxos8700/boards/mimxrt1160_evk_cm7.conf
Normal file
2
samples/sensor/fxos8700/boards/mimxrt1160_evk_cm7.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
|
||||
CONFIG_FXOS8700_TRIGGER_NONE=y
|
2
samples/sensor/fxos8700/boards/mimxrt1170_evk_cm4.conf
Normal file
2
samples/sensor/fxos8700/boards/mimxrt1170_evk_cm4.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
|
||||
CONFIG_FXOS8700_TRIGGER_NONE=y
|
2
samples/sensor/fxos8700/boards/mimxrt1170_evk_cm7.conf
Normal file
2
samples/sensor/fxos8700/boards/mimxrt1170_evk_cm7.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
CONFIG_FXOS8700_TRIGGER_OWN_THREAD=n
|
||||
CONFIG_FXOS8700_TRIGGER_NONE=y
|
Loading…
Add table
Add a link
Reference in a new issue