pub struct PulseLengthDuty(/* private fields */);Expand description
Length timer and duty cycle (NR11 / NR21).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7-6 | duty | R/W | Output waveform duty cycle. |
| 5-0 | length | W | Initial length timer; higher means a shorter time to cut. |
Implementations§
Source§impl PulseLengthDuty
impl PulseLengthDuty
Sourcepub const fn length(&self) -> u8
pub const fn length(&self) -> u8
Initial length timer (write-only): higher means a shorter time to cut.
Bits: 0..6
Sourcepub const fn with_length_checked(self, value: u8) -> Result<Self, ()>
pub const fn with_length_checked(self, value: u8) -> Result<Self, ()>
Initial length timer (write-only): higher means a shorter time to cut.
Bits: 0..6
Sourcepub const fn with_length(self, value: u8) -> Self
pub const fn with_length(self, value: u8) -> Self
Initial length timer (write-only): higher means a shorter time to cut.
Bits: 0..6
Sourcepub const fn set_length(&mut self, value: u8)
pub const fn set_length(&mut self, value: u8)
Initial length timer (write-only): higher means a shorter time to cut.
Bits: 0..6
Sourcepub const fn set_length_checked(&mut self, value: u8) -> Result<(), ()>
pub const fn set_length_checked(&mut self, value: u8) -> Result<(), ()>
Initial length timer (write-only): higher means a shorter time to cut.
Bits: 0..6
Sourcepub const fn with_duty_checked(self, value: Duty) -> Result<Self, ()>
pub const fn with_duty_checked(self, value: Duty) -> Result<Self, ()>
Output waveform duty cycle.
Bits: 6..8
Trait Implementations§
Source§impl Clone for PulseLengthDuty
impl Clone for PulseLengthDuty
Source§fn clone(&self) -> PulseLengthDuty
fn clone(&self) -> PulseLengthDuty
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PulseLengthDuty
Source§impl Debug for PulseLengthDuty
impl Debug for PulseLengthDuty
Source§impl Default for PulseLengthDuty
impl Default for PulseLengthDuty
impl Eq for PulseLengthDuty
Source§impl From<PulseLengthDuty> for u8
impl From<PulseLengthDuty> for u8
Source§fn from(v: PulseLengthDuty) -> Self
fn from(v: PulseLengthDuty) -> Self
Converts to this type from the input type.
Source§impl From<u8> for PulseLengthDuty
impl From<u8> for PulseLengthDuty
Source§impl PartialEq for PulseLengthDuty
impl PartialEq for PulseLengthDuty
impl StructuralPartialEq for PulseLengthDuty
Auto Trait Implementations§
impl BankSafe for PulseLengthDuty
impl Freeze for PulseLengthDuty
impl RefUnwindSafe for PulseLengthDuty
impl Send for PulseLengthDuty
impl Sync for PulseLengthDuty
impl Unpin for PulseLengthDuty
impl UnsafeUnpin for PulseLengthDuty
impl UnwindSafe for PulseLengthDuty
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more