2.1.1 LAN867x PHY DRIVER

The PHY driver is located in the example folder, at firmware\src\config\default\driver\ethphy\src\dynamic.

It consists of two files, which are:

  • drv_extphy_lan867x.h
  • drv_extphy_lan867x.c

The files provide

  • the functions to configure the PHY on initial start-up,
  • address and bit-mapping for each register of the PHY and
  • APIs to access and modify PHY registers.

The following three methods are used to access and modify a register value of the PHY.

  • This method is used to write a value to the register.
    DRV_MIIM_RESULT LAN867x_Write_Register
    (LAN867X_REG_OBJ *clientObj, const uint32_t regAddr, uint16_t wData);
  • This method is used to read a value from the register.
    DRV_MIIM_RESULT LAN867x_Read_Register
    (LAN867X_REG_OBJ *clientObj, const uint32_t regAddr, uint16_t *rData);
  • This method is used to write a value to a register based on a bit mask.
    DRV_MIIM_RESULT LAN867x_Write_Bit_Register
    (LAN867X_REG_OBJ *clientObj, const uint32_t regAddr, uint16_t mask, uint16_t wData);