Created
March 29, 2020 16:56
-
-
Save SamP20/08987a4650362961243e002418b89cb5 to your computer and use it in GitHub Desktop.
Turn on an LED
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_main] | |
#![no_std] | |
extern crate cortex_m_rt as rt; | |
extern crate panic_halt; | |
use rt::entry; | |
use stm32f4::stm32f429; | |
#[entry] | |
fn main() -> ! { | |
let mut peripherals = stm32f429::Peripherals::take().unwrap(); | |
let gpiob = &peripherals.GPIOB; | |
gpiob.moder.modify(|_, w| w.moder0().output()); | |
gpiob.bsrr.write(|w| w.bs0().set_bit()); | |
loop { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment