Line data Source code
1 0 : /*
2 : * SPDX-License-Identifier: Apache-2.0
3 : *
4 : * Copyright (c) 2024 Nordic Semiconductor ASA
5 : */
6 :
7 : #ifndef ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_
8 : #define ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_
9 :
10 : /**
11 : * @brief Short ADC negative input to ground
12 : *
13 : * @details The nRF SAADC hardware only supports differential readings.
14 : * The nRF SAADC SE (single ended) mode is differential with the negative
15 : * input shorted to GND (ground). To use the nRF SAADC SE mode, set the
16 : * negative input to NRF_SAADC_GND:
17 : *
18 : * @code{.dts}
19 : * zephyr,input-positive = <NRF_SAADC_AIN3>;
20 : * zephyr,input-negative = <NRF_SAADC_GND>;
21 : * @endcode
22 : *
23 : * The nRF SAADC driver also supports using the nRF SAADC SE mode in
24 : * emulated "single-ended" mode, as defined by zephyr. In this mode,
25 : * negative readings will be clamped to 0 by software to emulate the
26 : * behavior of an ADC in "single-ended" mode, as defined by zephyr. To
27 : * do this, only define the positive input:
28 : *
29 : * @code{.dts}
30 : * zephyr,input-positive = <NRF_SAADC_AIN3>;
31 : * @endcode
32 : */
33 1 : #define NRF_SAADC_GND 0
34 0 : #define NRF_SAADC_AIN0 1
35 0 : #define NRF_SAADC_AIN1 2
36 0 : #define NRF_SAADC_AIN2 3
37 0 : #define NRF_SAADC_AIN3 4
38 0 : #define NRF_SAADC_AIN4 5
39 0 : #define NRF_SAADC_AIN5 6
40 0 : #define NRF_SAADC_AIN6 7
41 0 : #define NRF_SAADC_AIN7 8
42 :
43 : #endif /* ZEPHYR_INCLUDE_DT_BINDINGS_ADC_NRF_SAADC_H_ */
|