the led isn't lighting up :'(
This commit is contained in:
parent
242f218a62
commit
2854adeb13
7 changed files with 74 additions and 65 deletions
24
src/main.rs
24
src/main.rs
|
|
@ -4,7 +4,7 @@ use cortex_m_rt::entry;
|
|||
use defmt_rtt as _;
|
||||
use hal::prelude::*;
|
||||
use panic_probe as _;
|
||||
use stm32f4xx_hal as hal;
|
||||
use stm32f4xx_hal::{self as hal, ltdc::DisplayController};
|
||||
|
||||
defmt::timestamp!("{=u32}", 0u32);
|
||||
|
||||
|
|
@ -14,6 +14,7 @@ fn main() -> ! {
|
|||
let mut rcc = peripherals.RCC.constrain();
|
||||
let ltdc = peripherals.LTDC;
|
||||
let dma2d = peripherals.DMA2D;
|
||||
|
||||
let display_config = hal::ltdc::DisplayConfig {
|
||||
active_width: 480,
|
||||
active_height: 800,
|
||||
|
|
@ -30,7 +31,7 @@ fn main() -> ! {
|
|||
pixel_clock_pol: false,
|
||||
};
|
||||
|
||||
let display = hal::ltdc::DisplayController::new(
|
||||
let mut display: DisplayController<u8> = hal::ltdc::DisplayController::new(
|
||||
ltdc,
|
||||
dma2d,
|
||||
None,
|
||||
|
|
@ -39,11 +40,26 @@ fn main() -> ! {
|
|||
None,
|
||||
);
|
||||
|
||||
display.draw_pixel(hal::ltdc::Layer::L1, 50, 50, 1);
|
||||
|
||||
let gpiog = peripherals.GPIOG.split(&mut rcc);
|
||||
let gpiod = peripherals.GPIOD.split(&mut rcc);
|
||||
|
||||
let mut led1 = gpiog.pg6.into_push_pull_output();
|
||||
let mut led2 = gpiod.pd4.into_push_pull_output();
|
||||
|
||||
led1.set_high();
|
||||
led1.set_low();
|
||||
led2.set_low();
|
||||
|
||||
loop {}
|
||||
loop {
|
||||
for _ in 0..100000 {
|
||||
led1.set_low();
|
||||
led2.set_high();
|
||||
}
|
||||
|
||||
for _ in 0..100000 {
|
||||
led1.set_high();
|
||||
led2.set_low();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue