pub struct MasterVolume(/* private fields */);Expand description
Master volume and VIN panning (NR50).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7 | vin_left | R/W | Mix external VIN into the left output. |
| 6-4 | left_volume | R/W | Left output volume (0 treated as 1, 7 as 8). |
| 3 | vin_right | R/W | Mix external VIN into the right output. |
| 2-0 | right_volume | R/W | Right output volume (0 treated as 1, 7 as 8). |
Implementations§
Source§impl MasterVolume
impl MasterVolume
Sourcepub const fn right_volume(&self) -> u8
pub const fn right_volume(&self) -> u8
Right output volume (0 is treated as 1, 7 as 8).
Bits: 0..3
Sourcepub const fn with_right_volume_checked(self, value: u8) -> Result<Self, ()>
pub const fn with_right_volume_checked(self, value: u8) -> Result<Self, ()>
Right output volume (0 is treated as 1, 7 as 8).
Bits: 0..3
Sourcepub const fn with_right_volume(self, value: u8) -> Self
pub const fn with_right_volume(self, value: u8) -> Self
Right output volume (0 is treated as 1, 7 as 8).
Bits: 0..3
Sourcepub const fn set_right_volume(&mut self, value: u8)
pub const fn set_right_volume(&mut self, value: u8)
Right output volume (0 is treated as 1, 7 as 8).
Bits: 0..3
Sourcepub const fn set_right_volume_checked(&mut self, value: u8) -> Result<(), ()>
pub const fn set_right_volume_checked(&mut self, value: u8) -> Result<(), ()>
Right output volume (0 is treated as 1, 7 as 8).
Bits: 0..3
Sourcepub const fn with_vin_right_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_vin_right_checked(self, value: bool) -> Result<Self, ()>
Mix external VIN into the right output.
Bits: 3..4
Sourcepub const fn with_vin_right(self, value: bool) -> Self
pub const fn with_vin_right(self, value: bool) -> Self
Mix external VIN into the right output.
Bits: 3..4
Sourcepub const fn set_vin_right(&mut self, value: bool)
pub const fn set_vin_right(&mut self, value: bool)
Mix external VIN into the right output.
Bits: 3..4
Sourcepub const fn set_vin_right_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_vin_right_checked(&mut self, value: bool) -> Result<(), ()>
Mix external VIN into the right output.
Bits: 3..4
Sourcepub const fn left_volume(&self) -> u8
pub const fn left_volume(&self) -> u8
Left output volume (0 is treated as 1, 7 as 8).
Bits: 4..7
Sourcepub const fn with_left_volume_checked(self, value: u8) -> Result<Self, ()>
pub const fn with_left_volume_checked(self, value: u8) -> Result<Self, ()>
Left output volume (0 is treated as 1, 7 as 8).
Bits: 4..7
Sourcepub const fn with_left_volume(self, value: u8) -> Self
pub const fn with_left_volume(self, value: u8) -> Self
Left output volume (0 is treated as 1, 7 as 8).
Bits: 4..7
Sourcepub const fn set_left_volume(&mut self, value: u8)
pub const fn set_left_volume(&mut self, value: u8)
Left output volume (0 is treated as 1, 7 as 8).
Bits: 4..7
Sourcepub const fn set_left_volume_checked(&mut self, value: u8) -> Result<(), ()>
pub const fn set_left_volume_checked(&mut self, value: u8) -> Result<(), ()>
Left output volume (0 is treated as 1, 7 as 8).
Bits: 4..7
Sourcepub const fn with_vin_left_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_vin_left_checked(self, value: bool) -> Result<Self, ()>
Mix external VIN into the left output.
Bits: 7..8
Sourcepub const fn with_vin_left(self, value: bool) -> Self
pub const fn with_vin_left(self, value: bool) -> Self
Mix external VIN into the left output.
Bits: 7..8
Sourcepub const fn set_vin_left(&mut self, value: bool)
pub const fn set_vin_left(&mut self, value: bool)
Mix external VIN into the left output.
Bits: 7..8
Trait Implementations§
Source§impl Clone for MasterVolume
impl Clone for MasterVolume
Source§fn clone(&self) -> MasterVolume
fn clone(&self) -> MasterVolume
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more