mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2025-01-26 07:48:06 +00:00
corrections
This commit is contained in:
parent
4eb0ac3b9e
commit
2c2358a333
2 changed files with 4 additions and 4 deletions
|
@ -1,10 +1,10 @@
|
|||
# Enabling the UARTE0 peripheral
|
||||
|
||||
Write a simple program which uses the PAC to enable the UART. See how writing arbitrary values to the ENABLE field in the ENABLE register is unsafe, because only values 0 or 8 should be used.
|
||||
Write a simple program which uses the PAC to enable the UARTE0. See how writing arbitrary values to the ENABLE field in the ENABLE register is unsafe, because only values 0 or 8 should be used.
|
||||
|
||||
## In this exercise you will learn how to:
|
||||
* to safely write into a register
|
||||
* how to unsafely write into a register
|
||||
* how to write raw bits into a register
|
||||
* how to read a register
|
||||
|
||||
## Prerequisites
|
||||
|
@ -27,7 +27,7 @@ Uarte0 is disabled.
|
|||
```
|
||||
|
||||
Find the starter code in `down-the-stack/apps/uarte_enable.rs`
|
||||
Find the full solution in `down-the-stack/apps/uarte_enable_solution.rs`
|
||||
Find the full solution in `down-the-stack/solutions/uarte_enable.rs`
|
||||
|
||||
|
||||
## Step-by-Step Solution
|
||||
|
|
|
@ -33,7 +33,7 @@ Note the difference between the struct field `UARTE0` in `Peripherals` and the m
|
|||
|
||||
## Finding corresponding sections in the PAC
|
||||
|
||||
* `dk_pac/src/lib.rs` defines the single peripherals with their register block addresses and contains a struct defintion for the `struct Peripherals`. There are two methods for this struct: `take()` and `steal()`. `take()` assures, that only one instance of this can exist. Hence, it's safe. Note that `take()` is only available with the `critical-section` feature enabled.
|
||||
* `dk_pac/src/lib.rs` defines the single peripherals with their register block addresses and contains a struct definition for the `struct Peripherals`. There are two methods for this struct: `take()` and `steal()`. `take()` assures, that only one instance of this can exist. Hence, it's safe. Note that `take()` is only available with the `critical-section` feature enabled.
|
||||
|
||||
* `dk_pac/src/uarte0.rs` defines a struct that contains all the registers of the `UARTE0` register block. The `enable` field represents the register of the same name.
|
||||
|
||||
|
|
Loading…
Reference in a new issue