Skip to content

Commit

Permalink
feat: add support for TDK NTCG103JF103FT1 thermistor
Browse files Browse the repository at this point in the history
Adds compensation table and bindings for NTCG103JF103FT1 thermistor

Signed-off-by: Maxmillion McLaughlin <github@maxmclau.com>
  • Loading branch information
maxmclau authored and fabiobaltieri committed Dec 8, 2023
1 parent f69641f commit 8ab1c75
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/sensor/ntc_thermistor/Kconfig
Expand Up @@ -7,7 +7,8 @@ config NTC_THERMISTOR
default y
depends on DT_HAS_NTC_THERMISTOR_GENERIC_ENABLED || \
DT_HAS_EPCOS_B57861S0103A039_ENABLED || \
DT_HAS_MURATA_NCP15WB473_ENABLED
DT_HAS_MURATA_NCP15WB473_ENABLED || \
DT_HAS_TDK_NTCG163JF103FT1_ENABLED
select ADC
help
Enable driver for Zephyr NTC Thermistor.
26 changes: 26 additions & 0 deletions drivers/sensor/ntc_thermistor/ntc_thermistor.c
Expand Up @@ -217,3 +217,29 @@ static __unused const struct ntc_compensation comp_murata_ncp15wb473[] = {

DT_INST_FOREACH_STATUS_OKAY_VARGS(NTC_THERMISTOR_DEFINE, DT_DRV_COMPAT,
comp_murata_ncp15wb473)

/* tdk,ntcg163jf103ft1 */
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT tdk_ntcg163jf103ft1

static __unused const struct ntc_compensation comp_tdk_ntcg163jf103ft1[] = {
{ -25, 86560 },
{ -15, 53460 },
{ -5, 33930 },
{ 5, 22070 },
{ 15, 14700 },
{ 25, 10000 },
{ 35, 6942 },
{ 45, 4911 },
{ 55, 3536 },
{ 65, 2588 },
{ 75, 1924 },
{ 85, 1451 },
{ 95, 1110 },
{ 105, 860 },
{ 115, 674 },
{ 125, 534 },
};

DT_INST_FOREACH_STATUS_OKAY_VARGS(NTC_THERMISTOR_DEFINE, DT_DRV_COMPAT,
comp_tdk_ntcg163jf103ft1)
8 changes: 8 additions & 0 deletions dts/bindings/sensor/tdk,ntcg163jf103ft1.yaml
@@ -0,0 +1,8 @@
# Copyright (c) 2023 Urban Sky LLC.
# SPDX-License-Identifier: Apache-2.0

description: TDK NTCG163JF103FT1 thermistor

compatible: "tdk,ntcg163jf103ft1"

include: ntc-thermistor.yaml
1 change: 1 addition & 0 deletions dts/bindings/vendor-prefixes.txt
Expand Up @@ -606,6 +606,7 @@ tbs-biometrics Touchless Biometric Systems AG
tcg Trusted Computing Group
tcl Toby Churchill Ltd.
tcs Shenzhen City Tang Cheng Technology Co., Ltd.
tdk TDK Corporation.
tdo Shangai Top Display Optoelectronics Co., Ltd
technexion TechNexion
technologic Technologic Systems
Expand Down
9 changes: 9 additions & 0 deletions tests/drivers/build_all/sensor/adc.dtsi
Expand Up @@ -70,3 +70,12 @@ test_murata_ncp15wb473: murata-ncp15wb473 {
pulldown-ohm = <10000>;
connected-positive;
};

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

0 comments on commit 8ab1c75

Please sign in to comment.