aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Viktor Sonesten <v@tmplt.dev> 2021-11-21 01:12:11 +0100
committerGravatar Viktor Sonesten <v@tmplt.dev> 2021-11-21 01:12:11 +0100
commitc470f8bc9a62fa6305fffca22ece972733739453 (patch)
tree17aec67c963af6e2b7c06c9a845e75c66e42818b
parent880b947c44e78fd07d7c231a3c0c82ed3e54b9ef (diff)
downloadcortex-m-c470f8bc9a62fa6305fffca22ece972733739453.tar.gz
cortex-m-c470f8bc9a62fa6305fffca22ece972733739453.tar.zst
cortex-m-c470f8bc9a62fa6305fffca22ece972733739453.zip
dwt, itm, tpiu: remove get_ prefix, as per Rust API guidelines
-rw-r--r--src/peripheral/dwt.rs38
-rw-r--r--src/peripheral/itm.rs16
-rw-r--r--src/peripheral/tpiu.rs2
3 files changed, 28 insertions, 28 deletions
diff --git a/src/peripheral/dwt.rs b/src/peripheral/dwt.rs
index 720511b..188681b 100644
--- a/src/peripheral/dwt.rs
+++ b/src/peripheral/dwt.rs
@@ -56,14 +56,14 @@ bitfield! {
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Ctrl(u32);
- get_cyccntena, set_cyccntena: 0;
- get_pcsamplena, set_pcsamplena: 12;
- get_exctrcena, set_exctrcena: 16;
- get_noprfcnt, _: 24;
- get_nocyccnt, _: 25;
- get_noexttrig, _: 26;
- get_notrcpkt, _: 27;
- u8, get_numcomp, _: 31, 28;
+ cyccntena, set_cyccntena: 0;
+ pcsamplena, set_pcsamplena: 12;
+ exctrcena, set_exctrcena: 16;
+ noprfcnt, _: 24;
+ nocyccnt, _: 25;
+ noexttrig, _: 26;
+ notrcpkt, _: 27;
+ u8, numcomp, _: 31, 28;
}
/// Comparator
@@ -83,11 +83,11 @@ bitfield! {
#[derive(Copy, Clone)]
/// Comparator FUNCTIONn register.
pub struct Function(u32);
- u8, get_function, set_function: 3, 0;
- get_emitrange, set_emitrange: 5;
- get_cycmatch, set_cycmatch: 7;
- get_datavmatch, set_datavmatch: 8;
- get_matched, _: 24;
+ u8, function, set_function: 3, 0;
+ emitrange, set_emitrange: 5;
+ cycmatch, set_cycmatch: 7;
+ datavmatch, set_datavmatch: 8;
+ matched, _: 24;
}
impl DWT {
@@ -96,35 +96,35 @@ impl DWT {
/// A value of zero indicates no comparator support.
#[inline]
pub fn num_comp(&self) -> u8 {
- self.ctrl.read().get_numcomp()
+ self.ctrl.read().numcomp()
}
/// Returns `true` if the the implementation supports sampling and exception tracing
#[cfg(not(armv6m))]
#[inline]
pub fn has_exception_trace(&self) -> bool {
- self.ctrl.read().get_notrcpkt() == false
+ self.ctrl.read().notrcpkt() == false
}
/// Returns `true` if the implementation includes external match signals
#[cfg(not(armv6m))]
#[inline]
pub fn has_external_match(&self) -> bool {
- self.ctrl.read().get_noexttrig() == false
+ self.ctrl.read().noexttrig() == false
}
/// Returns `true` if the implementation supports a cycle counter
#[cfg(not(armv6m))]
#[inline]
pub fn has_cycle_counter(&self) -> bool {
- self.ctrl.read().get_nocyccnt() == false
+ self.ctrl.read().nocyccnt() == false
}
/// Returns `true` if the implementation the profiling counters
#[cfg(not(armv6m))]
#[inline]
pub fn has_profiling_counter(&self) -> bool {
- self.ctrl.read().get_noprfcnt() == false
+ self.ctrl.read().noprfcnt() == false
}
/// Enables the cycle counter
@@ -150,7 +150,7 @@ impl DWT {
#[cfg(not(armv6m))]
#[inline]
pub fn cycle_counter_enabled(&self) -> bool {
- self.ctrl.read().get_cyccntena()
+ self.ctrl.read().cyccntena()
}
/// Whether to enable exception tracing
diff --git a/src/peripheral/itm.rs b/src/peripheral/itm.rs
index 24b926d..626fba2 100644
--- a/src/peripheral/itm.rs
+++ b/src/peripheral/itm.rs
@@ -36,14 +36,14 @@ bitfield! {
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Tcr(u32);
- get_itmena, set_itmena: 0;
- get_tsena, set_tsena: 1;
- get_syncena, set_synena: 2;
- get_txena, set_txena: 3;
- get_swoena, set_swoena: 4;
- u8, get_tsprescale, set_tsprescale: 9, 8;
- u8, get_gtsfreq, set_gtsfreq: 11, 10;
- u8, get_tracebusid, set_tracebusid: 22, 16;
+ itmena, set_itmena: 0;
+ tsena, set_tsena: 1;
+ syncena, set_synena: 2;
+ txena, set_txena: 3;
+ swoena, set_swoena: 4;
+ u8, tsprescale, set_tsprescale: 9, 8;
+ u8, gtsfreq, set_gtsfreq: 11, 10;
+ u8, tracebusid, set_tracebusid: 22, 16;
busy, _: 23;
}
diff --git a/src/peripheral/tpiu.rs b/src/peripheral/tpiu.rs
index 5443fc0..9ff92d1 100644
--- a/src/peripheral/tpiu.rs
+++ b/src/peripheral/tpiu.rs
@@ -38,7 +38,7 @@ bitfield! {
#[repr(C)]
#[derive(Clone, Copy)]
pub struct Ffcr(u32);
- get_enfcont, set_enfcont: 1;
+ enfcont, set_enfcont: 1;
}
bitfield! {