diff options
Diffstat (limited to 'embassy-net-enc28j60/src/phy.rs')
| -rw-r--r-- | embassy-net-enc28j60/src/phy.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/embassy-net-enc28j60/src/phy.rs b/embassy-net-enc28j60/src/phy.rs new file mode 100644 index 000000000..7f62b5f27 --- /dev/null +++ b/embassy-net-enc28j60/src/phy.rs | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | #[allow(dead_code)] | ||
| 2 | #[derive(Clone, Copy)] | ||
| 3 | pub enum Register { | ||
| 4 | PHCON1 = 0x00, | ||
| 5 | PHSTAT1 = 0x01, | ||
| 6 | PHID1 = 0x02, | ||
| 7 | PHID2 = 0x03, | ||
| 8 | PHCON2 = 0x10, | ||
| 9 | PHSTAT2 = 0x11, | ||
| 10 | PHIE = 0x12, | ||
| 11 | PHIR = 0x13, | ||
| 12 | PHLCON = 0x14, | ||
| 13 | } | ||
| 14 | |||
| 15 | impl Register { | ||
| 16 | pub(crate) fn addr(&self) -> u8 { | ||
| 17 | *self as u8 | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | register!(PHCON2, 0, u16, { | ||
| 22 | #[doc = "PHY Half-Duplex Loopback Disable bit"] | ||
| 23 | hdldis @ 8, | ||
| 24 | #[doc = "Jabber Correction Disable bit"] | ||
| 25 | jabber @ 10, | ||
| 26 | #[doc = "Twisted-Pair Transmitter Disable bit"] | ||
| 27 | txdis @ 13, | ||
| 28 | #[doc = "PHY Force Linkup bit"] | ||
| 29 | frclnk @ 14, | ||
| 30 | }); | ||
| 31 | |||
| 32 | register!(PHSTAT2, 0, u16, { | ||
| 33 | // Datasheet says it's bit 10, but it's actually bit 2 ?!?! | ||
| 34 | #[doc = "Link Status bit"] | ||
| 35 | lstat @ 2, | ||
| 36 | }); | ||
