pub struct Infrared(/* private fields */);Available on crate feature
cgb only.Expand description
Infrared communications port (RP).
| Bit | Field | Access | Meaning |
|---|---|---|---|
| 7-6 | read_enable | R/W | Set both bits to read the receiver. |
| 5-2 | — | Unused. | |
| 1 | receiving | RO | Receiving an IR signal (reads 0 while a signal is seen). |
| 0 | led_on | R/W | Turn the IR LED on. |
Implementations§
Source§impl Infrared
impl Infrared
Sourcepub const fn with_led_on_checked(self, value: bool) -> Result<Self, ()>
pub const fn with_led_on_checked(self, value: bool) -> Result<Self, ()>
Turn the IR LED on.
Bits: 0..1
Sourcepub const fn with_led_on(self, value: bool) -> Self
pub const fn with_led_on(self, value: bool) -> Self
Turn the IR LED on.
Bits: 0..1
Sourcepub const fn set_led_on(&mut self, value: bool)
pub const fn set_led_on(&mut self, value: bool)
Turn the IR LED on.
Bits: 0..1
Sourcepub const fn set_led_on_checked(&mut self, value: bool) -> Result<(), ()>
pub const fn set_led_on_checked(&mut self, value: bool) -> Result<(), ()>
Turn the IR LED on.
Bits: 0..1
Sourcepub const fn receiving(&self) -> bool
pub const fn receiving(&self) -> bool
Receiving an IR signal (read-only; reads 0 while a signal is seen).
Bits: 1..2
Sourcepub const fn read_enable(&self) -> u8
pub const fn read_enable(&self) -> u8
Read enable: set both bits to read the receiver.
Bits: 6..8
Sourcepub const fn with_read_enable_checked(self, value: u8) -> Result<Self, ()>
pub const fn with_read_enable_checked(self, value: u8) -> Result<Self, ()>
Read enable: set both bits to read the receiver.
Bits: 6..8
Sourcepub const fn with_read_enable(self, value: u8) -> Self
pub const fn with_read_enable(self, value: u8) -> Self
Read enable: set both bits to read the receiver.
Bits: 6..8
Sourcepub const fn set_read_enable(&mut self, value: u8)
pub const fn set_read_enable(&mut self, value: u8)
Read enable: set both bits to read the receiver.
Bits: 6..8
Trait Implementations§
impl Copy for Infrared
impl Eq for Infrared
impl StructuralPartialEq for Infrared
Auto Trait Implementations§
impl BankSafe for Infrared
impl Freeze for Infrared
impl RefUnwindSafe for Infrared
impl Send for Infrared
impl Sync for Infrared
impl Unpin for Infrared
impl UnsafeUnpin for Infrared
impl UnwindSafe for Infrared
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