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
/// A CAN identifier, which can be either 11 or 27 (extended) bits. u16 and u32 respectively are used here despite the fact that the upper bits are unused.
23
+
/// A CAN identifier, which can be either 11 or 27 (extended) bits.
24
+
/// u16 and u32 respectively are used here despite the fact that the upper bits are unused.
17
25
#[derive(Debug,Copy,Clone,Eq,PartialEq)]
18
26
pubenumCanId{
19
27
BaseId(u16),
@@ -22,14 +30,16 @@ pub enum CanId {
22
30
23
31
/// A CAN frame consisting of a destination ID and up to 8 bytes of data.
24
32
///
25
-
/// Currently, we always allocate a fixed size array for each frame regardless of actual size, but this could be improved in the future using const-generics.
33
+
/// Currently, we always allocate a fixed size array for each frame regardless
34
+
/// of actual size, but this could be improved in the future using const-generics.
26
35
#[derive(Debug,Clone,Eq,PartialEq)]
27
36
pubstructCanFrame{
28
37
pubid:CanId,
29
38
pubdata:Vec<u8,U8>,
30
39
}
31
40
32
-
/// Represents the operating mode of a CAN filter, which can either contain a list of identifiers, or a mask to match on.
41
+
/// Represents the operating mode of a CAN filter, which can either contain a
42
+
/// list of identifiers, or a mask to match on.
33
43
pubenumFilterMode{
34
44
Mask,
35
45
List,
@@ -58,7 +68,8 @@ pub struct Can {
58
68
_tx: gpioa::PA12<AF9>,
59
69
}
60
70
61
-
/// A CAN FIFO which is used to receive and buffer messages from the CAN network that match on of the assigned filters.
71
+
/// A CAN FIFO which is used to receive and buffer messages from the CAN
72
+
/// network that match on of the assigned filters.
62
73
pubstructCanFifo{
63
74
idx:usize,
64
75
}
@@ -140,9 +151,12 @@ impl embedded_hal_can::Filter for CanFilter {
140
151
CanFilter::new(CanFilterData::AcceptAll)
141
152
}
142
153
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
154
+
// TODO: Constructing filters like this is fairly limiting because ideally
155
+
// we would have the full "filter state" available, so for non-extended
156
+
// filters this could be 2 masks and filters or 4 ids for id lists
144
157
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.
158
+
/// Constuct a mask filter. This method accepts two parameters, the mask which designates which
159
+
/// bits are actually matched againts and the filter, with the actual bits to match.
146
160
fnfrom_mask(mask:u32,filter:u32) -> Self{
147
161
assert!(
148
162
mask < MAX_EXTENDED_ID,
@@ -159,7 +173,8 @@ impl embedded_hal_can::Filter for CanFilter {
159
173
}
160
174
161
175
implCanFilter{
162
-
/// Create a new filter with no assigned index. To actually active the filter call `Receiver::set_filter`, which will assign an index.
176
+
/// Create a new filter with no assigned index. To actually active the filter call
177
+
/// [`Receiver::set_filter`], which will assign an index.
0 commit comments