mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 00:02:28 +00:00
FDCAN: Don't require internal module for public API.
This commit is contained in:
parent
0565098b06
commit
1327a644b6
@ -3,12 +3,9 @@ use core::future::poll_fn;
|
||||
use core::marker::PhantomData;
|
||||
use core::task::Poll;
|
||||
|
||||
pub mod fd;
|
||||
use embassy_hal_internal::{into_ref, PeripheralRef};
|
||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||
use embassy_sync::channel::Channel;
|
||||
use fd::config::*;
|
||||
use fd::filter::*;
|
||||
|
||||
use crate::can::fd::peripheral::Registers;
|
||||
use crate::gpio::sealed::AFType;
|
||||
@ -17,10 +14,14 @@ use crate::rcc::RccPeripheral;
|
||||
use crate::{interrupt, peripherals, Peripheral};
|
||||
|
||||
pub mod enums;
|
||||
use enums::*;
|
||||
pub(crate) mod fd;
|
||||
pub mod frame;
|
||||
mod util;
|
||||
|
||||
pub mod frame;
|
||||
use enums::*;
|
||||
use fd::config::*;
|
||||
use fd::filter::*;
|
||||
pub use fd::{config, filter};
|
||||
use frame::*;
|
||||
|
||||
/// Timestamp for incoming packets. Use Embassy time when enabled.
|
||||
|
@ -22,8 +22,8 @@ async fn main(_spawner: Spawner) {
|
||||
let mut can = can::FdcanConfigurator::new(peripherals.FDCAN1, peripherals.PA11, peripherals.PA12, Irqs);
|
||||
|
||||
can.set_extended_filter(
|
||||
can::fd::filter::ExtendedFilterSlot::_0,
|
||||
can::fd::filter::ExtendedFilter::accept_all_into_fifo1(),
|
||||
can::filter::ExtendedFilterSlot::_0,
|
||||
can::filter::ExtendedFilter::accept_all_into_fifo1(),
|
||||
);
|
||||
|
||||
// 250k bps
|
||||
|
@ -81,8 +81,8 @@ async fn main(_spawner: Spawner) {
|
||||
can.set_bitrate(250_000);
|
||||
|
||||
can.set_extended_filter(
|
||||
can::fd::filter::ExtendedFilterSlot::_0,
|
||||
can::fd::filter::ExtendedFilter::accept_all_into_fifo1(),
|
||||
can::filter::ExtendedFilterSlot::_0,
|
||||
can::filter::ExtendedFilter::accept_all_into_fifo1(),
|
||||
);
|
||||
|
||||
let mut can = can.into_internal_loopback_mode();
|
||||
|
Loading…
Reference in New Issue
Block a user