File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 5
5
extern crate panic_semihosting;
6
6
7
7
use cortex_m_rt:: entry;
8
- use stm32l0xx_hal:: usb:: { Peripheral , UsbBus } ;
8
+ use stm32l0xx_hal:: usb:: { USB , UsbBus } ;
9
9
use stm32l0xx_hal:: { pac, prelude:: * , rcc, syscfg:: SYSCFG } ;
10
10
use usb_device:: prelude:: * ;
11
11
use usbd_serial:: { SerialPort , USB_CLASS_CDC } ;
@@ -20,7 +20,7 @@ fn main() -> ! {
20
20
21
21
let gpioa = dp. GPIOA . split ( & mut rcc) ;
22
22
23
- let usb = Peripheral {
23
+ let usb = USB {
24
24
usb : dp. USB ,
25
25
pin_dm : gpioa. pa11 ,
26
26
pin_dp : gpioa. pa12 ,
Original file line number Diff line number Diff line change 12
12
//! Please check out the USB examples in the `examples/` directory to see how it
13
13
//! fits together.
14
14
15
- use crate :: stm32 :: { RCC , USB } ;
15
+ use crate :: pac :: { self , RCC } ;
16
16
use stm32_usbd:: UsbPeripheral ;
17
17
18
18
use crate :: gpio:: gpioa:: { PA11 , PA12 } ;
19
19
use crate :: gpio:: { Floating , Input } ;
20
20
pub use stm32_usbd:: UsbBus ;
21
21
22
- pub struct Peripheral {
23
- pub usb : USB ,
22
+ pub struct USB {
23
+ pub usb : pac :: USB ,
24
24
pub pin_dm : PA11 < Input < Floating > > ,
25
25
pub pin_dp : PA12 < Input < Floating > > ,
26
26
}
27
27
28
- unsafe impl Sync for Peripheral { }
28
+ unsafe impl Sync for USB { }
29
29
30
- unsafe impl UsbPeripheral for Peripheral {
31
- const REGISTERS : * const ( ) = USB :: ptr ( ) as * const ( ) ;
30
+ unsafe impl UsbPeripheral for USB {
31
+ const REGISTERS : * const ( ) = pac :: USB :: ptr ( ) as * const ( ) ;
32
32
const DP_PULL_UP_FEATURE : bool = true ;
33
33
const EP_MEMORY : * const ( ) = 0x4000_6000 as _ ;
34
34
const EP_MEMORY_SIZE : usize = 1024 ;
@@ -53,4 +53,4 @@ unsafe impl UsbPeripheral for Peripheral {
53
53
}
54
54
}
55
55
56
- pub type UsbBusType = UsbBus < Peripheral > ;
56
+ pub type UsbBusType = UsbBus < USB > ;
You can’t perform that action at this time.
0 commit comments