Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHY status API for ethernet drivers #8784

Merged
merged 8 commits into from
Jan 5, 2023
Merged

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Jan 3, 2023

Implementation of ::isLinked() for ethernet drivers:
This function returns true when the ethernet chip is physically connected.

(edited) It currently works and has been tested with W5500 and ENC28J60, and it seems it is not implementable with W5100.
An additional ::isLinkDetectable() tells when ::isLinked() is not trivially implemented.

(edited)::connected() is software only and is left unmodified for backward compatibility is updated to check link status to solve compatibility with WiFi API.

Closes #8099

@d-a-v
Copy link
Collaborator Author

d-a-v commented Jan 3, 2023

@JAndrassy Do you know if Link/PHY status can be read by software for W5100 and ENC28j60 ?

@JAndrassy
Copy link
Contributor

@d-a-v yes it is possible
https://github.com/JAndrassy/EthernetENC/blob/9428b5e970dbc9882ac2aeed94725a1dd87615b9/src/utility/Enc28J60Network.cpp#L629

PHY register 0x11 bit 10
1 = Link is up
0 = Link is down

@d-a-v
Copy link
Collaborator Author

d-a-v commented Jan 3, 2023

@JAndrassy Thanks !
I successfully used your code on my testboard.

It seems W5100 can't deliver link status readable by software ?
The Arduino driver does not provide it.
I can't seem to find the right register in the datasheet.

@mcspr
Copy link
Collaborator

mcspr commented Jan 4, 2023

@d-a-v
Copy link
Collaborator Author

d-a-v commented Jan 4, 2023

Yes, we do !

@d-a-v d-a-v merged commit 7cfb551 into esp8266:master Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LwipIntfDev::connected() does not reflect connection
3 participants