You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/can.rs
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -130,15 +130,19 @@ impl embedded_hal_can::Frame for CanFrame {
130
130
impl embedded_hal_can::FilterforCanFilter{
131
131
typeId = CanId;
132
132
133
+
/// Construct a filter which filters messages for a specific identified
133
134
fnfrom_id(id:Self::Id) -> Self{
134
135
CanFilter::new(CanFilterData::IdFilter(id))
135
136
}
136
137
138
+
/// Construct an "empty" filter which will accept all messages
137
139
fnaccept_all() -> Self{
138
140
CanFilter::new(CanFilterData::AcceptAll)
139
141
}
140
142
141
143
// TODO: Constructing filters like this is fairly limiting because ideally we would have the full "filter state" available, so for non-extended filters this could be 2 masks and filters or 4 ids for id lists
144
+
145
+
/// 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.
142
146
fnfrom_mask(mask:u32,filter:u32) -> Self{
143
147
assert!(
144
148
mask < MAX_EXTENDED_ID,
@@ -417,6 +421,7 @@ impl Receiver for CanFifo {
417
421
Err(nb::Error::WouldBlock)
418
422
}
419
423
424
+
/// Sets a filter in the next open filter register.
0 commit comments