Add method to read PHY configuration.
This commit is contained in:
parent
6caeeae2eb
commit
79dc9a4fee
2 changed files with 126 additions and 4 deletions
|
|
@ -62,6 +62,13 @@ impl<SpiBus: ActiveBus, NetworkImpl: Network> Device<SpiBus, NetworkImpl> {
|
|||
None
|
||||
}
|
||||
|
||||
pub fn phy_config(&mut self) -> Result<register::common::PhyConfig, SpiBus::Error> {
|
||||
let mut phy = [0u8];
|
||||
self.bus
|
||||
.read_frame(register::COMMON, register::common::PHY_CONFIG, &mut phy)?;
|
||||
Ok(phy[0].into())
|
||||
}
|
||||
|
||||
pub fn into_interface(self) -> Interface<SpiBus, NetworkImpl> {
|
||||
self.into()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue