Skip to main content

CanFilter

Struct CanFilter 

Source
pub struct CanFilter<BIT: BitMode, MODE: FilterMode> {
    pub bank: usize,
    pub id_value: u32,
    pub id_mask: u32,
    pub bit_mode: BIT,
    pub mode: MODE,
}
Expand description

See table 24-1 of the reference manual for more details on filtering and modes. Each filter is applied for only one bank and for one register on it bank

Fields§

§bank: usize

Filter bank number, 0-27

§id_value: u32

Values for STID:EXID:IDE:RTR:0 from msb to lsb to be matched with an incoming message’s values. In IdList mode, value should be a 32-bit id or two 16-bit ids.

§id_mask: u32

Bit mask to be applied to incoming message before comparing it to a predefined value. In IdList mode, this is used in the same way as id_value is.

§bit_mode: BIT§mode: MODE

Implementations§

Source§

impl CanFilter<Bit16Mode, ListMode>

Source

pub fn get(&mut self, index: usize) -> Option<Bit16IdReg<'_>>

Source§

impl CanFilter<Bit16Mode, MaskMode>

Source

pub fn get(&mut self, index: usize) -> Option<Bit16MaskReg<'_>>

Source§

impl<MODE: FilterMode> CanFilter<Bit32Mode, MODE>

Source

pub fn use_16bit(self) -> CanFilter<Bit16Mode, MODE>

Convert filter to 16bit mode Register values in selected bank will be reset

Source§

impl CanFilter<Bit32Mode, ListMode>

Source

pub fn new_id_list() -> Self

Create a filter to configure id list

Source§

impl CanFilter<Bit32Mode, MaskMode>

Source

pub fn accept_all() -> Self

Creates a filter that accepts all frames

Source

pub fn new_id_mask() -> Self

Source§

impl CanFilter<Bit32Mode, ListMode>

Source

pub fn get(&mut self, index: usize) -> Option<Bit32IdReg<'_>>

Source§

impl<BIT: BitMode, MODE: FilterMode> CanFilter<BIT, MODE>

Source

pub fn set_bank(&mut self, bank: usize) -> &mut Self

Trait Implementations§

Source§

impl From<[(StandardId, FilterOptions); 4]> for CanFilter<Bit16Mode, ListMode>

Source§

fn from(value: [(StandardId, FilterOptions); 4]) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<BIT, MODE> Freeze for CanFilter<BIT, MODE>
where BIT: Freeze, MODE: Freeze,

§

impl<BIT, MODE> RefUnwindSafe for CanFilter<BIT, MODE>
where BIT: RefUnwindSafe, MODE: RefUnwindSafe,

§

impl<BIT, MODE> Send for CanFilter<BIT, MODE>
where BIT: Send, MODE: Send,

§

impl<BIT, MODE> Sync for CanFilter<BIT, MODE>
where BIT: Sync, MODE: Sync,

§

impl<BIT, MODE> Unpin for CanFilter<BIT, MODE>
where BIT: Unpin, MODE: Unpin,

§

impl<BIT, MODE> UnsafeUnpin for CanFilter<BIT, MODE>
where BIT: UnsafeUnpin, MODE: UnsafeUnpin,

§

impl<BIT, MODE> UnwindSafe for CanFilter<BIT, MODE>
where BIT: UnwindSafe, MODE: UnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.