Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
 4.2.99
nrf-saadc.h File Reference

Go to the source code of this file.

Macros

#define NRF_SAADC_GND   0
 Short ADC negative input to ground.
#define NRF_SAADC_AIN0   1
#define NRF_SAADC_AIN1   2
#define NRF_SAADC_AIN2   3
#define NRF_SAADC_AIN3   4
#define NRF_SAADC_AIN4   5
#define NRF_SAADC_AIN5   6
#define NRF_SAADC_AIN6   7
#define NRF_SAADC_AIN7   8

Macro Definition Documentation

◆ NRF_SAADC_AIN0

#define NRF_SAADC_AIN0   1

◆ NRF_SAADC_AIN1

#define NRF_SAADC_AIN1   2

◆ NRF_SAADC_AIN2

#define NRF_SAADC_AIN2   3

◆ NRF_SAADC_AIN3

#define NRF_SAADC_AIN3   4

◆ NRF_SAADC_AIN4

#define NRF_SAADC_AIN4   5

◆ NRF_SAADC_AIN5

#define NRF_SAADC_AIN5   6

◆ NRF_SAADC_AIN6

#define NRF_SAADC_AIN6   7

◆ NRF_SAADC_AIN7

#define NRF_SAADC_AIN7   8

◆ NRF_SAADC_GND

#define NRF_SAADC_GND   0

Short ADC negative input to ground.

The nRF SAADC hardware only supports differential readings. The nRF SAADC SE (single ended) mode is differential with the negative input shorted to GND (ground). To use the nRF SAADC SE mode, set the negative input to NRF_SAADC_GND:

zephyr,input-positive = <NRF_SAADC_AIN3>;
zephyr,input-negative = <NRF_SAADC_GND>;

The nRF SAADC driver also supports using the nRF SAADC SE mode in emulated "single-ended" mode, as defined by zephyr. In this mode, negative readings will be clamped to 0 by software to emulate the behavior of an ADC in "single-ended" mode, as defined by zephyr. To do this, only define the positive input:

zephyr,input-positive = <NRF_SAADC_AIN3>;