Hello,
I have a very straightforward issue - I can't get the nRF5340 LPCOMP to work! In fact, I haven't been able to find any working example code to go off of, and my own attempts at using the nrfx drivers have failed. My ultimate goal is to use the LPCOMP to wake up the nRF5340 from a system off state in an IoT device that I'm developing. To start with, I just need to get some code to enable the LPCOMP and send an interrupt when triggered.
#include <nrfx_lpcomp.h> #define INPUT 0 static void lpcomp_event_handler(nrf_lpcomp_event_t event) { NRF_LPCOMP->EVENTS_READY = 0; } static void lpcomp_init(void) { uint32_t err_code; nrfx_lpcomp_config_t config = NRFX_LPCOMP_DEFAULT_CONFIG(INPUT); err_code = nrfx_lpcomp_init(&config, lpcomp_event_handler); nrfx_lpcomp_enable(); } void main(void) { lpcomp_init(); }
This code does not build - it yields undefined reference to `nrfx_lpcomp_enable' and undefined reference to `nrfx_lpcomp_init'. I expect that there are likely several problems with this code, given that it's extremely bare and I'm not familiar with the nrfx drivers, so if anyone could point me in the right direction on how to enable the LPCOMP, I would appreciate it!
Best,
Nick B