In this exercise you will generate a PAC (Peripheral Access Crate) from an svd file, and write a small program that enables the UARTE0 register.
## In this exercise you will learn how to
* Generate a Peripheral Access Crate from an svd file
* Two ways to write into a register to enable and disable it
## Prerequisites
[todo!]
## Tasks
## Generating the PAC
✅ Install `svd2rust` using the following command:
```
cargo install svd2rust
```
✅ Download https://github.com/NordicSemiconductor/nrfx/blob/master/mdk/nrf52.svd (This version has an error: writeonce needs to be changed to writeOnce)
Place the file into `down-the-stack/dk-pac`. Note how we provide a `Cargo.toml` file, as it will not be generated by svd2rust.
✅ In the terminal, go to the file's location. Run svd2rust with the SVD file to generate a PAC using the `cortex-m` flag.
```
svd2rust --target cortex-m -i nrf52.svd
```
If you check the folder `down-the-stack/dk-pac` now, you see three new files:
* lib.rs - the file that contains the generated code for the pac
* device.x - linker sections(?)
* build.rs - linker script
✅ Open the generated `lib.rs` with an editor.
Notice how it's one long line of text in the source file.
✅ Look at the PAC docs with cargo doc --open.
✅ cargo fmt the crate. No change to the docs, but a bit more readable.
✅ Install form with the following command:
```
cargo install form
```
```
✅ use form to process the one-big-file into one-file-per-module with the following command:
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.