mirror of
https://github.com/icewind1991/esp8266-flash.git
synced 2026-06-03 10:34:05 +02:00
use spi registers instead of rom functions
This commit is contained in:
parent
6cd7bab5e5
commit
b28e24a0b6
4 changed files with 54 additions and 40 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue