Skip to content

Commit

Permalink
samples: sensor: Add support for temperature sensor on FRDM_MCXN236
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
NeilChen93 authored and kartben committed Jan 7, 2025
1 parent f861b4f commit 5b001d3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 6 deletions.
14 changes: 14 additions & 0 deletions boards/shields/p3t1755dp_ard_i2c/boards/frdm_mcxn236.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&i3c1 {
status = "disabled";
};

&flexcomm5_lpi2c5 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
};
27 changes: 27 additions & 0 deletions boards/shields/p3t1755dp_ard_i3c/boards/frdm_mcxn236.overlay
Original file line number Diff line number Diff line change
@@ -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 <freq.h>

&flexcomm5_lpi2c5 {
status = "disabled";
};

&i3c1 {
status = "okay";

i2c-scl-hz = <DT_FREQ_K(400)>;
i3c-scl-hz = <DT_FREQ_K(400)>;
i3c-od-scl-hz = <DT_FREQ_K(100)>;
};
29 changes: 23 additions & 6 deletions samples/sensor/thermometer/sample.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
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")
harness_config:
fixture: sensor_ambient_temp
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:
- 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
- platform:frdm_mcxn236/mcxn236:SHIELD=p3t1755dp_ard_i2c
sample.sensor.thermometer_i3c:
tags: sensors
harness_config:
fixture: sensor_ambient_temp
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

0 comments on commit 5b001d3

Please sign in to comment.