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

is there value in using nrf_drv_saadc_channel_uninit and nrf_drv_spi_uninit

I am using a nRF52840 chip in a custom board. I will be using all the SAADC channels, as well as 4 SPI connected ADCs. 

The board itself will likely be powered for days at a time, although not particularly busy at any given time. It doesn't seem like the SAADC or SPI drivers allocate any memory of their own, so I'm wondering if there is value in initializing, using and then uninitializing the 6 SAADC and 4 SPI devices I'll be using, or if I can just initialize them all at boot time and then use them as needed. I'm not tight on RAM so keeping context for all 10 devices isn't a problem, and power isn't a problem. 

Thoughts?   

Parents Reply Children
  • Perfect. Thanks. I asked the question before I got in to the nitty-gritty of using the SPI device with multiple chip selects. It turns out that (unless I vastly misunderstand something ) that when I change  chip selects to select a different device through the same SPI interface I need to uninitialize and re-initialize anyway. 

    As an aside, it would be nice if there was a way to tell if a SPI device was initialized that was cleaner than trying to initialize it, getting an error code, uninitialize it, and then re-try the initialize. It works, but it's slightly inelegant. :)

Related