Struct megadrive_sys::psg::PSG[][src]

pub struct PSG;

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

impl Send for PSG

impl Sync for PSG

impl Unpin for PSG

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.