From 7def8fb313c1c6677f8738b2d0ba3ed7fb04630e Mon Sep 17 00:00:00 2001 From: Mirabellensaft Date: Fri, 17 Mar 2023 19:31:07 +0100 Subject: [PATCH] polish --- embedded-workshop-book/src/bsc-exercise.md | 6 +++--- embedded-workshop-book/src/button-implementation.md | 2 +- embedded-workshop-book/src/down-the-stack.md | 10 ++++++++++ embedded-workshop-book/src/uarte-implementation.md | 6 +++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/embedded-workshop-book/src/bsc-exercise.md b/embedded-workshop-book/src/bsc-exercise.md index 7182165..c18d59a 100644 --- a/embedded-workshop-book/src/bsc-exercise.md +++ b/embedded-workshop-book/src/bsc-exercise.md @@ -2,7 +2,7 @@ In this exercise you will learn how to write a board support crate by implementing buttons and the UARTE peripheral. -The template `down-the-stack/dk_bsc/src/lib.rs` already contains the LED and Timer implementations. Add your code to the designated lines. You'll find a //todo! there. +The template `down-the-stack/dk_bsc/src/lib.rs` already contains the LED and Timer implementations. Add your code to the designated lines. You'll find a `//todo!` there. You can test after each step by running the following command out of `down-the-stack/apps` ``` @@ -12,7 +12,7 @@ This program will not call any of the functions you are implementing, so it does `down-the-stack/dk_bsc/src/lib_solution.rs` contains the full solution code. -Note for trainer: Introduction to the exercise is a guided tour through the template, and it's architecture. Make the participants aware of the placeholders for their implementations. run the hello example on the unmodified lib. + ## You will learn how to @@ -52,7 +52,7 @@ Note for trainer: Introduction to the exercise is a guided tour through the temp ## Knowledge ### Comments -The `lib.rs` has an attribute #![deny(missing_docs)]. This means, that missing doc comments for structs are returned as compiler errors, to remind you to document your work properly. +The `lib.rs` has an attribute `#![deny(missing_docs)]`. This means, that missing doc comments for structs are returned as compiler errors, to remind you to document your work properly. ```rust /// This is a doc comment diff --git a/embedded-workshop-book/src/button-implementation.md b/embedded-workshop-book/src/button-implementation.md index 13810b7..469ceae 100644 --- a/embedded-workshop-book/src/button-implementation.md +++ b/embedded-workshop-book/src/button-implementation.md @@ -13,7 +13,7 @@ The pins need to be configured as input pins with an internal pull-up. The pins ✅ Add the struct that represents the single button. It has only one field, `inner`. The type of this button is the pin configuration: `Pin>` -✅ Add the `struct` that represents the group of buttons has four fields, one for each button. The field name contains the number that corresponds to the button numeration on the board. The of type of each field is the struct that represents the generic single button. +✅ Add the `struct` that represents the group of buttons has four fields, one for each button. The field name contains the number that corresponds to the button numeration on the board. The type of each field is the struct that represents the generic single button. ✅ Add doc comments for every struct and field! diff --git a/embedded-workshop-book/src/down-the-stack.md b/embedded-workshop-book/src/down-the-stack.md index e69de29..88284e9 100644 --- a/embedded-workshop-book/src/down-the-stack.md +++ b/embedded-workshop-book/src/down-the-stack.md @@ -0,0 +1,10 @@ +# Down the Stack + +In this Session you will learn more about Rust's split crate model that includes +* the Board Support Crate +* an implementation of the Hardware Abstraction Layer +* the Peripheral Access Crate + +This session consists of lectures and two blocks of exercises: +* BSC Exercise: Implementing further features in a basic BSC +* PAC Exercise: Generating a PAC from an SVD file and writing into registers using the the generated PAC. \ No newline at end of file diff --git a/embedded-workshop-book/src/uarte-implementation.md b/embedded-workshop-book/src/uarte-implementation.md index 80a8b87..b2c305e 100644 --- a/embedded-workshop-book/src/uarte-implementation.md +++ b/embedded-workshop-book/src/uarte-implementation.md @@ -30,7 +30,7 @@ use hal::pac::uarte0::{ use hal::uarte; ``` -### Step 3: Add `struct Uarte +### Step 3: Add `struct Uarte` ✅ Add `struct Uarte` that serves as a wrapper for the `UARTE1` instance. The struct has one field labelled `inner`, it contains the `UARTE1` instance: `hal::Uarte`. @@ -132,7 +132,7 @@ We can't just write to the `Uarte` instance. A simple write would write from fla ✅ Create a buffer. The type is an `array` of 16 u8, set to all 0. -✅ To copy all data into an on-stack buffer, iterate over every chunk of the string to copy it into the buffer: +✅ To copy all data into an on-stack buffer, iterate over every chunk of the string to copy it into the buffer.
Solution @@ -170,7 +170,7 @@ ls /dev/tty.usbmodem* screen
115200 ``` -### Step 7: Run the example. +### Step 8: Run the example. ✅ In another terminal window go into the folder `down-the-stack/apps` and use the following command.