Struct Serial

Source
pub struct Serial<R: Registers> {
    pub irq_handler: Option<IrqHandler<R>>,
    /* private fields */
}

Fields§

§irq_handler: Option<IrqHandler<R>>

Implementations§

Source§

impl<R: Registers> Serial<R>

Source

pub fn new(registers: R) -> Self

Source

pub fn try_take_tx(&mut self) -> Option<Sender<R>>

Source

pub fn try_take_rx(&mut self) -> Option<Receiver<R>>

Source

pub unsafe fn get_irq_event(&self) -> IrqEvent

Returns the irq state of this Serial.

§Safety

Only used in interrupt handler.

Source

pub unsafe fn clean_irq_event(&self, state: IrqEvent)

Cleans the irq state of this Serial.

§Safety

Only used in interrupt handler.

Trait Implementations§

Source§

impl<R: Registers> DriverGeneric for Serial<R>

Source§

fn open(&mut self) -> Result<(), ErrorBase>

Source§

fn close(&mut self) -> Result<(), ErrorBase>

Source§

impl<R: Registers> Interface for Serial<R>

Source§

fn handle_irq(&mut self)

Call in irq handler.
Source§

fn take_tx(&mut self) -> Option<Box<dyn Sender>>

Sender will be given back when dropped.
Source§

fn take_rx(&mut self) -> Option<Box<dyn Reciever>>

Reciever will be given back when dropped.
Source§

impl<R: Registers> Send for Serial<R>

Auto Trait Implementations§

§

impl<R> Freeze for Serial<R>
where R: Freeze,

§

impl<R> !RefUnwindSafe for Serial<R>

§

impl<R> Sync for Serial<R>
where R: Sync,

§

impl<R> Unpin for Serial<R>
where R: Unpin,

§

impl<R> !UnwindSafe for Serial<R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.