Skip to content

Commit a91344a

Browse files
committed
Use PascalCase for generics
1 parent cf7c368 commit a91344a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/can.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ cfg_if! {
5656
/// Struct representing a CAN peripheral and its configured TX and RX pins.
5757
///
5858
/// 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,
6161
_tx: TX,
6262
_rx: RX,
6363
}
6464

65-
impl<TX, RX> Can<TX, RX>
65+
impl<Tx, Rx> Can<Tx, Rx>
6666
where
67-
TX: TxPin,
68-
RX: RxPin,
67+
Tx: TxPin,
68+
Rx: RxPin,
6969
{
7070
/// Create a new CAN instance, using the specified TX and RX pins.
7171
///
7272
/// Note: this does not actually initialize the CAN bus.
7373
/// You will need to first call [`bxcan::Can::new`] and set the bus configuration and filters
7474
/// before the peripheral can be enabled.
7575
/// 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> {
7777
apb1.enr().modify(|_, w| w.canen().enabled());
7878
apb1.rstr().modify(|_, w| w.canrst().set_bit());
7979
apb1.rstr().modify(|_, w| w.canrst().clear_bit());
@@ -86,10 +86,10 @@ where
8686
}
8787
}
8888

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 _;
9191
}
9292

93-
unsafe impl<TX, RX> bxcan::FilterOwner for Can<TX, RX> {
93+
unsafe impl<Tx, Rx> bxcan::FilterOwner for Can<Tx, Rx> {
9494
const NUM_FILTER_BANKS: u8 = 28;
9595
}

0 commit comments

Comments
 (0)