1# Copyright (c) 2023, deveritec GmbH
2# SPDX-License-Identifier: Apache-2.0
3
4description: |
5  Texas Instruments Low-Power Linear 3D Hall-Effect Sensor with an I2C interface.
6
7  See the specification for the default I2C address.
8
9  The specification of the sensor can be found at:
10    https://www.ti.com/lit/ds/symlink/tmag5273.pdf
11    https://www.ti.com/lit/ds/symlink/tmag3001.pdf
12
13    When setting the enum properties in a .dts or .dtsi file you may
14    include tmag5273.h and use the macros defined there.
15
16    Example:
17    #include <zephyr/dt-bindings/sensor/tmag5273.h>
18
19    tmag5273: tmag5273@0 {
20      ...
21      axis = <TMAG5273_DT_AXIS_XYZ>;
22      range = <TMAG5273_DT_AXIS_RANGE_HIGH>;
23    };
24
25compatible: "ti,tmag5273"
26
27include: [sensor-device.yaml, i2c-device.yaml]
28
29properties:
30  operation-mode:
31    type: int
32    default: 0
33    enum: [0, 1]
34    description: |
35      Sensor mode used if set to "active".
36      Defaults to continuous sampling (TMAG5273_DT_OPER_MODE_CONTINUOUS).
37
38      - 0 # TMAG5273_DT_OPER_MODE_CONTINUOUS (continuous)
39      - 1 # TMAG5273_DT_OPER_MODE_STANDBY    (standby)
40
41  axis:
42    type: int
43    default: 7
44    enum: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
45    description: |
46      Magnet axis channel inputs.
47      Defaults to measure all axis (TMAG5273_DT_AXIS_XYZ).
48
49      - 0  # TMAG5273_DT_AXIS_NONE
50      - 1  # TMAG5273_DT_AXIS_X
51      - 2  # TMAG5273_DT_AXIS_Y
52      - 3  # TMAG5273_DT_AXIS_Z
53      - 4  # TMAG5273_DT_AXIS_XY
54      - 5  # TMAG5273_DT_AXIS_XZ
55      - 6  # TMAG5273_DT_AXIS_YZ
56      - 7  # TMAG5273_DT_AXIS_XYZ
57      - 8  # TMAG5273_DT_AXIS_XYX (pseudo-simultaneous sampling)
58      - 9  # TMAG5273_DT_AXIS_YXY (pseudo-simultaneous sampling)
59      - 10 # TMAG5273_DT_AXIS_YZY (pseudo-simultaneous sampling)
60      - 11 # TMAG5273_DT_AXIS_XZX (pseudo-simultaneous sampling)
61
62  temperature:
63    type: boolean
64    description: |
65      Select for temperature measurement.
66
67  range:
68    type: int
69    default: 1
70    enum: [0, 1, 2]
71    description: |
72      XYZ-measurement range for magnetic-field value.
73      Defaults to lower range (higher resolution; TMAG5273_DT_AXIS_RANGE_LOW).
74
75      - 0 # TMAG5273_DT_AXIS_RANGE_LOW      (+/-40 mT (TMAG5273A1) or +/-133 mT (TMAG5273A2))
76      - 1 # TMAG5273_DT_AXIS_RANGE_HIGH     (+/-80 mT (TMAG5273A1) or +/-266 mT (TMAG5273A2))
77      - 2 # TMAG5273_DT_AXIS_RANGE_RUNTIME  (@runtime (initial value is: "high"))
78
79  int-gpios:
80    type: phandle-array
81    description: |
82      The INT signal connection.
83
84      The signal is active-low as produced by the sensor.
85      Either used for interrupt signaling, or triggering a conversion.
86
87  temperature-coefficient:
88    type: int
89    default: 0
90    enum: [0, 1, 2]
91    description: |
92      Selects the magnet temperature coefficient.
93      Defaults to none (TMAG5273_DT_TEMP_COEFF_NONE).
94
95        - 0 # TMAG5273_DT_TEMP_COEFF_NONE    (none)
96        - 1 # TMAG5273_DT_TEMP_COEFF_NDBFE   (0.12 %/deg C (NdBFe))
97        - 2 # TMAG5273_DT_TEMP_COEFF_CERAMIC (0.2 %/deg C (Ceramic))
98
99      Ignored if temperature is not measured.
100
101  trigger-conversion-via-int:
102    type: boolean
103    description: |
104      Selects initiation of a single conversion based on a trigger via
105      the INT-pin if enabled, and via I2C-command if disabled.
106
107      Used in "standby"-, "wakeup-and-sleep"- and "sleep"-mode.
108      Using I2C-conversion trigger may result in (handled) I2C-errors.
109
110  angle-magnitude-axis:
111    type: int
112    default: 0
113    enum: [0, 1, 2, 3, 4]
114    description: |
115      Enables angle calculation, magnetic gain, and offset corrections
116      between two selected magnetic channels.
117      Defaults to no additional calculations (TMAG5273_DT_ANGLE_MAG_NONE).
118
119      - 0 # TMAG5273_DT_ANGLE_MAG_NONE    (deactivated)
120      - 1 # TMAG5273_DT_ANGLE_MAG_XY      (x/y)
121      - 2 # TMAG5273_DT_ANGLE_MAG_YZ      (y/z)
122      - 3 # TMAG5273_DT_ANGLE_MAG_XZ      (x/z)
123      - 4 # TMAG5273_DT_ANGLE_MAG_RUNTIME (@runtime (initial value is: "deactivated"))
124
125  ch-mag-gain-correction:
126    type: int
127    default: 0
128    enum: [0, 1]
129    description: |
130      Channel for the magnitude gain correction.
131      Defaults to 1st channel.
132
133        - 0 # TMAG5273_DT_CORRECTION_CH_1 (1st channel)
134        - 1 # TMAG5273_DT_CORRECTION_CH_2 (2nd channel)
135
136      Only active if angle-magnitude-calculation is active.
137
138  average-mode:
139    type: int
140    default: 1
141    enum: [0, 1, 2, 3, 4, 5]
142    description: |
143      Enables additional sampling of the sensor data to reduce the noise effect
144      (or to increase resolution).
145
146      Note that averaging will influence the output data rate.
147      Defaults to 2x averaging (TMAG5273_DT_AVERAGING_2X).
148
149      - 0 # TMAG5273_DT_AVERAGING_NONE  (10.0-kSPS (3-axes) or 20-kSPS   (1 axis))
150      - 1 # TMAG5273_DT_AVERAGING_2X    (5.7-kSPS  (3-axes) or 13.3-kSPS (1 axis))
151      - 2 # TMAG5273_DT_AVERAGING_4X    (3.1-kSPS  (3-axes) or 8.0-kSPS  (1 axis))
152      - 3 # TMAG5273_DT_AVERAGING_8X    (1.6-kSPS  (3-axes) or 4.4-kSPS  (1 axis))
153      - 4 # TMAG5273_DT_AVERAGING_16X   (0.8-kSPS  (3-axes) or 2.4-kSPS  (1 axis))
154      - 5 # TMAG5273_DT_AVERAGING_32X   (0.4-kSPS  (3-axes) or 1.2-kSPS  (1 axis))
155
156  crc-enabled:
157    type: boolean
158    description: |
159      Activate I2C CRC byte to be sent.
160
161  low-noise:
162    type: boolean
163    description: |
164      Select low-noise mode when enabled, and low-power mode when disabled.
165
166  ignore-diag-fail:
167    type: boolean
168    description: |
169      Ignore detected diagnostic fail.
170      According to the manual, this should be done if VCC < 2.3V.
171