1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use volatile_register::{RW, WO};
use peripheral::DCB;
const DCB_DEMCR_TRCENA: u32 = 1 << 24;
#[repr(C)]
pub struct RegisterBlock {
pub dhcsr: RW<u32>,
pub dcrsr: WO<u32>,
pub dcrdr: RW<u32>,
pub demcr: RW<u32>,
}
impl DCB {
pub fn enable_trace(&mut self) {
unsafe { self.demcr.modify(|w| w | DCB_DEMCR_TRCENA); }
}
pub fn disable_trace(&mut self) {
unsafe { self.demcr.modify(|w| w & !DCB_DEMCR_TRCENA); }
}
}