Skip to content

Commit

Permalink
deploy: 9ffeec3
Browse files Browse the repository at this point in the history
  • Loading branch information
BartMassey committed Aug 20, 2024
0 parents commit 2988470
Show file tree
Hide file tree
Showing 208 changed files with 34,757 additions and 0 deletions.
1 change: 1 addition & 0 deletions .nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This file makes sure that Github Pages doesn't process mdBook's output.
303 changes: 303 additions & 0 deletions 01-background/index.html

Large diffs are not rendered by default.

282 changes: 282 additions & 0 deletions 02-requirements/index.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions 03-setup/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build]
target = "thumbv7em-none-eabihf"

[target.thumbv7em-none-eabihf]
runner = "probe-rs run --chip nRF52833_xxAA"
rustflags = [
"-C", "linker=rust-lld",
]
18 changes: 18 additions & 0 deletions 03-setup/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "rtt-check"
version = "0.1.0"
authors = ["Henrik Böving <[email protected]>"]
edition = "2021"

[dependencies]
cortex-m-rt = "0.7.3"
panic-rtt-target = "0.1.3"
rtt-target = "0.5.0"

[dependencies.nrf52833-pac]
version = "0.12.2"
features = ["cortex-m-rt"]

[dependencies.cortex-m]
version = "0.7.7"
features = ["inline-asm", "critical-section-single-core"]
11 changes: 11 additions & 0 deletions 03-setup/Embed.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[default.probe]
protocol = "Swd"

[default.general]
chip = "nrf52833_xxAA"

[default.rtt]
enabled = true

[default.gdb]
enabled = false
249 changes: 249 additions & 0 deletions 03-setup/IDE.html

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions 03-setup/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//! This build script copies the `memory.x` file from the crate root into
//! a directory where the linker can always find it at build time.
//! For many projects this is optional, as the linker always searches the
//! project root directory (wherever `Cargo.toml` is). However, if you
//! are using a workspace or have a more complicated build setup, this
//! build script becomes required. Additionally, by requesting that
//! Cargo re-run the build script whenever `memory.x` is changed,
//! a rebuild of the application with new memory settings is ensured after updating `memory.x`.

use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;

fn main() {
// Put `memory.x` in our output directory and ensure it's
// on the linker search path.
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("memory.x"))
.unwrap()
.write_all(include_bytes!("memory.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());

// By default, Cargo will re-run a build script whenever
// any file in the project changes. By specifying `memory.x`
// here, we ensure the build script is only re-run when
// `memory.x` is changed.
println!("cargo:rerun-if-changed=memory.x");
}
323 changes: 323 additions & 0 deletions 03-setup/index.html

Large diffs are not rendered by default.

316 changes: 316 additions & 0 deletions 03-setup/linux.html

Large diffs are not rendered by default.

239 changes: 239 additions & 0 deletions 03-setup/macos.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions 03-setup/memory.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Linker script for the nRF52833 */
MEMORY
{
/* NOTE K = KiBi = 1024 bytes */
FLASH : ORIGIN = 0x00000000, LENGTH = 512K
RAM : ORIGIN = 0x20000000, LENGTH = 128K
}
18 changes: 18 additions & 0 deletions 03-setup/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#![no_main]
#![no_std]

use cortex_m::asm::wfi;
use panic_rtt_target as _;
use nrf52833_pac as _;
use rtt_target::{rprintln, rtt_init_print};

use cortex_m_rt::entry;

#[entry]
fn main() -> ! {
rtt_init_print!();
rprintln!("Hello World");
loop {
wfi();
}
}
283 changes: 283 additions & 0 deletions 03-setup/verify.html

Large diffs are not rendered by default.

242 changes: 242 additions & 0 deletions 03-setup/windows.html

Large diffs are not rendered by default.

252 changes: 252 additions & 0 deletions 04-meet-your-hardware/index.html

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions 04-meet-your-hardware/microbit-v2.html

Large diffs are not rendered by default.

272 changes: 272 additions & 0 deletions 04-meet-your-hardware/terminology.html

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions 05-meet-your-software/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build]
target = "thumbv7em-none-eabihf"

[target.thumbv7em-none-eabihf]
runner = "probe-rs run --chip nRF52833_xxAA"
rustflags = [
"-C", "linker=rust-lld",
]
17 changes: 17 additions & 0 deletions 05-meet-your-software/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "meet-your-software"
version = "0.1.0"
authors = ["Henrik Böving <[email protected]>"]
edition = "2021"

[dependencies]
cortex-m-rt = "0.7.3"
panic-halt = "0.2.0"
panic-rtt-target = "0.1.3"
rtt-target = "0.5.0"
microbit-v2 = "0.15.0"
embedded-hal = "1.0.0"

[dependencies.cortex-m]
version = "0.7.7"
features = ["inline-asm", "critical-section-single-core"]
11 changes: 11 additions & 0 deletions 05-meet-your-software/Embed.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[default.general]
chip = "nrf52833_xxAA"

[default.reset]
halt_afterwards = true

[default.rtt]
enabled = false

[default.gdb]
enabled = true
306 changes: 306 additions & 0 deletions 05-meet-your-software/build-it.html

Large diffs are not rendered by default.

415 changes: 415 additions & 0 deletions 05-meet-your-software/debug-it.html

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions 05-meet-your-software/examples/delay-print.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#![deny(unsafe_code)]
#![no_main]
#![no_std]

use cortex_m_rt::entry;
use embedded_hal::delay::DelayNs;
use microbit::board::Board;
use microbit::hal::timer::Timer;
use panic_rtt_target as _;
use rtt_target::{rprintln, rtt_init_print};

#[entry]
fn main() -> ! {
rtt_init_print!();
let board = Board::take().unwrap();

let mut timer = Timer::new(board.TIMER0);

loop {
timer.delay_ms(1000u32);
rprintln!("1000 ms passed");
}
}
21 changes: 21 additions & 0 deletions 05-meet-your-software/examples/init.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#![deny(unsafe_code)]
#![no_main]
#![no_std]

use cortex_m::asm::wfi;
use cortex_m_rt::entry;
use microbit as _;
use panic_halt as _;

#[entry]
fn main() -> ! {
#[allow(clippy::needless_late_init)]
let _y;
let x = 42;
_y = x;

// infinite loop; just so we don't leave this stack frame
loop {
wfi();
}
}
18 changes: 18 additions & 0 deletions 05-meet-your-software/examples/light-it-up.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#![deny(unsafe_code)]
#![no_main]
#![no_std]

use cortex_m_rt::entry;
use embedded_hal::digital::OutputPin;
use microbit::board::Board;
use panic_halt as _;

#[entry]
fn main() -> ! {
let mut board = Board::take().unwrap();

board.display_pins.col1.set_low().unwrap();
board.display_pins.row1.set_high().unwrap();

loop {}
}
Loading

0 comments on commit 2988470

Please sign in to comment.