forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
f861b4f
commit 5b001d3
Showing
3 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
boards/shields/p3t1755dp_ard_i2c/boards/frdm_mcxn236.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
27
boards/shields/p3t1755dp_ard_i3c/boards/frdm_mcxn236.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |