Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Issue with nrfx_lpcomp.h

I am trying to use the LPCOMP API, but I am having trouble with the following function:

nrfx_err_t nrfx_lpcomp_init ( nrfx_lpcomp_config_t const *  p_config,
nrfx_lpcomp_event_handler_t  event_handler 
)

I think have have the proper header files included, but the compiler outputs "undefined reference to 'nrfx_lpcomp_init'. I am using nRF SDK 15.0.0.

Here are the relevant code snippets:

#include "nrfx_lpcomp.h"

void LPCOMP_INIT(){

uint32_t err_code;
nrfx_lpcomp_config_t config = NRFX_LPCOMP_DEFAULT_CONFIG;
config.input = NRF_LPCOMP_INPUT_2;
nrf_lpcomp_config_t hal_config;
hal_config.reference = NRF_LPCOMP_REF_SUPPLY_4_8;
hal_config.detection = NRF_LPCOMP_DETECT_CROSS;
config.hal = hal_config;

err_code = nrfx_lpcomp_init(&config, LPcomp_handler);
APP_ERROR_CHECK(err_code);
nrfx_lpcomp_enable();
}

What am I doing wrong? Thank you for your help.

Parents Reply Children
Related