Struct esp_idf_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>( adc: impl Peripheral<P = A> + 'd, config: &Config, channels: impl AdcChannels<Adc = A> + 'd, ) -> Result<Self, EspError>
pub fn handle(&self) -> adc_continuous_handle_t
pub fn unit(&self) -> adc_unit_t
pub fn start(&mut self) -> Result<(), EspError>
pub fn stop(&mut self) -> Result<(), EspError>
pub fn read( &mut self, buf: &mut [AdcMeasurement], timeout: TickType_t, ) -> Result<usize, EspError>
pub fn read_bytes( &mut self, buf: &mut [u8], timeout: TickType_t, ) -> 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, Self::Error>
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::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, Self::Error>
async fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::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