RT-Thread RTOS
An open source embedded real-time operating system
rt_adc_sequence_ops Struct Reference

#include <adc_v2.h>

Data Fields

rt_err_t(* start )(struct rt_adc_device *device, rt_uint32_t channels, const struct rt_adc_sequence_cfg *cfg)
 
rt_err_t(* read )(struct rt_adc_device *device, rt_uint32_t *value, rt_int32_t timeout_ms)
 
rt_err_t(* stop )(struct rt_adc_device *device)
 

Detailed Description

ADC finite-sequence operation table.

Field Documentation

◆ start

rt_err_t(* rt_adc_sequence_ops::start) (struct rt_adc_device *device, rt_uint32_t channels, const struct rt_adc_sequence_cfg *cfg)

Start one active finite transfer session.

Parameters
devicePointer to the ADC device object.
channelsADC channel selection mask.
cfgPointer to the sequence request object.
Returns
Operation status.

◆ read

rt_err_t(* rt_adc_sequence_ops::read) (struct rt_adc_device *device, rt_uint32_t *value, rt_int32_t timeout_ms)

Read one converted sample from an active finite transfer session.

Parameters
devicePointer to the ADC device object.
valuePointer to the output sample value.
timeout_msRead timeout in milliseconds; negative means wait forever.
Returns
Operation status.

◆ stop

rt_err_t(* rt_adc_sequence_ops::stop) (struct rt_adc_device *device)

Stop one active finite transfer session.

Parameters
devicePointer to the ADC device object.
Returns
Operation status.