@@ -53,15 +53,15 @@ fn main() -> ! {
53
53
let p = pac:: Peripherals :: take ( ) . unwrap ( ) ;
54
54
let cp = cortex_m:: Peripherals :: take ( ) . unwrap ( ) ;
55
55
56
- let rcc = p. RCC . freeze ( Config :: hsi ( ) . sysclk ( 100 . MHz ( ) ) ) ;
56
+ let mut rcc = p. RCC . freeze ( Config :: hsi ( ) . sysclk ( 100 . MHz ( ) ) ) ;
57
57
let mut delay = cp. SYST . delay ( & rcc. clocks ) ;
58
58
59
- let gpiob = p. GPIOB . split ( ) ;
60
- let gpioc = p. GPIOC . split ( ) ;
61
- let gpiod = p. GPIOD . split ( ) ;
62
- let gpioe = p. GPIOE . split ( ) ;
63
- let gpiof = p. GPIOF . split ( ) ;
64
- let gpiog = p. GPIOG . split ( ) ;
59
+ let gpiob = p. GPIOB . split ( & mut rcc ) ;
60
+ let gpioc = p. GPIOC . split ( & mut rcc ) ;
61
+ let gpiod = p. GPIOD . split ( & mut rcc ) ;
62
+ let gpioe = p. GPIOE . split ( & mut rcc ) ;
63
+ let gpiof = p. GPIOF . split ( & mut rcc ) ;
64
+ let gpiog = p. GPIOG . split ( & mut rcc ) ;
65
65
66
66
// Pins connected to the LCD on the board
67
67
use stm32f4xx_hal:: gpio:: alt:: fsmc as alt;
@@ -120,7 +120,7 @@ fn main() -> ! {
120
120
let read_timing = Timing :: default ( ) . data ( 8 ) . address_setup ( 8 ) . bus_turnaround ( 0 ) ;
121
121
122
122
// Initialise FSMC memory provider
123
- let ( _fsmc, interface) = FsmcLcd :: new ( p. FSMC , lcd_pins, & read_timing, & write_timing) ;
123
+ let ( _fsmc, interface) = FsmcLcd :: new ( p. FSMC , lcd_pins, & read_timing, & write_timing, & mut rcc ) ;
124
124
125
125
// Pass display-interface instance ST7789 driver to setup a new display
126
126
let mut disp = ST7789 :: new (
@@ -146,7 +146,7 @@ fn main() -> ! {
146
146
// STM32F412 uses I2c1 type for i2c bus.
147
147
// The pins are mentioned in documentation -um2135-discovery-kit-with-stm32f412zg-mcu-stmicroelectronics
148
148
#[ cfg( feature = "stm32f412" ) ]
149
- let mut i2c = { I2c :: new ( p. I2C1 , ( gpiob. pb6 , gpiob. pb7 ) , 400 . kHz ( ) , & rcc. clocks ) } ;
149
+ let mut i2c = { I2c :: new ( p. I2C1 , ( gpiob. pb6 , gpiob. pb7 ) , 400 . kHz ( ) , & mut rcc) } ;
150
150
151
151
// STM32F413 uses FMPI2C1 type.
152
152
// The pins are mentioned in documentation -um2135-discovery-kit-with-stm32f413zh-mcu-stmicroelectronics
0 commit comments