Skip to content

Commit

Permalink
drivers: sensor: ntc-thermistor: Add Murata NCP15WB473 thermistor
Browse files Browse the repository at this point in the history
Add murata,ncp15wb473 property together with a compensation table. The
table can be found on the vendor's website
(Resistance VS. Temperature tab):
https://www.murata.com/en-us/products/productdetail?partno=NCP15WB473F03RC

Signed-off-by: Paweł Anikiel <[email protected]>
  • Loading branch information
Paweł Anikiel authored and MaureenHelm committed Sep 19, 2023
1 parent 5db0587 commit ebdfb6b
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/sensor/ntc_thermistor/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ config NTC_THERMISTOR
bool "NTC Thermistor"
default y
depends on DT_HAS_NTC_THERMISTOR_GENERIC_ENABLED || \
DT_HAS_EPCOS_B57861S0103A039_ENABLED
DT_HAS_EPCOS_B57861S0103A039_ENABLED || \
DT_HAS_MURATA_NCP15WB473_ENABLED
select ADC
help
Enable driver for Zephyr NTC Thermistor.
26 changes: 26 additions & 0 deletions drivers/sensor/ntc_thermistor/ntc_thermistor.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,3 +156,29 @@ static __unused const struct ntc_compensation comp_epcos_b57861s0103a039[] = {

DT_INST_FOREACH_STATUS_OKAY_VARGS(NTC_THERMISTOR_DEFINE, DT_DRV_COMPAT,
comp_epcos_b57861s0103a039)

/* murata,ncp15wb473 */
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT murata_ncp15wb473

static __unused const struct ntc_compensation comp_murata_ncp15wb473[] = {
{ -25, 655802 },
{ -15, 360850 },
{ -5, 206463 },
{ 5, 122259 },
{ 15, 74730 },
{ 25, 47000 },
{ 35, 30334 },
{ 45, 20048 },
{ 55, 13539 },
{ 65, 9328 },
{ 75, 6544 },
{ 85, 4674 },
{ 95, 3388 },
{ 105, 2494 },
{ 115, 1860 },
{ 125, 1406 },
};

DT_INST_FOREACH_STATUS_OKAY_VARGS(NTC_THERMISTOR_DEFINE, DT_DRV_COMPAT,
comp_murata_ncp15wb473)
8 changes: 8 additions & 0 deletions dts/bindings/sensor/murata,ncp15wb473.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2023 Google LLC
# SPDX-License-Identifier: Apache-2.0

description: MURATA NCP15WB473 thermistor

compatible: "murata,ncp15wb473"

include: ntc-thermistor.yaml
9 changes: 9 additions & 0 deletions tests/drivers/build_all/sensor/adc.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,12 @@ test_epcos_b57861s0103a039: epcos-b57861s0103a039 {
pulldown-ohm = <10000>;
connected-positive;
};

test_murata_ncp15wb473: murata-ncp15wb473 {
compatible = "murata,ncp15wb473";
io-channels = <&adc0 0>;
pullup-uv = <3300000>;
pullup-ohm = <0>;
pulldown-ohm = <10000>;
connected-positive;
};

0 comments on commit ebdfb6b

Please sign in to comment.