Struct esp_idf_svc::hal::uart::AsyncUartRxDriver
source · pub struct AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,{ /* private fields */ }
Implementations§
source§impl<'d> AsyncUartRxDriver<'d, UartRxDriver<'d>>
impl<'d> AsyncUartRxDriver<'d, UartRxDriver<'d>>
pub fn new( uart: impl Peripheral<P = impl Uart> + 'd, rx: impl Peripheral<P = impl InputPin> + 'd, cts: Option<impl Peripheral<P = impl InputPin> + 'd>, rts: Option<impl Peripheral<P = impl OutputPin> + 'd>, config: &Config, ) -> Result<AsyncUartRxDriver<'d, UartRxDriver<'d>>, EspError>
source§impl<'d, T> AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
impl<'d, T> AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
pub fn wrap(driver: T) -> Result<AsyncUartRxDriver<'d, T>, EspError>
pub fn wrap_custom( driver: T, priority: Option<u8>, pin_to_core: Option<Core>, ) -> Result<AsyncUartRxDriver<'d, T>, EspError>
pub fn driver(&self) -> &UartRxDriver<'d>
pub fn driver_mut(&mut self) -> &mut UartRxDriver<'d>
pub async fn read(&self, buf: &mut [u8]) -> Result<usize, EspError>
Trait Implementations§
source§impl<'d, T> Drop for AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
impl<'d, T> Drop for AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
source§impl<'d, T> ErrorType for AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
impl<'d, T> ErrorType for AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
§type Error = EspIOError
type Error = EspIOError
Error type of all the IO operations on this type.
source§impl<'d, T> Read for AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
impl<'d, T> Read for AsyncUartRxDriver<'d, T>where
T: BorrowMut<UartRxDriver<'d>>,
source§async fn read(
&mut self,
buf: &mut [u8],
) -> Result<usize, <AsyncUartRxDriver<'d, T> as ErrorType>::Error>
async fn read( &mut self, buf: &mut [u8], ) -> Result<usize, <AsyncUartRxDriver<'d, T> 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