Trait spectrusty_core::bus::PortAddress
source · pub trait PortAddress: Debug {
const ADDRESS_MASK: u16;
const ADDRESS_BITS: u16;
fn match_port(address: u16) -> bool { ... }
}
Expand description
A helper trait for matching I/O port addresses.
Required Associated Constants§
sourceconst ADDRESS_MASK: u16
const ADDRESS_MASK: u16
Relevant address bits should be set to 1.
sourceconst ADDRESS_BITS: u16
const ADDRESS_BITS: u16
Bits from this constant will be matching only if ADDRESS_MASK
constains 1 for bits in the same positions.
Provided Methods§
sourcefn match_port(address: u16) -> bool
fn match_port(address: u16) -> bool
Returns true
if a provided address
masked with ADDRESS_MASK
matches ADDRESS_BITS
.