diff options
| author | Ulf Lilleengen <[email protected]> | 2021-05-25 13:32:10 +0200 |
|---|---|---|
| committer | Ulf Lilleengen <[email protected]> | 2021-05-25 13:32:10 +0200 |
| commit | ef254647f7bae68ae2f754071635a743b678fd61 (patch) | |
| tree | b26a8dabb73e99bfa09943810c61c405c187a354 | |
| parent | 1c10e746b61460488e7e9c6d64f992a247b4c236 (diff) | |
Add stm32l0
| -rw-r--r-- | embassy-stm32/src/rcc/l0/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/embassy-stm32/src/rcc/l0/mod.rs b/embassy-stm32/src/rcc/l0/mod.rs new file mode 100644 index 000000000..000aaa9e0 --- /dev/null +++ b/embassy-stm32/src/rcc/l0/mod.rs | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | use crate::pac; | ||
| 2 | use embassy::util::Steal; | ||
| 3 | use pac::rcc::{self, vals}; | ||
| 4 | |||
| 5 | #[derive(Default)] | ||
| 6 | pub struct Config {} | ||
| 7 | |||
| 8 | pub unsafe fn init(config: Config) { | ||
| 9 | let rcc = pac::RCC; | ||
| 10 | |||
| 11 | let enabled = vals::Iophen::ENABLED; | ||
| 12 | rcc.iopenr().write(|w| { | ||
| 13 | w.set_iopaen(enabled); | ||
| 14 | w.set_iopben(enabled); | ||
| 15 | w.set_iopcen(enabled); | ||
| 16 | w.set_iopden(enabled); | ||
| 17 | w.set_iopeen(enabled); | ||
| 18 | w.set_iophen(enabled); | ||
| 19 | }); | ||
| 20 | } | ||
