nrfx_saadc_sample_convert

Hi,

I was using the nrfx_saadc_buffer_convert to make everytime a single sample.

void saadc_init(void)
{
  ret_code_t  err_code;
   
  nrf_saadc_channel_config_t channel_config = NRFX_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN2);

  err_code = nrf_drv_saadc_init(NULL, saadc_callback_handler);
  APP_ERROR_CHECK(err_code);

  err_code = nrfx_saadc_channel_init(0, &channel_config);
  APP_ERROR_CHECK(err_code);

  err_code = nrfx_saadc_buffer_convert(m_buffer_pool[0], SAMPLE_BUFFER_LEN);
  APP_ERROR_CHECK(err_code);

  err_code = nrfx_saadc_buffer_convert(m_buffer_pool[1], SAMPLE_BUFFER_LEN);
  APP_ERROR_CHECK(err_code);
}

Now I did find out there is also nrfx_saadc_sample_convert. How do I initialize this?

And do I get my val then by val = p_event->data.done.p_value instead of val = p_event->data.done.p_buffer[i]

Parents Reply Children
No Data
Related