diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..fdb1306 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,3 @@ +### Checklist + +- [ ] Add a changelog if necessary. See for how to write it. diff --git a/lib/src/registers/doorbell.rs b/lib/src/registers/doorbell.rs index 0406013..a162f06 100644 --- a/lib/src/registers/doorbell.rs +++ b/lib/src/registers/doorbell.rs @@ -3,7 +3,7 @@ use super::capability::Capability; use accessor::array; use accessor::Mapper; -use core::{convert::TryFrom, fmt}; +use core::convert::TryFrom; /// A type alias to [`Doorbell`] register for backward compability. #[deprecated = "Use `Doorbell` instead of `Register`."] @@ -48,11 +48,7 @@ impl Doorbell { rw_field!(0..=7, doorbell_target, "Doorbell Target", u8); rw_field!(16..=31, doorbell_stream_id, "Doorbell Stream ID", u16); } -impl fmt::Debug for Doorbell { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("doorbell::Register") - .field("doorbell_target", &self.doorbell_target()) - .field("doorbell_stream_id", &self.doorbell_stream_id()) - .finish() - } -} +impl_debug_from_methods!(Doorbell { + doorbell_target, + doorbell_stream_id, +}); diff --git a/lib/src/registers/mod.rs b/lib/src/registers/mod.rs index a34472c..b192dbd 100644 --- a/lib/src/registers/mod.rs +++ b/lib/src/registers/mod.rs @@ -4,6 +4,7 @@ use accessor::array; use accessor::Mapper; pub use capability::Capability; +pub use doorbell::Doorbell; pub use operational::{Operational, PortRegisterSet}; pub use runtime::InterrupterRegisterSet; pub use runtime::Runtime; @@ -22,7 +23,7 @@ where /// Host Controller Capability Register pub capability: Capability, /// Doorbell Array - pub doorbell: array::ReadWrite, + pub doorbell: array::ReadWrite, /// Host Controller Operational Register pub operational: Operational, /// Port Register Set Array