From 5b001d32af0214f1dff30afaf3199db9d3188d8b Mon Sep 17 00:00:00 2001 From: Neil Chen Date: Thu, 2 Jan 2025 17:53:13 +0800 Subject: [PATCH] samples: sensor: Add support for temperature sensor on FRDM_MCXN236 Add new test sample.sensor.thermometer_i3c, can't assign the same platform with i2c, and i3c at the same time. Support the shield on FRDM_MCXN236 board by I2C and I3C way. Signed-off-by: Neil Chen --- .../boards/frdm_mcxn236.overlay | 14 ++++++ .../boards/frdm_mcxn236.overlay | 27 ++++++++++++ samples/sensor/thermometer/sample.yaml | 43 +++++++++++++------ 3 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 boards/shields/p3t1755dp_ard_i2c/boards/frdm_mcxn236.overlay create mode 100644 boards/shields/p3t1755dp_ard_i3c/boards/frdm_mcxn236.overlay diff --git a/boards/shields/p3t1755dp_ard_i2c/boards/frdm_mcxn236.overlay b/boards/shields/p3t1755dp_ard_i2c/boards/frdm_mcxn236.overlay new file mode 100644 index 00000000000..22ec2f7453c --- /dev/null +++ b/boards/shields/p3t1755dp_ard_i2c/boards/frdm_mcxn236.overlay @@ -0,0 +1,14 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +&i3c1 { + status = "disabled"; +}; + +&flexcomm5_lpi2c5 { + status = "okay"; + clock-frequency = ; +}; diff --git a/boards/shields/p3t1755dp_ard_i3c/boards/frdm_mcxn236.overlay b/boards/shields/p3t1755dp_ard_i3c/boards/frdm_mcxn236.overlay new file mode 100644 index 00000000000..115b33818b1 --- /dev/null +++ b/boards/shields/p3t1755dp_ard_i3c/boards/frdm_mcxn236.overlay @@ -0,0 +1,27 @@ +/* + * Copyright 2024 NXP + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * The p3t1755 shield board is plugged into the arduino interface on + * the FRDM-MCXN236 board, and the J13 on the shield board is connected + * to the J9 on the MCXN236 referred below. + * J13-1 -> J9-3; J13-2 -> J9-4; + * J13-3 -> J9-1; J13-4 -> J9-22; + */ + +#include + +&flexcomm5_lpi2c5 { + status = "disabled"; +}; + +&i3c1 { + status = "okay"; + + i2c-scl-hz = ; + i3c-scl-hz = ; + i3c-od-scl-hz = ; +}; diff --git a/samples/sensor/thermometer/sample.yaml b/samples/sensor/thermometer/sample.yaml index 2d016a130b9..c2f13aa26cb 100644 --- a/samples/sensor/thermometer/sample.yaml +++ b/samples/sensor/thermometer/sample.yaml @@ -1,21 +1,11 @@ sample: name: Temperature Sensor +common: + filter: dt_alias_exists("ambient-temp0") + harness: console tests: sample.sensor.thermometer: tags: sensors - filter: dt_alias_exists("ambient-temp0") - integration_platforms: - - nrf52840dk/nrf52840 # mcp9700a - - frdm_k22f # tcn75a - - robokit1 # ntc_thermistor - - adi_eval_adin1110ebz # adt7420 - - frdm_mcxn947/mcxn947/cpu0 # p3t1755 - extra_args: - - platform:mimxrt1180_evk/mimxrt1189/cm33:SHIELD=p3t1755dp_ard_i2c - - platform:mimxrt1180_evk/mimxrt1189/cm7:SHIELD=p3t1755dp_ard_i2c - - platform:mimxrt1180_evk/mimxrt1189/cm33:SHIELD=p3t1755dp_ard_i3c - - platform:mimxrt1180_evk/mimxrt1189/cm7:SHIELD=p3t1755dp_ard_i3c - harness: console harness_config: fixture: sensor_ambient_temp type: multi_line @@ -23,3 +13,30 @@ tests: - "Thermometer Example (.*)" - "Temperature device is 0x[0-9|a-z]+, name is [a-z|0-9]+@[a-z|0-9]+" - "Temperature is [0-9|.]+°C" + integration_platforms: + - nrf52840dk/nrf52840 # mcp9700a + - frdm_k22f # tcn75a + - robokit1 # ntc_thermistor + - adi_eval_adin1110ebz # adt7420 + extra_args: + - platform:mimxrt1180_evk/mimxrt1189/cm33:SHIELD=p3t1755dp_ard_i2c + - platform:mimxrt1180_evk/mimxrt1189/cm7:SHIELD=p3t1755dp_ard_i2c + - platform:frdm_mcxn236/mcxn236:SHIELD=p3t1755dp_ard_i2c + sample.sensor.thermometer_i3c: + tags: sensors + harness_config: + fixture: sensor_ambient_temp_i3c + type: multi_line + regex: + - "Thermometer Example (.*)" + - "Temperature device is 0x[0-9|a-z]+, name is [a-z|0-9]+@[a-z|0-9]+" + - "Temperature is [0-9|.]+°C" + integration_platforms: + - frdm_mcxn947/mcxn947/cpu0 # p3t1755 + depends_on: + - i3c + filter: dt_alias_exists("ambient-temp0") + extra_args: + - platform:mimxrt1180_evk/mimxrt1189/cm33:SHIELD=p3t1755dp_ard_i3c + - platform:mimxrt1180_evk/mimxrt1189/cm7:SHIELD=p3t1755dp_ard_i3c + - platform:frdm_mcxn236/mcxn236:SHIELD=p3t1755dp_ard_i3c