FDCAN: Don't require internal module for public API.

This commit is contained in:
Corey Schuhen 2024-02-25 09:57:30 +10:00
parent 0565098b06
commit 1327a644b6
3 changed files with 10 additions and 9 deletions

View File

@ -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.

View File

@ -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

View File

@ -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();