Upgrade to latest nrf52832-hal
This commit is contained in:
parent
36723052d5
commit
ca9c9bae75
4 changed files with 18 additions and 29 deletions
20
Cargo.lock
generated
20
Cargo.lock
generated
|
@ -424,10 +424,10 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "nrf52-hal-common"
|
||||
version = "0.8.1"
|
||||
name = "nrf-hal-common"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "03dcdf72cd52a1c4829905e08a90ad6f4dc0f9d15ecf1883cc74f098199aa873"
|
||||
checksum = "cc36b48f37fdeeb88821733f8049bfee490fa76376746760c83bc4faa850320b"
|
||||
dependencies = [
|
||||
"cast",
|
||||
"cortex-m",
|
||||
|
@ -441,24 +441,24 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "nrf52832-hal"
|
||||
version = "0.8.1"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd4803f1d08e6a4c8726ae68b40cecf7c2ab05f49b1ce29af932d052cb61114c"
|
||||
checksum = "e9656eab0c535fb4429876525fb5db1604bceeed80cc91a7b91d7b683db4a3a0"
|
||||
dependencies = [
|
||||
"cast",
|
||||
"cortex-m",
|
||||
"embedded-hal",
|
||||
"nb",
|
||||
"nrf52-hal-common",
|
||||
"nrf-hal-common",
|
||||
"nrf52832-pac",
|
||||
"void",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nrf52832-pac"
|
||||
version = "0.8.0"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c4545414415bddd872f13c0a5418ecc380e34347a52cb048cfed38c1b0957fa"
|
||||
checksum = "72920484274fae0792a40345049da2723612465c7202561b6a17ad3c127259db"
|
||||
dependencies = [
|
||||
"bare-metal",
|
||||
"cortex-m",
|
||||
|
@ -546,9 +546,9 @@ checksum = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f"
|
|||
|
||||
[[package]]
|
||||
name = "rand_core"
|
||||
version = "0.4.2"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
|
||||
checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
|
|
|
@ -10,8 +10,7 @@ cortex-m = "0.6"
|
|||
cortex-m-rt = "0.6"
|
||||
embedded-graphics = "0.6"
|
||||
embedded-hal = {version ="0.2.3", features = ["unproven"] }
|
||||
#nrf52832-hal = { version = "0.10", default-features = false, features = ["xxAA-package", "rt"] }
|
||||
nrf52832-hal = {version = "0.8.1", default-features = false, features = ["xxAA-package", "rt"]}
|
||||
nrf52832-hal = { version = "0.10", default-features = false, features = ["xxAA-package", "rt"] }
|
||||
st7789 = { version = "0.2", features = ["graphics", "batch", "buffer"], default-features = false }
|
||||
cstr_core = "0.2.0"
|
||||
numtoa = "0.2.3"
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
//! default also wants SYST for its Delay implementation.
|
||||
|
||||
use embedded_hal::blocking::delay::DelayUs;
|
||||
use hal::nrf52832_pac as pac;
|
||||
use nrf52832_hal::prelude::TimerExt;
|
||||
use nrf52832_hal::{self as hal, timer::Timer};
|
||||
use nrf52832_hal::{self as hal, pac, timer::Timer};
|
||||
|
||||
pub struct TimerDelay {
|
||||
timer: hal::Timer<pac::TIMER0>,
|
||||
|
@ -15,8 +13,7 @@ pub struct TimerDelay {
|
|||
impl TimerDelay {
|
||||
pub fn new(timer0: pac::TIMER0) -> Self {
|
||||
Self {
|
||||
//timer: Timer::new(timer0),
|
||||
timer: timer0.constrain(),
|
||||
timer: Timer::new(timer0),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
17
src/main.rs
17
src/main.rs
|
@ -4,13 +4,9 @@
|
|||
mod backlight;
|
||||
mod delay;
|
||||
|
||||
// use nrf52832_hal::gpio::Level;
|
||||
// use nrf52832_hal::{self as p_hal, pac};
|
||||
// use p_hal::{delay::Delay, spim, twim};
|
||||
use nrf52832_hal as p_hal;
|
||||
use p_hal::gpio::{GpioExt, Level};
|
||||
use p_hal::nrf52832_pac as pac;
|
||||
use p_hal::{delay::Delay, rng::RngExt, spim, twim};
|
||||
use nrf52832_hal::gpio::Level;
|
||||
use nrf52832_hal::{self as p_hal, pac};
|
||||
use p_hal::{delay::Delay, spim, twim};
|
||||
|
||||
use cortex_m_rt as rt;
|
||||
use cst816s::CST816S;
|
||||
|
@ -18,7 +14,6 @@ use cstr_core::CStr;
|
|||
use embedded_graphics::prelude::*;
|
||||
use embedded_hal::blocking::delay::{DelayMs, DelayUs};
|
||||
use embedded_hal::digital::v2::OutputPin;
|
||||
use nrf52832_hal::prelude::ClocksExt;
|
||||
use numtoa::NumToA;
|
||||
use rt::entry;
|
||||
use st7789::Orientation;
|
||||
|
@ -49,11 +44,9 @@ fn main() -> ! {
|
|||
// but we also need to switch to the external HF oscillator. This is
|
||||
// needed for Bluetooth to work.
|
||||
|
||||
//let _clocks = p_hal::clocks::Clocks::new(dp.CLOCK).enable_ext_hfosc();
|
||||
let _clockit = dp.CLOCK.constrain().enable_ext_hfosc();
|
||||
let _clocks = p_hal::clocks::Clocks::new(dp.CLOCK).enable_ext_hfosc();
|
||||
|
||||
//let gpio = p_hal::gpio::p0::Parts::new(dp.P0);
|
||||
let gpio = dp.P0.split();
|
||||
let gpio = p_hal::gpio::p0::Parts::new(dp.P0);
|
||||
|
||||
// Set up SPI pins
|
||||
let spi_clk = gpio.p0_02.into_push_pull_output(Level::Low).degrade();
|
||||
|
|
Loading…
Reference in a new issue