pub struct Panning(/* private fields */);Expand description
Sound panning (NR51): which channels reach each output.
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7 | ch4_left | R/W | Channel 4 (noise) reaches the left output. |
| 6 | ch3_left | R/W | Channel 3 (wave) reaches the left output. |
| 5 | ch2_left | R/W | Channel 2 (pulse) reaches the left output. |
| 4 | ch1_left | R/W | Channel 1 (pulse) reaches the left output. |
| 3 | ch4_right | R/W | Channel 4 (noise) reaches the right output. |
| 2 | ch3_right | R/W | Channel 3 (wave) reaches the right output. |
| 1 | ch2_right | R/W | Channel 2 (pulse) reaches the right output. |
| 0 | ch1_right | R/W | Channel 1 (pulse) reaches the right output. |
Implementations§
Source§impl Panning
impl Panning
Sourcepub const fn with_ch1_right_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch1_right_checked(self, value: bool) -> Result<Self, ()>
Channel 1 (pulse) reaches the right output.
Bits: 0..1
Sourcepub const fn with_ch1_right(self, value: bool) -> Self
pub const fn with_ch1_right(self, value: bool) -> Self
Channel 1 (pulse) reaches the right output.
Bits: 0..1
Sourcepub const fn set_ch1_right(&mut self, value: bool)
pub const fn set_ch1_right(&mut self, value: bool)
Channel 1 (pulse) reaches the right output.
Bits: 0..1
Sourcepub const fn set_ch1_right_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch1_right_checked(&mut self, value: bool) -> Result<(), ()>
Channel 1 (pulse) reaches the right output.
Bits: 0..1
Sourcepub const fn with_ch2_right_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch2_right_checked(self, value: bool) -> Result<Self, ()>
Channel 2 (pulse) reaches the right output.
Bits: 1..2
Sourcepub const fn with_ch2_right(self, value: bool) -> Self
pub const fn with_ch2_right(self, value: bool) -> Self
Channel 2 (pulse) reaches the right output.
Bits: 1..2
Sourcepub const fn set_ch2_right(&mut self, value: bool)
pub const fn set_ch2_right(&mut self, value: bool)
Channel 2 (pulse) reaches the right output.
Bits: 1..2
Sourcepub const fn set_ch2_right_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch2_right_checked(&mut self, value: bool) -> Result<(), ()>
Channel 2 (pulse) reaches the right output.
Bits: 1..2
Sourcepub const fn with_ch3_right_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch3_right_checked(self, value: bool) -> Result<Self, ()>
Channel 3 (wave) reaches the right output.
Bits: 2..3
Sourcepub const fn with_ch3_right(self, value: bool) -> Self
pub const fn with_ch3_right(self, value: bool) -> Self
Channel 3 (wave) reaches the right output.
Bits: 2..3
Sourcepub const fn set_ch3_right(&mut self, value: bool)
pub const fn set_ch3_right(&mut self, value: bool)
Channel 3 (wave) reaches the right output.
Bits: 2..3
Sourcepub const fn set_ch3_right_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch3_right_checked(&mut self, value: bool) -> Result<(), ()>
Channel 3 (wave) reaches the right output.
Bits: 2..3
Sourcepub const fn with_ch4_right_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch4_right_checked(self, value: bool) -> Result<Self, ()>
Channel 4 (noise) reaches the right output.
Bits: 3..4
Sourcepub const fn with_ch4_right(self, value: bool) -> Self
pub const fn with_ch4_right(self, value: bool) -> Self
Channel 4 (noise) reaches the right output.
Bits: 3..4
Sourcepub const fn set_ch4_right(&mut self, value: bool)
pub const fn set_ch4_right(&mut self, value: bool)
Channel 4 (noise) reaches the right output.
Bits: 3..4
Sourcepub const fn set_ch4_right_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch4_right_checked(&mut self, value: bool) -> Result<(), ()>
Channel 4 (noise) reaches the right output.
Bits: 3..4
Sourcepub const fn with_ch1_left_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch1_left_checked(self, value: bool) -> Result<Self, ()>
Channel 1 (pulse) reaches the left output.
Bits: 4..5
Sourcepub const fn with_ch1_left(self, value: bool) -> Self
pub const fn with_ch1_left(self, value: bool) -> Self
Channel 1 (pulse) reaches the left output.
Bits: 4..5
Sourcepub const fn set_ch1_left(&mut self, value: bool)
pub const fn set_ch1_left(&mut self, value: bool)
Channel 1 (pulse) reaches the left output.
Bits: 4..5
Sourcepub const fn set_ch1_left_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch1_left_checked(&mut self, value: bool) -> Result<(), ()>
Channel 1 (pulse) reaches the left output.
Bits: 4..5
Sourcepub const fn with_ch2_left_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch2_left_checked(self, value: bool) -> Result<Self, ()>
Channel 2 (pulse) reaches the left output.
Bits: 5..6
Sourcepub const fn with_ch2_left(self, value: bool) -> Self
pub const fn with_ch2_left(self, value: bool) -> Self
Channel 2 (pulse) reaches the left output.
Bits: 5..6
Sourcepub const fn set_ch2_left(&mut self, value: bool)
pub const fn set_ch2_left(&mut self, value: bool)
Channel 2 (pulse) reaches the left output.
Bits: 5..6
Sourcepub const fn set_ch2_left_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch2_left_checked(&mut self, value: bool) -> Result<(), ()>
Channel 2 (pulse) reaches the left output.
Bits: 5..6
Sourcepub const fn with_ch3_left_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch3_left_checked(self, value: bool) -> Result<Self, ()>
Channel 3 (wave) reaches the left output.
Bits: 6..7
Sourcepub const fn with_ch3_left(self, value: bool) -> Self
pub const fn with_ch3_left(self, value: bool) -> Self
Channel 3 (wave) reaches the left output.
Bits: 6..7
Sourcepub const fn set_ch3_left(&mut self, value: bool)
pub const fn set_ch3_left(&mut self, value: bool)
Channel 3 (wave) reaches the left output.
Bits: 6..7
Sourcepub const fn set_ch3_left_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_ch3_left_checked(&mut self, value: bool) -> Result<(), ()>
Channel 3 (wave) reaches the left output.
Bits: 6..7
Sourcepub const fn with_ch4_left_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_ch4_left_checked(self, value: bool) -> Result<Self, ()>
Channel 4 (noise) reaches the left output.
Bits: 7..8
Sourcepub const fn with_ch4_left(self, value: bool) -> Self
pub const fn with_ch4_left(self, value: bool) -> Self
Channel 4 (noise) reaches the left output.
Bits: 7..8
Sourcepub const fn set_ch4_left(&mut self, value: bool)
pub const fn set_ch4_left(&mut self, value: bool)
Channel 4 (noise) reaches the left output.
Bits: 7..8