FDCAN: Don't require internal module for public API.
This commit is contained in:
parent
0565098b06
commit
1327a644b6
3 changed files with 10 additions and 9 deletions
|
@ -3,12 +3,9 @@ use core::future::poll_fn;
|
||||||
use core::marker::PhantomData;
|
use core::marker::PhantomData;
|
||||||
use core::task::Poll;
|
use core::task::Poll;
|
||||||
|
|
||||||
pub mod fd;
|
|
||||||
use embassy_hal_internal::{into_ref, PeripheralRef};
|
use embassy_hal_internal::{into_ref, PeripheralRef};
|
||||||
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
use embassy_sync::blocking_mutex::raw::CriticalSectionRawMutex;
|
||||||
use embassy_sync::channel::Channel;
|
use embassy_sync::channel::Channel;
|
||||||
use fd::config::*;
|
|
||||||
use fd::filter::*;
|
|
||||||
|
|
||||||
use crate::can::fd::peripheral::Registers;
|
use crate::can::fd::peripheral::Registers;
|
||||||
use crate::gpio::sealed::AFType;
|
use crate::gpio::sealed::AFType;
|
||||||
|
@ -17,10 +14,14 @@ use crate::rcc::RccPeripheral;
|
||||||
use crate::{interrupt, peripherals, Peripheral};
|
use crate::{interrupt, peripherals, Peripheral};
|
||||||
|
|
||||||
pub mod enums;
|
pub mod enums;
|
||||||
use enums::*;
|
pub(crate) mod fd;
|
||||||
|
pub mod frame;
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
pub mod frame;
|
use enums::*;
|
||||||
|
use fd::config::*;
|
||||||
|
use fd::filter::*;
|
||||||
|
pub use fd::{config, filter};
|
||||||
use frame::*;
|
use frame::*;
|
||||||
|
|
||||||
/// Timestamp for incoming packets. Use Embassy time when enabled.
|
/// 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);
|
let mut can = can::FdcanConfigurator::new(peripherals.FDCAN1, peripherals.PA11, peripherals.PA12, Irqs);
|
||||||
|
|
||||||
can.set_extended_filter(
|
can.set_extended_filter(
|
||||||
can::fd::filter::ExtendedFilterSlot::_0,
|
can::filter::ExtendedFilterSlot::_0,
|
||||||
can::fd::filter::ExtendedFilter::accept_all_into_fifo1(),
|
can::filter::ExtendedFilter::accept_all_into_fifo1(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// 250k bps
|
// 250k bps
|
||||||
|
|
|
@ -81,8 +81,8 @@ async fn main(_spawner: Spawner) {
|
||||||
can.set_bitrate(250_000);
|
can.set_bitrate(250_000);
|
||||||
|
|
||||||
can.set_extended_filter(
|
can.set_extended_filter(
|
||||||
can::fd::filter::ExtendedFilterSlot::_0,
|
can::filter::ExtendedFilterSlot::_0,
|
||||||
can::fd::filter::ExtendedFilter::accept_all_into_fifo1(),
|
can::filter::ExtendedFilter::accept_all_into_fifo1(),
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut can = can.into_internal_loopback_mode();
|
let mut can = can.into_internal_loopback_mode();
|
||||||
|
|
Loading…
Reference in a new issue