Skip to content

Commit c470f8b

Browse files
committed
dwt, itm, tpiu: remove get_ prefix, as per Rust API guidelines
1 parent 880b947 commit c470f8b

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

src/peripheral/dwt.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ bitfield! {
5656
#[repr(C)]
5757
#[derive(Copy, Clone)]
5858
pub struct Ctrl(u32);
59-
get_cyccntena, set_cyccntena: 0;
60-
get_pcsamplena, set_pcsamplena: 12;
61-
get_exctrcena, set_exctrcena: 16;
62-
get_noprfcnt, _: 24;
63-
get_nocyccnt, _: 25;
64-
get_noexttrig, _: 26;
65-
get_notrcpkt, _: 27;
66-
u8, get_numcomp, _: 31, 28;
59+
cyccntena, set_cyccntena: 0;
60+
pcsamplena, set_pcsamplena: 12;
61+
exctrcena, set_exctrcena: 16;
62+
noprfcnt, _: 24;
63+
nocyccnt, _: 25;
64+
noexttrig, _: 26;
65+
notrcpkt, _: 27;
66+
u8, numcomp, _: 31, 28;
6767
}
6868

6969
/// Comparator
@@ -83,11 +83,11 @@ bitfield! {
8383
#[derive(Copy, Clone)]
8484
/// Comparator FUNCTIONn register.
8585
pub struct Function(u32);
86-
u8, get_function, set_function: 3, 0;
87-
get_emitrange, set_emitrange: 5;
88-
get_cycmatch, set_cycmatch: 7;
89-
get_datavmatch, set_datavmatch: 8;
90-
get_matched, _: 24;
86+
u8, function, set_function: 3, 0;
87+
emitrange, set_emitrange: 5;
88+
cycmatch, set_cycmatch: 7;
89+
datavmatch, set_datavmatch: 8;
90+
matched, _: 24;
9191
}
9292

9393
impl DWT {
@@ -96,35 +96,35 @@ impl DWT {
9696
/// A value of zero indicates no comparator support.
9797
#[inline]
9898
pub fn num_comp(&self) -> u8 {
99-
self.ctrl.read().get_numcomp()
99+
self.ctrl.read().numcomp()
100100
}
101101

102102
/// Returns `true` if the the implementation supports sampling and exception tracing
103103
#[cfg(not(armv6m))]
104104
#[inline]
105105
pub fn has_exception_trace(&self) -> bool {
106-
self.ctrl.read().get_notrcpkt() == false
106+
self.ctrl.read().notrcpkt() == false
107107
}
108108

109109
/// Returns `true` if the implementation includes external match signals
110110
#[cfg(not(armv6m))]
111111
#[inline]
112112
pub fn has_external_match(&self) -> bool {
113-
self.ctrl.read().get_noexttrig() == false
113+
self.ctrl.read().noexttrig() == false
114114
}
115115

116116
/// Returns `true` if the implementation supports a cycle counter
117117
#[cfg(not(armv6m))]
118118
#[inline]
119119
pub fn has_cycle_counter(&self) -> bool {
120-
self.ctrl.read().get_nocyccnt() == false
120+
self.ctrl.read().nocyccnt() == false
121121
}
122122

123123
/// Returns `true` if the implementation the profiling counters
124124
#[cfg(not(armv6m))]
125125
#[inline]
126126
pub fn has_profiling_counter(&self) -> bool {
127-
self.ctrl.read().get_noprfcnt() == false
127+
self.ctrl.read().noprfcnt() == false
128128
}
129129

130130
/// Enables the cycle counter
@@ -150,7 +150,7 @@ impl DWT {
150150
#[cfg(not(armv6m))]
151151
#[inline]
152152
pub fn cycle_counter_enabled(&self) -> bool {
153-
self.ctrl.read().get_cyccntena()
153+
self.ctrl.read().cyccntena()
154154
}
155155

156156
/// Whether to enable exception tracing

src/peripheral/itm.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ bitfield! {
3636
#[repr(C)]
3737
#[derive(Copy, Clone)]
3838
pub struct Tcr(u32);
39-
get_itmena, set_itmena: 0;
40-
get_tsena, set_tsena: 1;
41-
get_syncena, set_synena: 2;
42-
get_txena, set_txena: 3;
43-
get_swoena, set_swoena: 4;
44-
u8, get_tsprescale, set_tsprescale: 9, 8;
45-
u8, get_gtsfreq, set_gtsfreq: 11, 10;
46-
u8, get_tracebusid, set_tracebusid: 22, 16;
39+
itmena, set_itmena: 0;
40+
tsena, set_tsena: 1;
41+
syncena, set_synena: 2;
42+
txena, set_txena: 3;
43+
swoena, set_swoena: 4;
44+
u8, tsprescale, set_tsprescale: 9, 8;
45+
u8, gtsfreq, set_gtsfreq: 11, 10;
46+
u8, tracebusid, set_tracebusid: 22, 16;
4747
busy, _: 23;
4848
}
4949

src/peripheral/tpiu.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ bitfield! {
3838
#[repr(C)]
3939
#[derive(Clone, Copy)]
4040
pub struct Ffcr(u32);
41-
get_enfcont, set_enfcont: 1;
41+
enfcont, set_enfcont: 1;
4242
}
4343

4444
bitfield! {

0 commit comments

Comments
 (0)