24
24
#[ allow( clippy:: all) ] // generated code
25
25
mod pac;
26
26
use self :: pac:: generic:: * ; // To make the PAC extraction build
27
-
28
- //#[allow(clippy::all)] // generated code
29
- mod message_ram;
27
+ pub use crate :: pac:: fdcan:: RegisterBlock ;
30
28
31
29
/// Configuration of an FDCAN instance
32
30
pub mod config;
@@ -40,6 +38,8 @@ pub mod frame;
40
38
pub mod id;
41
39
/// Interrupt Line Information
42
40
pub mod interrupt;
41
+ /// Message RAM block
42
+ pub mod message_ram;
43
43
44
44
mod sealed {
45
45
pub trait Sealed { }
@@ -58,9 +58,6 @@ use frame::{RxFrameInfo, TxFrameHeader};
58
58
use id:: { Id , IdReg } ;
59
59
use interrupt:: { Interrupt , InterruptLine , Interrupts } ;
60
60
61
- use pac:: fdcan:: RegisterBlock ;
62
-
63
- use message_ram:: MsgRamExt ;
64
61
use message_ram:: RxFifoElement ;
65
62
66
63
use core:: cmp:: Ord ;
@@ -82,7 +79,7 @@ use core::ptr::NonNull;
82
79
/// register block.
83
80
/// * `REGISTERS` is a pointer to that peripheral's register block and can be safely accessed for as
84
81
/// long as ownership or a borrow of the implementing type is present.
85
- pub unsafe trait Instance : MsgRamExt {
82
+ pub unsafe trait Instance : message_ram :: Instance {
86
83
/// Pointer to the instance's register block.
87
84
const REGISTERS : * mut RegisterBlock ;
88
85
}
@@ -522,6 +519,11 @@ impl<I> FdCan<I, PoweredDownMode>
522
519
where
523
520
I : Instance ,
524
521
{
522
+ /// Creates a [`FdCan`] interface with the default configuration
523
+ pub fn new ( instance : I ) -> Self {
524
+ Self :: create_can ( FdCanConfig :: default ( ) , instance)
525
+ }
526
+
525
527
/// Moves out of PoweredDownMode and into ConfigMode
526
528
#[ inline]
527
529
pub fn into_config_mode ( mut self ) -> FdCan < I , ConfigMode > {
0 commit comments