[][src]Trait stm32f3xx_hal_v2::can::Filter

pub trait Filter {
    type Id: Id;
    pub fn from_id(id: Self::Id) -> Self;
pub fn accept_all() -> Self;
pub fn from_mask(mask: u32, filter: u32) -> Self; }

A type that will either accept or filter a Frame. The filtering is done solely on the ID of the Frame.

Associated Types

type Id: Id[src]

The Id type this filter works on

Loading content...

Required methods

pub fn from_id(id: Self::Id) -> Self[src]

Constructs a filter that only accepts Frames with the provided identifier.

pub fn accept_all() -> Self[src]

Constructs a filter that will accept any Frame.

pub fn from_mask(mask: u32, filter: u32) -> Self[src]

Create a Filter from a filter/mask combination.

  • Bit 0..11 is used when matching against base id
  • Bit 0..29 is used when matching against extended_id
  • Bit 29 matches the extended frame flag (can be used for only matching against base/extended ids)
  • Bit 30..32 must be 0

Note: When filtering base id any rule put on bit_pos >= 11 will (for implementers: must) be ignored

Panic

(for implementers: must) panic if mask have bits equal to 1 for bit_position >= 30.

Loading content...

Implementors

impl Filter for CanFilter[src]

type Id = CanId

pub fn from_id(id: Self::Id) -> Self[src]

Construct a filter which filters messages for a specific identified

pub fn accept_all() -> Self[src]

Construct an "empty" filter which will accept all messages

pub fn from_mask(mask: u32, filter: u32) -> Self[src]

Constuct a mask filter. This method accepts two parameters, the mask which designates which bits are actually matched againts and the filter, with the actual bits to match.

Loading content...