From 85be1f87cadd12fedf63d5238282211202dae78b Mon Sep 17 00:00:00 2001 From: Adin Ackerman Date: Sun, 29 Sep 2024 21:01:22 -0700 Subject: [PATCH] hide WIP assignments --- content/assignments/full-stack/BLE/_index.md | 48 ++++++++++++++++- .../assignments/full-stack/BLE/firmware.md | 53 +++++++++++++++++++ content/assignments/full-stack/_index.md | 2 + .../spinning-and-blinking/_index.md | 2 + content/assignments/vu-meter/submission.md | 2 +- 5 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 content/assignments/full-stack/BLE/firmware.md diff --git a/content/assignments/full-stack/BLE/_index.md b/content/assignments/full-stack/BLE/_index.md index a9f544d..286a40e 100644 --- a/content/assignments/full-stack/BLE/_index.md +++ b/content/assignments/full-stack/BLE/_index.md @@ -2,6 +2,52 @@ title: BLE type: docs prev: assignments/full-stack/ -next: assignments/full-stack/ble/tutorial +next: assignments/full-stack/ble/firmware weight: 2 --- + +Let's take a look at the hierarchy of the system we are about to design: + +```mermaid +graph LR + subgraph "DevBoard (Rust)" + subgraph "Front End" + A2(LED) + end + + subgraph "Back End" + B2(BLE) + C2(Events) + D2(Logic) + end + + B2 --> C2 --> D2 --> A2 + D2 --> B2 + end + + subgraph "Phone (Swift)" + subgraph "Front End" + A1(UI) + B1(Alerts) + end + + subgraph "Back End" + C1(Delegate) + D1(Logic) + E1(BLE) + end + + A1 --> C1 --> D1 <--> E1 + D1 --> B1 + end + + B2 <--> E1 +``` + +Now, I know this looks complicated, but we will tackle each block one by one, nice and slow. + +Once you are done with this, you will have a solid understanding of creating systems involving +bidirectional communication between 2 devices, which is *super* useful for *a ton* of +applications (including your final project). + +So let's get started. diff --git a/content/assignments/full-stack/BLE/firmware.md b/content/assignments/full-stack/BLE/firmware.md new file mode 100644 index 0000000..3b39ba4 --- /dev/null +++ b/content/assignments/full-stack/BLE/firmware.md @@ -0,0 +1,53 @@ +--- +title: Firmware +type: docs +prev: assignments/full-stack/ble +next: assignments/full-stack/ble/client +weight: 1 +--- + +## Setup + +Create a new project with: + +```sh +cargo embassy init {project_name} --chip esp32c3 +``` + +Then run: + +```sh +cargo add esp-wifi --features esp32c3,ble +``` + +to add the `esp-wifi` crate with BLE capability enabled. + +And add the following dependency: + +```toml +bleps = { git = "https://github.com/bjoernQ/bleps", package = "bleps", rev = "a5148d8ae679e021b78f53fd33afb8bb35d0b62e", features = [ + "macros", + "async", +] } +``` +> This crate provides a simple hardware agnostic BLE interface. + +Then add an additional linker arg in `build.rs`: + +```diff +fn main() { + println!("cargo:rustc-link-arg-bins=-Tlinkall.x"); ++ println!("cargo::rustc-link-arg=-Trom_functions.x") +} +``` + +And like previously, patch the esp32 deps in `Cargo.toml`: + +```toml +[patch.crates-io] +esp-hal = { git = "https://github.com/esp-rs/esp-hal/", rev = "f95ab0def50130a9d7da0ba0101c921e239ecdb5" } +esp-hal-embassy = { git = "https://github.com/esp-rs/esp-hal/", rev = "f95ab0def50130a9d7da0ba0101c921e239ecdb5" } +esp-backtrace = { git = "https://github.com/esp-rs/esp-hal/", rev = "f95ab0def50130a9d7da0ba0101c921e239ecdb5" } +esp-println = { git = "https://github.com/esp-rs/esp-hal/", rev = "f95ab0def50130a9d7da0ba0101c921e239ecdb5" } +esp-wifi = { git = "https://github.com/esp-rs/esp-hal/", rev = "f95ab0def50130a9d7da0ba0101c921e239ecdb5" } +``` diff --git a/content/assignments/full-stack/_index.md b/content/assignments/full-stack/_index.md index d465151..7da8306 100644 --- a/content/assignments/full-stack/_index.md +++ b/content/assignments/full-stack/_index.md @@ -4,6 +4,8 @@ type: docs prev: assignments/spinning-and-blinking/ next: assignments/full-stack/tutorial weight: 5 +sidebar: + exclude: true --- ## Preamble diff --git a/content/assignments/spinning-and-blinking/_index.md b/content/assignments/spinning-and-blinking/_index.md index 69e89ec..32e75eb 100644 --- a/content/assignments/spinning-and-blinking/_index.md +++ b/content/assignments/spinning-and-blinking/_index.md @@ -4,6 +4,8 @@ type: docs prev: assignments/vu-meter/ next: assignments/spinning-and-blinking/getting-started weight: 4 +sidebar: + exclude: true --- In this assignment you will learn to create a **G**raphical **U**ser **I**nterface (GUI) to interact with a microcontroller. diff --git a/content/assignments/vu-meter/submission.md b/content/assignments/vu-meter/submission.md index 1a245f2..201f0c3 100644 --- a/content/assignments/vu-meter/submission.md +++ b/content/assignments/vu-meter/submission.md @@ -1,7 +1,7 @@ --- title: Submission type: docs -next: assignments/spinning-and-blinking/ +# next: assignments/spinning-and-blinking/ weight: 3 ---