mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 08:12:30 +00:00
Documentation.
.
This commit is contained in:
parent
455cc40261
commit
a9ff38003b
@ -171,9 +171,13 @@ impl Mask32 {
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub enum BankConfig {
|
||||
/// Specify up to 4 exact standard CAN ID's.
|
||||
List16([ListEntry16; 4]),
|
||||
/// Specify up to 2 exact standard or extended CAN ID's.
|
||||
List32([ListEntry32; 2]),
|
||||
/// Specify up to 2 standard ID's with masks.
|
||||
Mask16([Mask16; 2]),
|
||||
/// Specify a single extended ID with mask.
|
||||
Mask32(Mask32),
|
||||
}
|
||||
|
||||
|
@ -621,7 +621,7 @@ where
|
||||
unsafe { Rx1::conjure(self.canregs) }
|
||||
}
|
||||
|
||||
pub fn split_by_ref(&mut self) -> (Tx<I>, Rx0<I>, Rx1<I>) {
|
||||
pub(crate) fn split_by_ref(&mut self) -> (Tx<I>, Rx0<I>, Rx1<I>) {
|
||||
// Safety: We take `&mut self` and the return value lifetimes are tied to `self`'s lifetime.
|
||||
let tx = unsafe { Tx::conjure(self.canregs) };
|
||||
let rx0 = unsafe { Rx0::conjure(self.canregs) };
|
||||
@ -924,7 +924,9 @@ fn receive_fifo(canregs: crate::pac::can::Can, fifo_nr: usize) -> nb::Result<Fra
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||
pub enum Fifo {
|
||||
/// First receive FIFO
|
||||
Fifo0 = 0,
|
||||
/// Second receive FIFO
|
||||
Fifo1 = 1,
|
||||
}
|
||||
|
||||
|
@ -45,16 +45,16 @@ async fn main(_spawner: Spawner) {
|
||||
|
||||
let mut i: u8 = 0;
|
||||
loop {
|
||||
let tx_frame = Frame::new_data(unwrap!(StandardId::new(i as _)), [i]);
|
||||
let tx_frame = Frame::new_data(unwrap!(StandardId::new(i as _)), [i, 0, 1, 2, 3, 4, 5, 6]);
|
||||
can.write(&tx_frame).await;
|
||||
|
||||
match can.read().await {
|
||||
Ok(env) => match env.frame.id() {
|
||||
Id::Extended(id) => {
|
||||
defmt::println!("Extended Frame id={:x}", id.as_raw());
|
||||
defmt::println!("Extended Frame id={:x} {:02x}", id.as_raw(), env.frame.data().unwrap());
|
||||
}
|
||||
Id::Standard(id) => {
|
||||
defmt::println!("Standard Frame id={:x}", id.as_raw());
|
||||
defmt::println!("Standard Frame id={:x} {:02x}", id.as_raw(), env.frame.data().unwrap());
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
|
Loading…
Reference in New Issue
Block a user