Microchip® Advanced Software Framework

ethernet_phy.c File Reference

API driver for DM9161A PHY component.

Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.

#include "ethernet_phy.h"
#include "emac.h"
#include "mii.h"

Macros

#define ETH_PHY_MAX_ADDR   31
 
#define ETH_PHY_RETRY_MAX   1000000
 
#define ETH_PHY_TIMEOUT   10
 

Functions

uint8_t ethernet_phy_auto_negotiate (Emac *p_emac, uint8_t uc_phy_addr)
 Issue an auto negotiation of the PHY. More...
 
static uint8_t ethernet_phy_find_valid (Emac *p_emac, uint8_t uc_phy_addr, uint8_t addrStart)
 Find a valid PHY Address ( from addrStart to 31 ). More...
 
uint8_t ethernet_phy_init (Emac *p_emac, uint8_t uc_phy_addr, uint32_t mck)
 Perform a HW initialization to the PHY ( via RSTC ) and set up clocks. More...
 
uint8_t ethernet_phy_reset (Emac *p_emac, uint8_t uc_phy_addr)
 Issue a SW reset to reset all registers of the PHY. More...
 
uint8_t ethernet_phy_set_link (Emac *p_emac, uint8_t uc_phy_addr, uint8_t uc_apply_setting_flag)
 Get the Link & speed settings, and automatically set up the EMAC with the settings. More...