The PHY chip is outside of SoC.
It has 15 IEEE specified standard registers. The EPHY driver implements those standard registers. It provides an API for PHY management abstraction layer.
The functions and other declarations used in this driver are in cy_ephy.h. You can include cy_pdl.h (ModusToolbox only) to get access to all functions and declarations in the PDL.
#define EMAC_MII 0
#define EMAC_RMII 1
#define EMAC_GMII 2
#define EMAC_RGMII 3
#define ETH_LINKSPEED_10 10
#define ETH_LINKSPEED_100 100
#define ETH_LINKSPEED_1000 1000
#define EMAC_INTERFACE EMAC_RGMII
#define EMAC_LINKSPEED ETH_LINKSPEED_1000
#define PHY_ADDR 0
#define ETH_REG_BASE ETH1
void snippet_Cy_EPHY_Read(uint32_t phyId, uint32_t regAddress, uint32_t *value)
{
}
void snippet_Cy_EPHY_Write(uint32_t phyId, uint32_t regAddress, uint32_t value)
{
}
static void snippet_Cy_EPHY_DP83867IR_Init_ExtendedReg(void)
{
#if EMAC_LINKSPEED == ETH_LINKSPEED_100
#elif EMAC_LINKSPEED == ETH_LINKSPEED_1000
uint32_t u32ReadData;
u32ReadData = u32ReadData & 0x0000;
u32ReadData = u32ReadData | 0x010C;
#else
#endif
#if EMAC_INTERFACE != EMAC_RGMII
#else
#endif
}
void snippet_Cy_EPHY_DP83867IR_Init(void)
{
Cy_EPHY_Init(&phyObj, snippet_Cy_EPHY_Read, snippet_Cy_EPHY_Write);
phyConfig.
speed = EMAC_LINKSPEED;
snippet_Cy_EPHY_DP83867IR_Init_ExtendedReg();
}
uint32_t duplex
suplex mode
Definition: cy_ephy.h:286
uint32_t speed
speed
Definition: cy_ephy.h:285
EPHY configuration.
Definition: cy_ephy.h:284
This is the private data structure of EPHY.
Definition: cy_ephy.h:273
@ CY_EPHY_DUPLEX_FULL
full duplex
Definition: cy_ephy.h:241
cy_en_ephy_status_t Cy_EPHY_Reset(cy_stc_ephy_t *phy)
Soft reset PHY by enabling 15th bit of BMCR register.
Definition: cy_ephy.c:124
cy_en_ephy_status_t Cy_EPHY_Configure(cy_stc_ephy_t *phy, cy_stc_ephy_config_t *config)
Configures PHY with user provided speed and duplex mode.
Definition: cy_ephy.c:176
cy_en_ephy_status_t Cy_EPHY_Init(cy_stc_ephy_t *phy, cy_ephy_read_handle fnRead, cy_ephy_write_handle fnWrite)
This function initializes the private structure and assign a PHY-read, PHY-write function handle to i...
Definition: cy_ephy.c:54
uint32_t Cy_ETHIF_PhyRegRead(ETH_Type *base, uint8_t u8RegNo, uint8_t u8PHYAddr)
Local function used by other APIs to read the PHY register.
Definition: cy_ethif.c:780
cy_en_ethif_status_t Cy_ETHIF_PhyRegWrite(ETH_Type *base, uint8_t u8RegNo, uint16_t u16Data, uint8_t u8PHYAddr)
Local function used by other APIs to write the PHY register.
Definition: cy_ethif.c:833
void Cy_SysLib_Delay(uint32_t milliseconds)
The function delays by the specified number of milliseconds.
Definition: cy_syslib.c:104
Refer to the technical reference manual (TRM) and the device datasheet.