pub struct DualExtendedFilter { /* private fields */ }Expand description
Warning: This is not a perfect filter. Standard IDs that match the bit layout of this filter will also be accepted.
NOTE: The dual extended id acceptance filters can only match “the first 16 bits of the 29-bit ID”.
Implementations§
Source§impl DualExtendedFilter
impl DualExtendedFilter
Sourcepub const fn new(ids: [&BitFilter<16>; 2]) -> Self
pub const fn new(ids: [&BitFilter<16>; 2]) -> Self
Create a filter that matches the first 16 bits of two 29-bit extended IDs.
§Examples
A filter that matches IDs with 4 bits either set or reset in the higher part of the id. For example this id matches: 0x000f000f, 0x000f000a, 0x0000000a, 0x0000000b. But it does not match: 0x000a000a
ⓘ
const FILTER: twai::filter::DualExtendedFilter =
twai::filter::DualExtendedFilter::new([b"xxxxxxxxx0000xxx", b"xxxxxxxxx1111xxx"]);Sourcepub fn new_from_code_mask(ids_code: [u16; 2], ids_mask: [u16; 2]) -> Self
pub fn new_from_code_mask(ids_code: [u16; 2], ids_mask: [u16; 2]) -> Self
Create a new filter matching the first 16 bits of two 29-bit IDs.
The masks indicate which bits of the code the filter should match against. Set bits in the mask indicate that the corresponding bit in the code should match.
Trait Implementations§
Source§impl Filter for DualExtendedFilter
Available on crate feature unstable only.
impl Filter for DualExtendedFilter
Available on crate feature
unstable only.Source§const FILTER_TYPE: FilterType = FilterType::Dual
const FILTER_TYPE: FilterType = FilterType::Dual
The type of the filter.
Source§fn to_registers(&self) -> [u8; 8]
fn to_registers(&self) -> [u8; 8]
Get the register level representation of the filter.
Source§fn filter_type(&self) -> FilterType
fn filter_type(&self) -> FilterType
Returns filter type.
Auto Trait Implementations§
impl Freeze for DualExtendedFilter
impl RefUnwindSafe for DualExtendedFilter
impl Send for DualExtendedFilter
impl Sync for DualExtendedFilter
impl Unpin for DualExtendedFilter
impl UnwindSafe for DualExtendedFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more