Function riot_sys::adc_sample

source ·
pub unsafe extern "C" fn adc_sample(
    line: adc_t,
    res: adc_res_t
) -> i32
Expand description

@brief Sample a value from the given ADC line

This function blocks until the conversion has finished. Please note, that if more than one line share the same ADC device, and if these lines are sampled at the same time (e.g. from different threads), the one called secondly waits for the first to finish before its conversion starts.

@param[in] line line to sample @param[in] res resolution to use for conversion

@return the sampled value on success @return -1 if resolution is not applicable