Skip to content

Commit 49e2922

Browse files
Jonathan Pallant (42 Technology)Yatekii
authored andcommitted
Update BSP/HAL for 9160
1 parent 130c31c commit 49e2922

File tree

14 files changed

+774
-29
lines changed

14 files changed

+774
-29
lines changed

boards/nRF9160-DK/Cargo.toml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
[package]
2-
name = "nRF9160-DK"
2+
authors = [
3+
"Ruben Paz <[email protected]>",
4+
"Jonathan Pallant <[email protected]>",
5+
]
6+
categories = ["embedded", "no-std"]
7+
description = "BSP for the nRF9160-DK"
8+
keywords = ["arm", "nrf9160"]
9+
license = "MIT OR Apache-2.0"
10+
readme = "README.md"
11+
name = "nrf9160-dk-bsp"
312
version = "0.1.0"
4-
authors = ["Jonathan Pallant (42 Technology) <[email protected]>"]
513
edition = "2018"
614

7-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8-
915
[dependencies]
16+
cortex-m = "0.6.0"
17+
cortex-m-rt = "0.6.7"
18+
panic-halt = "0.2.0"
19+
nrf9160-hal = { version = "0.1.0", path = "../../nrf9160-hal" }
20+
21+
[dev-dependencies]
22+
nb = "0.1.1"
23+
panic-semihosting = "0.5.1"

boards/nRF9160-DK/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# `nrf9160-dk-bsp`
2+
3+
Board support crate for the Nordic nRF9160-DK
4+
https://www.nordicsemi.com/Software-and-Tools/Development-Kits/nRF9160-DK
5+
6+
This crate is in early development.

boards/nRF9160-DK/examples/blinky.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#![no_std]
2+
#![no_main]
3+
4+
extern crate cortex_m_rt as rt;
5+
extern crate nb;
6+
extern crate nrf9160_dk_bsp as dk;
7+
extern crate panic_semihosting;
8+
9+
use core::fmt::Write;
10+
use dk::{hal::Timer, prelude::*, Board};
11+
use nb::block;
12+
use rt::entry;
13+
14+
#[entry]
15+
fn main() -> ! {
16+
let mut board = Board::take().unwrap();
17+
let mut timer = Timer::new(board.TIMER0_NS);
18+
19+
writeln!(board.cdc, "Hello, world!").unwrap();
20+
21+
let mut led_is_on = false;
22+
loop {
23+
if led_is_on {
24+
board.leds.led_1.off();
25+
} else {
26+
board.leds.led_1.on();
27+
}
28+
timer.start(1_000_000_u32);
29+
block!(timer.wait()).unwrap();
30+
led_is_on = !led_is_on;
31+
}
32+
}

0 commit comments

Comments
 (0)