Support LAN8720 and DP83848 PHY models #463
                
     Merged
            
            
          
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Summary of changes
Fix #454 .
Support a range of models in a single Ethernet PHY driver.
Renamed LAN8742 driver LAN87XX to support both LAN8742 and LAN8720 in a single driver.
Added DP83848 PHY driver.
Added missing GPIO_InitStructure declarations in the EthInitPinmappings function for some STM32 boards.
Impact of changes
Migration actions required
If an application explicitly specified the EMAC PHY model with "nsapi.emac-phy-model": "LAN8742" in mbed_app.json5, it needs to be renamed LAN87XX.
Documentation
To use the LAN8720 or LAN8742 PHY, override the nsapi.emac-phy-model setting in mbed_app.json5, or just remove the nsapi.emac-phy-model and nsapi.emac-phy-mdio-address entries to use the default value:
To use the DP83848 PHY, override the nsapi.emac-phy-model setting in mbed_app.json5:
Pull request type
Test results
Tested with a simple TCP Ehco application on three boards:
STM32F746G-DISCOVERY with LAN8742
Custom STM32F407 board with LAN8720
Custom STM32F407 board with DP83848
The application running on the board acts as a TCP client. It connects to the server running on the PC, and sends some text to the server. The server sends back the same text after receiving it, and the client verifies whether it is the same as the sent text.