Skip to content

Commit e309f7d

Browse files
committed
Add helper method to get the PciAddress of a PciHeader
1 parent b3686d9 commit e309f7d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ impl PciHeader {
146146
PciHeader(address)
147147
}
148148

149+
pub fn address(&self) -> PciAddress {
150+
self.0
151+
}
152+
149153
pub fn id(&self, access: impl ConfigRegionAccess) -> (VendorId, DeviceId) {
150154
let id = unsafe { access.read(self.0, 0x00) };
151155
(id.get_bits(0..16) as VendorId, id.get_bits(16..32) as DeviceId)

0 commit comments

Comments
 (0)