Skip to content

Commit 00cb758

Browse files
committed
dma: Use the pac name instead of stm32
1 parent 7cc4c05 commit 00cb758

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

examples/serial_dma.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ use panic_semihosting as _;
99

1010
use cortex_m::singleton;
1111
use cortex_m_rt::entry;
12-
use stm32f3xx_hal::{prelude::*, serial::Serial, stm32};
12+
use stm32f3xx_hal::{pac, prelude::*, serial::Serial};
1313

1414
#[entry]
1515
fn main() -> ! {
16-
let dp = stm32::Peripherals::take().unwrap();
16+
let dp = pac::Peripherals::take().unwrap();
1717

1818
let mut flash = dp.FLASH.constrain();
1919
let mut rcc = dp.RCC.constrain();

src/dma.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
//! Currently DMA is only supported for STM32F303 MCUs.
44
55
use crate::{
6+
pac::{self, dma1::ch::cr},
67
rcc::AHB,
78
serial,
8-
stm32::{self, dma1::ch::cr},
99
};
1010
use cast::u16;
1111
use core::{
@@ -566,12 +566,12 @@ pub trait Channel: private::Channel {
566566
}
567567

568568
mod private {
569-
use crate::stm32;
569+
use crate::pac;
570570

571571
/// Channel methods private to this module
572572
pub trait Channel {
573573
/// Return the register block for this channel
574-
fn ch(&self) -> &stm32::dma1::CH;
574+
fn ch(&self) -> &pac::dma1::CH;
575575
}
576576
}
577577

@@ -588,7 +588,7 @@ macro_rules! dma {
588588
) => {
589589
pub mod $dmax {
590590
use super::*;
591-
use crate::stm32::$DMAx;
591+
use crate::pac::$DMAx;
592592

593593
impl DmaExt for $DMAx {
594594
type Channels = Channels;
@@ -625,7 +625,7 @@ macro_rules! dma {
625625
}
626626

627627
impl private::Channel for $Ci {
628-
fn ch(&self) -> &stm32::dma1::CH {
628+
fn ch(&self) -> &pac::dma1::CH {
629629
// NOTE(unsafe) $Ci grants exclusive access to this register
630630
unsafe { &(*$DMAx::ptr()).$chi }
631631
}
@@ -709,10 +709,10 @@ macro_rules! targets {
709709

710710
#[cfg(feature = "stm32f303")]
711711
targets!(dma1,
712-
serial::Rx<stm32::USART1> => C5,
713-
serial::Tx<stm32::USART1> => C4,
714-
serial::Rx<stm32::USART2> => C6,
715-
serial::Tx<stm32::USART2> => C7,
716-
serial::Rx<stm32::USART3> => C3,
717-
serial::Tx<stm32::USART3> => C2,
712+
serial::Rx<pac::USART1> => C5,
713+
serial::Tx<pac::USART1> => C4,
714+
serial::Rx<pac::USART2> => C6,
715+
serial::Tx<pac::USART2> => C7,
716+
serial::Rx<pac::USART3> => C3,
717+
serial::Tx<pac::USART3> => C2,
718718
);

0 commit comments

Comments
 (0)