@@ -56,24 +56,24 @@ cfg_if! {
56
56
/// Struct representing a CAN peripheral and its configured TX and RX pins.
57
57
///
58
58
/// See [`bxcan::Instance`] for more information on how to use the CAN interface.
59
- pub struct Can < TX , RX > {
60
- _can : stm32 :: CAN ,
59
+ pub struct Can < Tx , Rx > {
60
+ _can : pac :: CAN ,
61
61
_tx : TX ,
62
62
_rx : RX ,
63
63
}
64
64
65
- impl < TX , RX > Can < TX , RX >
65
+ impl < Tx , Rx > Can < Tx , Rx >
66
66
where
67
- TX : TxPin ,
68
- RX : RxPin ,
67
+ Tx : TxPin ,
68
+ Rx : RxPin ,
69
69
{
70
70
/// Create a new CAN instance, using the specified TX and RX pins.
71
71
///
72
72
/// Note: this does not actually initialize the CAN bus.
73
73
/// You will need to first call [`bxcan::Can::new`] and set the bus configuration and filters
74
74
/// before the peripheral can be enabled.
75
75
/// See the CAN example, for a more thorough example of the full setup process.
76
- pub fn new ( can : pac:: CAN , tx : TX , rx : RX , apb1 : & mut APB1 ) -> bxcan:: Can < Self > {
76
+ pub fn new ( can : pac:: CAN , tx : Tx , rx : Rx , apb1 : & mut APB1 ) -> bxcan:: Can < Self > {
77
77
apb1. enr ( ) . modify ( |_, w| w. canen ( ) . enabled ( ) ) ;
78
78
apb1. rstr ( ) . modify ( |_, w| w. canrst ( ) . set_bit ( ) ) ;
79
79
apb1. rstr ( ) . modify ( |_, w| w. canrst ( ) . clear_bit ( ) ) ;
@@ -86,10 +86,10 @@ where
86
86
}
87
87
}
88
88
89
- unsafe impl < TX , RX > bxcan:: Instance for Can < TX , RX > {
90
- const REGISTERS : * mut RegisterBlock = stm32 :: CAN :: ptr ( ) as * mut _ ;
89
+ unsafe impl < Tx , Rx > bxcan:: Instance for Can < Tx , Rx > {
90
+ const REGISTERS : * mut RegisterBlock = pac :: CAN :: ptr ( ) as * mut _ ;
91
91
}
92
92
93
- unsafe impl < TX , RX > bxcan:: FilterOwner for Can < TX , RX > {
93
+ unsafe impl < Tx , Rx > bxcan:: FilterOwner for Can < Tx , Rx > {
94
94
const NUM_FILTER_BANKS : u8 = 28 ;
95
95
}
0 commit comments