pub struct Triangle {
pub timer: Timer,
pub sequence: u8,
pub length: LengthCounter,
pub linear: LinearCounter,
pub force_silent: bool,
}
Expand description
APU Triangle Channel provides triangle wave generation.
Fields§
§timer: Timer
§sequence: u8
§length: LengthCounter
§linear: LinearCounter
§force_silent: bool
Implementations§
Source§impl Triangle
impl Triangle
pub const fn new() -> Self
pub const fn silent(&self) -> bool
pub const fn set_silent(&mut self, silent: bool)
pub fn clock_quarter_frame(&mut self)
pub fn clock_half_frame(&mut self)
Sourcepub const fn write_linear_counter(&mut self, val: u8)
pub const fn write_linear_counter(&mut self, val: u8)
$4008 Linear counter control
Sourcepub fn write_timer_lo(&mut self, val: u8)
pub fn write_timer_lo(&mut self, val: u8)
$400A Triangle timer lo
Sourcepub fn write_timer_hi(&mut self, val: u8)
pub fn write_timer_hi(&mut self, val: u8)
$400B Triangle timer high
pub const fn set_enabled(&mut self, enabled: bool)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Triangle
impl<'de> Deserialize<'de> for Triangle
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Triangle
impl RefUnwindSafe for Triangle
impl Send for Triangle
impl Sync for Triangle
impl Unpin for Triangle
impl UnwindSafe for Triangle
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