pub struct Pulse {
pub envelope: Envelope,
pub length: LengthCounter,
/* private fields */
}Expand description
Pulse channel state.
Fields§
§envelope: EnvelopeEnvelope generator.
length: LengthCounterLength counter.
Implementations§
Source§impl Pulse
impl Pulse
Sourcepub const fn new(is_pulse1: bool) -> Self
pub const fn new(is_pulse1: bool) -> Self
Construct a new pulse channel. is_pulse1=true for the pulse-1 sweep
negation flavor (one’s complement).
Sourcepub fn write_ctrl(&mut self, value: u8)
pub fn write_ctrl(&mut self, value: u8)
$4000 / $4004 write: duty + length-halt + envelope.
Sourcepub fn write_sweep(&mut self, value: u8)
pub fn write_sweep(&mut self, value: u8)
$4001 / $4005 write: sweep config.
Sourcepub fn write_timer_lo(&mut self, value: u8)
pub fn write_timer_lo(&mut self, value: u8)
$4002 / $4006 write: timer low.
Sourcepub fn write_timer_hi(&mut self, value: u8)
pub fn write_timer_hi(&mut self, value: u8)
$4003 / $4007 write: length load + timer high.
Sourcepub fn clock_timer(&mut self)
pub fn clock_timer(&mut self)
One APU clock (half CPU clock).
Sourcepub fn clock_half_frame(&mut self)
pub fn clock_half_frame(&mut self)
Half-frame clock: sweep + length.
Sourcepub fn clock_quarter_frame(&mut self)
pub fn clock_quarter_frame(&mut self)
Quarter-frame clock: envelope.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pulse
impl RefUnwindSafe for Pulse
impl Send for Pulse
impl Sync for Pulse
impl Unpin for Pulse
impl UnsafeUnpin for Pulse
impl UnwindSafe for Pulse
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