Struct esp_idf_svc::hal::adc::continuous::AdcDriver
source · pub struct AdcDriver<'d> { /* private fields */ }
Implementations§
source§impl<'d> AdcDriver<'d>
impl<'d> AdcDriver<'d>
pub fn new<A>(
adc: impl Peripheral<P = A> + 'd,
config: &Config,
channels: impl AdcChannels<Adc = A> + 'd,
) -> Result<AdcDriver<'d>, EspError>where
A: Adc,
pub fn handle(&self) -> *mut adc_continuous_ctx_t
pub fn unit(&self) -> u32
pub fn start(&mut self) -> Result<(), EspError>
pub fn stop(&mut self) -> Result<(), EspError>
pub fn read( &mut self, buf: &mut [AdcMeasurement], timeout: u32, ) -> Result<usize, EspError>
pub fn read_bytes( &mut self, buf: &mut [u8], timeout: u32, ) -> Result<usize, EspError>
pub async fn read_async( &mut self, buf: &mut [AdcMeasurement], ) -> Result<usize, EspError>
pub async fn read_bytes_async( &mut self, buf: &mut [u8], ) -> Result<usize, EspError>
Trait Implementations§
source§impl<'d> ErrorType for AdcDriver<'d>
impl<'d> ErrorType for AdcDriver<'d>
§type Error = EspIOError
type Error = EspIOError
Error type of all the IO operations on this type.
source§impl<'d> Read for AdcDriver<'d>
impl<'d> Read for AdcDriver<'d>
source§fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize, <AdcDriver<'d> as ErrorType>::Error>
fn read( &mut self, buf: &mut [u8], ) -> Result<usize, <AdcDriver<'d> as ErrorType>::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
source§fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read moresource§impl<'d> Read for AdcDriver<'d>
impl<'d> Read for AdcDriver<'d>
source§async fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize, <AdcDriver<'d> as ErrorType>::Error>
async fn read( &mut self, buf: &mut [u8], ) -> Result<usize, <AdcDriver<'d> as ErrorType>::Error>
Read some bytes from this source into the specified buffer, returning how many bytes were read. Read more
source§async fn read_exact(
&mut self,
buf: &mut [u8],
) -> Result<(), ReadExactError<Self::Error>>
async fn read_exact( &mut self, buf: &mut [u8], ) -> Result<(), ReadExactError<Self::Error>>
Read the exact number of bytes required to fill
buf
. Read more