use spi registers instead of rom functions

This commit is contained in:
Robin Appelman 2020-08-30 02:33:49 +02:00
commit b28e24a0b6
4 changed files with 54 additions and 40 deletions

View file

@ -14,15 +14,10 @@ use spi_memory::prelude::*;
#[entry]
fn main() -> ! {
// The default clock source is the onboard crystal
// In most cases 40mhz (but can be as low as 2mhz depending on the board)
// Clock speed is then doubled from the crystal frequency
let clock_frequency = 80.mhz();
let dp = unsafe { Peripherals::steal() };
let pins = dp.GPIO.split();
let mut led = pins.gpio2.into_push_pull_output();
let (mut timer1, _) = dp.TIMER.timers(clock_frequency);
let (mut timer1, _) = dp.TIMER.timers();
let mut serial = dp
.UART0