Struct megadrive_sys::psg::PSG [−][src]
The programmable sound generator.
This chip can generate noise and some square waves. Mostly this is used for sound effects.
Implementations
impl PSG
[src]
pub fn new() -> PSG
[src]
Initialise and return the PSG.
This is not marked unsafe as it cannot lead to memory safety issues, however creating two of these can cause conflicts in the generated sounds.
pub fn set_volume(&self, channel: u8, volume: u8)
[src]
Set the volume of a channel.
pub fn set_pitch(&self, channel: u8, frequency: impl Into<u16>)
[src]
Set the pitch of one of the channels.
This is not valid for the noise generator on channel 3.
pub fn set_noise(&self, white: bool, frequency: NoiseFrequency)
[src]
Configure the noise channel.
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,