This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Configuring SAADC on NRF9160 using the lower level driver instead of Zephyr

I've gotten the SAADC working in a blocking fashion and been able to evaluate sample times. Now, I'd like to set it up to automatically read three inputs in a row to see how fast I can get three reads in a row. Something isn't right. I don't ever see the callback function getting called. I know that I'm calling the nrfx_saadc_sample() function as I see my debug output. 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (c) 2018 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
*/
#include <gpio.h>
#include <net/socket.h>
#include <nrf9160.h>
#include <stdio.h>
#include <string.h>
#include <uart.h>
#include <adc.h>
#include <zephyr.h>
#include <nrfx.h>
#include <nrfx_saadc.h>
#include <misc/printk.h>
//#include <hal/nrf_saadc.h>
//#include <nrfx_dppi.h>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX