drivers: adc: add adc_read_dt api
This was missing from the ADC Devicetree API set. Signed-off-by: Nick Ward <nix.ward@gmail.com>
This commit is contained in:
parent
a05c88daa5
commit
451568c645
1 changed files with 15 additions and 0 deletions
|
@ -681,6 +681,21 @@ static inline int z_impl_adc_read(const struct device *dev,
|
|||
return api->read(dev, sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set a read request from a struct adc_dt_spec.
|
||||
*
|
||||
* @param spec ADC specification from Devicetree.
|
||||
* @param sequence Structure specifying requested sequence of samplings.
|
||||
*
|
||||
* @return A value from adc_read().
|
||||
* @see adc_read()
|
||||
*/
|
||||
static inline int adc_read_dt(const struct adc_dt_spec *spec,
|
||||
const struct adc_sequence *sequence)
|
||||
{
|
||||
return adc_read(spec->dev, sequence);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set an asynchronous read request.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue