diff options
| author | Bob McWhirter <[email protected]> | 2021-07-23 11:21:02 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-23 11:21:02 -0400 |
| commit | e91c04a6730fc90df296bd0bee0c7262262fbbda (patch) | |
| tree | e5f6ac816921ef0eca6118a331147af028465ecc /embassy-stm32/src | |
| parent | 3655ceff279159b757d7a04ffac3483a7bf5c7b4 (diff) | |
| parent | d68f2617e663c933c11d5406c7ae12abc5e82938 (diff) | |
Merge pull request #310 from bobmcwhirter/dbg
Add a `Dbgmcu` struct capable of enabling all relevant DBGMCU.cr fields.
Diffstat (limited to 'embassy-stm32/src')
| -rw-r--r-- | embassy-stm32/src/dbgmcu/mod.rs | 13 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/embassy-stm32/src/dbgmcu/mod.rs b/embassy-stm32/src/dbgmcu/mod.rs new file mode 100644 index 000000000..8dc4cc53f --- /dev/null +++ b/embassy-stm32/src/dbgmcu/mod.rs | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | pub struct Dbgmcu {} | ||
| 2 | |||
| 3 | impl Dbgmcu { | ||
| 4 | pub unsafe fn enable_all() { | ||
| 5 | crate::pac::DBGMCU.cr().modify(|cr| { | ||
| 6 | crate::pac::dbgmcu! { | ||
| 7 | (cr, $fn_name:ident) => { | ||
| 8 | cr.$fn_name(true); | ||
| 9 | }; | ||
| 10 | } | ||
| 11 | }); | ||
| 12 | } | ||
| 13 | } | ||
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index c10310e2d..07f8b9f3b 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -31,6 +31,8 @@ pub mod adc; | |||
| 31 | pub mod clock; | 31 | pub mod clock; |
| 32 | #[cfg(dac)] | 32 | #[cfg(dac)] |
| 33 | pub mod dac; | 33 | pub mod dac; |
| 34 | #[cfg(dbgmcu)] | ||
| 35 | pub mod dbgmcu; | ||
| 34 | #[cfg(all(eth, feature = "net"))] | 36 | #[cfg(all(eth, feature = "net"))] |
| 35 | pub mod eth; | 37 | pub mod eth; |
| 36 | #[cfg(exti)] | 38 | #[cfg(exti)] |
