Add method to read PHY configuration.

This commit is contained in:
Alex M 2020-08-11 17:25:05 -07:00 committed by Jonah Dahlquist
commit 79dc9a4fee
2 changed files with 126 additions and 4 deletions

View file

@ -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()
}