Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
34 lines (28 sloc) 841 Bytes
// std and main are not available for bare metal software
extern crate cortex_m_rt;
extern crate panic_halt;
extern crate stm32f1;
use cortex_m_rt::entry;
use stm32f1::stm32f103;
// use `main` as the entry point of this application
fn main() -> ! {
// get handles to the hardware
let peripherals = stm32f103::Peripherals::take().unwrap();
let gpioc = &peripherals.GPIOC;
let rcc = &peripherals.RCC;
// enable the GPIO clock for IO port C
rcc.apb2enr.write(|w| w.iopcen().set_bit());
gpioc.crh.write(|w| unsafe {
loop {
gpioc.bsrr.write(|w| w.bs13().set_bit());
gpioc.brr.write(|w| w.br13().set_bit());
You can’t perform that action at this time.