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

SAADC with repeated conversion at interval and callback not possible?

I am implementing a system that needs to read all 8 adc channels at a set interval and wish to use the asynch mode to do this as it gives the lowest power consumption.

Using a sequence complete callback I can return a ADC_ACTION_REPEAT which will allow the conversions to be triggered on the interval specified in the adc_sequence_options structure.
I can also hook up the k_poll_event/k_poll_signal pair but there is no provision in the code for allowing the custom callback to send the signals as it has no access to the adc context. Futher more I can not find any way of configuring the api to deliver these notifications on anything other than sequence end.

Am I missing something?
I would rather not use a separate timer to trigger async conversions that end for every sequence, just to get this signal.

Parents Reply
  • Thank you. I did find that I can take the k_poll_signal created by my init of the system and signal that with k_poll_signal_raise() in my adc callback before returning a repeat action. This apparently does give the desired effect and the timing appears ok. Since the callback happens as part of isr handling it should also mean it allows the thread waiting to sleep most efficiently conserving power.

Children
Related