aboutsummaryrefslogtreecommitdiff
path: root/src/peripheral/dwt.rs
diff options
context:
space:
mode:
authorGravatar Viktor Sonesten <v@tmplt.dev> 2021-11-21 02:20:51 +0100
committerGravatar Viktor Sonesten <v@tmplt.dev> 2021-11-21 02:51:02 +0100
commit92c15ed56da6331c1f7bc4bb1372b56e3fc93a05 (patch)
treec1eee27c86b5ca03f465359da3b9fcda07346d0f /src/peripheral/dwt.rs
parent5a92298d9c12685214b12266357fe7c104035b59 (diff)
downloadcortex-m-92c15ed56da6331c1f7bc4bb1372b56e3fc93a05.tar.gz
cortex-m-92c15ed56da6331c1f7bc4bb1372b56e3fc93a05.tar.zst
cortex-m-92c15ed56da6331c1f7bc4bb1372b56e3fc93a05.zip
dwt, itm, tpiu: derive common traits for structs/enums
As per Rust API guidelines: <https://rust-lang.github.io/api-guidelines/interoperability.html#c-common-traits>.
Diffstat (limited to 'src/peripheral/dwt.rs')
-rw-r--r--src/peripheral/dwt.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/peripheral/dwt.rs b/src/peripheral/dwt.rs
index 0769e96..7fc9478 100644
--- a/src/peripheral/dwt.rs
+++ b/src/peripheral/dwt.rs
@@ -304,7 +304,7 @@ impl DWT {
}
/// Whether the comparator should match on read, write or read/write operations.
-#[derive(Debug, PartialEq)]
+#[derive(Debug, Eq, PartialEq, Copy, Clone)]
pub enum AccessType {
/// Generate packet only when matched adress is read from.
ReadOnly,
@@ -315,7 +315,7 @@ pub enum AccessType {
}
/// The sequence of packet(s) that should be emitted on comparator match.
-#[derive(Debug, PartialEq)]
+#[derive(Debug, Eq, PartialEq, Copy, Clone)]
pub enum EmitOption {
/// Emit only trace data value packet.
Data,
@@ -332,7 +332,7 @@ pub enum EmitOption {
}
/// Settings for address matching
-#[derive(Debug)]
+#[derive(Debug, Eq, PartialEq, Copy, Clone)]
pub struct ComparatorAddressSettings {
/// The address to match against.
pub address: u32,
@@ -345,7 +345,7 @@ pub struct ComparatorAddressSettings {
}
/// The available functions of a DWT comparator.
-#[derive(Debug)]
+#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[non_exhaustive]
pub enum ComparatorFunction {
/// Compare accessed memory addresses.
@@ -353,7 +353,7 @@ pub enum ComparatorFunction {
}
/// Possible error values returned on [Comparator::configure].
-#[derive(Debug)]
+#[derive(Debug, Eq, PartialEq, Copy, Clone)]
#[non_exhaustive]
pub enum DwtError {
/// Invalid combination of [AccessType] and [EmitOption].