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: thermometer: add trigger support to sample
Add optional trigger support to sample. If the selected temperature sensor supports triggering using the AMBIENT_TEMP channel, then temperature thresholds will be set for +0.5 and +1.5 degrees celsius above ambient temperature. Sample overlays are provided for the FRDM_K22F board to demonstrate enabling this feature. Signed-off-by: Daniel DeGrasse <daniel@degrasse.com>
- Loading branch information
1 parent
d382841
commit 7993e7d
Showing
5 changed files
with
140 additions
and
18 deletions.
There are no files selected for viewing
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
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,2 @@ | ||
# Enable trigger support | ||
CONFIG_TCN75A_TRIGGER_GLOBAL_THREAD=y |
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,24 @@ | ||
/* | ||
* Copyright 2023 Daniel DeGrasse <daniel@degrasse.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
aliases { | ||
ambient-temp0 = &temp_sensor; | ||
}; | ||
}; | ||
|
||
/* | ||
* Note- TCN75A is not present on the FRDM-K22F eval board, and must be | ||
* wired to i2c0 and PTC2 externally | ||
*/ | ||
&i2c0 { | ||
temp_sensor: tcn75a@48 { | ||
reg = <0x48>; | ||
compatible = "microchip,tcn75a"; | ||
alert-gpios = <&gpioc 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | ||
resolution = "10-bit"; | ||
}; | ||
}; |
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
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