File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,30 @@ impl PciIoAddress {
3737 }
3838 }
3939
40+ /// Construct a new address with the bus address set to the given value
41+ #[ must_use]
42+ pub const fn with_bus ( & self , bus : u8 ) -> Self {
43+ let mut addr = * self ;
44+ addr. bus = bus;
45+ addr
46+ }
47+
48+ /// Construct a new address with the device address set to the given value
49+ #[ must_use]
50+ pub const fn with_device ( & self , dev : u8 ) -> Self {
51+ let mut addr = * self ;
52+ addr. dev = dev;
53+ addr
54+ }
55+
56+ /// Construct a new address with the function address set to the given value
57+ #[ must_use]
58+ pub const fn with_function ( & self , fun : u8 ) -> Self {
59+ let mut addr = * self ;
60+ addr. fun = fun;
61+ addr
62+ }
63+
4064 /// Configure the **byte**-offset of the register to access.
4165 #[ must_use]
4266 pub const fn with_register ( & self , reg : u8 ) -> Self {
You can’t perform that action at this time.
0 commit comments