diff options
| author | Evan Lojewski <github@meklort.com> | 2019-02-16 11:44:21 -0700 |
|---|---|---|
| committer | Evan Lojewski <github@meklort.com> | 2019-02-16 11:44:21 -0700 |
| commit | b9093f6be74e4cb349c8245e5423a63d158fc3cd (patch) | |
| tree | 0d7a660f0351d2f34817bdc88515d5a8378c15f8 /libs/MII | |
| parent | 846634c9d1ab0412e943aaf74fe39136a4cbdf15 (diff) | |
| download | bcm5719-ortega-b9093f6be74e4cb349c8245e5423a63d158fc3cd.tar.gz bcm5719-ortega-b9093f6be74e4cb349c8245e5423a63d158fc3cd.zip | |
Update MII library to properly read/write registers.
Diffstat (limited to 'libs/MII')
| -rw-r--r-- | libs/MII/mii.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/MII/mii.c b/libs/MII/mii.c index eb8ae24..d675b6f 100644 --- a/libs/MII/mii.c +++ b/libs/MII/mii.c @@ -61,7 +61,9 @@ uint8_t MII_getPhy(void) uint16_t MII_readRegister(uint8_t phy, uint8_t reg) { RegDEVICEMiiCommunication_t regcontents; - regcontents.bits.Command = 2; // Read, FIXME + regcontents.r32 = 0; + regcontents.bits.Command = DEVICE_MII_COMMUNICATION_COMMAND_READ; + regcontents.bits.Start_DIV_Busy = 1; regcontents.bits.PHYAddress = phy; regcontents.bits.RegisterAddress = reg; @@ -80,7 +82,9 @@ uint16_t MII_readRegister(uint8_t phy, uint8_t reg) void MII_writeRegister(uint8_t phy, uint8_t reg, uint16_t data) { RegDEVICEMiiCommunication_t regcontents; - regcontents.bits.Command = 2; // Read, FIXME + regcontents.r32 = 0; + regcontents.bits.Command = DEVICE_MII_COMMUNICATION_COMMAND_WRITE; + regcontents.bits.Start_DIV_Busy = 1; regcontents.bits.PHYAddress = phy; regcontents.bits.RegisterAddress = reg; regcontents.bits.TransactionData = data; |

