Cannot find include file for nrf_drv_saadc_uninit() function?

Hi

I am using SDK 1.9.1 with VS Code on MacOS to develop for nrf5340. I also have a nrf5340-DK board.

I am having problems finding the right includ file for using the saadc function:

nrf_drv_saadc_uninit()

Here is a list of all my main includes (looks like the last one is the problem!?):

#include <zephyr.h>
#include <device.h>
#include <devicetree.h>
#include <drivers/gpio.h>
#include <drivers/adc.h>
#include <sys/time_units.h>
#include <logging/log.h>
#include <net/socket.h>
#include <stdio.h>
#include <string.h>
#include <nrf_drv_saadc.h>
Can anyone point me to the correct include file so that I can use the nrf_drv_saadc_uninit() function (which is mentioned in several examples / cases).
Thanks!
Gerard
 
  • Hi Gerard,

    The nrf_drv_saadc driver is not part of the nRF Connect SDK, so the examples you have seen using this must be for the nRF5 SDK, and are not relevant in nRF Connect SDK context. Conversely, the include you have for nrf_drv_saadc.h is also not relevant and the file does not exist.

    There are several ways to use the SAADC in nRF Connect SDK though. Either via the Zephyr API, or using nrfx directly (for instance nrfx_saadc_uninit() does the same as nrf_drv_saadc_uninit). For the former, you can refer to the Battery Voltage Measurement sample. For the latter, you can refer to the unofficial sample described in this post.

    Einar

Related