Struct esp32c3_hal::twai::filter::SingleExtendedFilter
source · pub struct SingleExtendedFilter { /* 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.
Implementations§
source§impl SingleExtendedFilter
impl SingleExtendedFilter
sourcepub const fn new(id: &[u8; 29], rtr: &[u8; 1]) -> SingleExtendedFilter
pub const fn new(id: &[u8; 29], rtr: &[u8; 1]) -> SingleExtendedFilter
Create a filter that matches against a single 29-bit extended id.
The filter can match against the packet’s id and the rtr bit.
Examples
A filter matching any odd extended ids, with any rtr value.
const FILTER: twai::filter::SingleExtendedFilter =
twai::filter::SingleExtendedFilter::new(b"xxxxxxxxxxxxxxxxxxxxxxxxxxxx1", b"x");
sourcepub fn new_from_code_mask(
id_code: ExtendedId,
id_mask: ExtendedId,
rtr_code: bool,
rtr_mask: bool
) -> SingleExtendedFilter
pub fn new_from_code_mask( id_code: ExtendedId, id_mask: ExtendedId, rtr_code: bool, rtr_mask: bool ) -> SingleExtendedFilter
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 SingleExtendedFilter
impl Filter for SingleExtendedFilter
source§const FILTER_TYPE: FilterType = FilterType::Single
const FILTER_TYPE: FilterType = FilterType::Single
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.
fn filter_type(&self) -> FilterType
Auto Trait Implementations§
impl RefUnwindSafe for SingleExtendedFilter
impl Send for SingleExtendedFilter
impl Sync for SingleExtendedFilter
impl Unpin for SingleExtendedFilter
impl UnwindSafe for SingleExtendedFilter
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