AM263Px MCU+ SDK: EnetPhy_Mdio Struct Reference

| AM263Px MCU+ SDK 26.00.00 |

Data Fields
EnetPhy_Mdio Struct Reference
APIs for Networking modules » APIs for Enet LLD » Ethernet PHY Driver

## Detailed Description

MDIO driver.

## Data Fields
int32_t(* | isAlive )(uint32_t phyAddr, bool *isAlive, Mdio_Obj *arg)
| Check if PHY is alive. More...
int32_t(* | isLinked )(uint32_t phyAddr, bool *isLinked, Mdio_Obj *arg)
| Check if PHY is linked. More...
int32_t(* | readC22 )(uint32_t group, uint32_t phyAddr, uint32_t reg, uint16_t *val, Mdio_Obj *arg)
| Read PHY register using Clause-22 frame. More...
int32_t(* | writeC22 )(uint32_t group, uint32_t phyAddr, uint32_t reg, uint16_t val, Mdio_Obj *arg)
| Write PHY register using Clause-22 frame. More...
int32_t(* | readC45 )(uint32_t group, uint32_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t *val, Mdio_Obj *arg)
| Read PHY register using Clause-45 frame. More...
int32_t(* | writeC45 )(uint32_t group, uint32_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t val, Mdio_Obj *arg)
| Write PHY register using Clause-45 frame. More...

## Field Documentation

## ◆ isAlive

int32_t(* EnetPhy_Mdio::isAlive) (uint32_t phyAddr, bool *isAlive, Mdio_Obj *arg)

Check if PHY is alive.

Checks if PHY is alive, either using an explicit register read or any other mechanism supported by the MDIO peripheral (i.e. background BMSR reads).

Parameters

  phyAddr | PHY device address
  isAlive | Whether PHY is alive or not
  args | Caller's arguments passed to the PHY driver at open time

Returns
  EnetPhy_ErrorCodes

## ◆ isLinked

int32_t(* EnetPhy_Mdio::isLinked) (uint32_t phyAddr, bool *isLinked, Mdio_Obj *arg)

Check if PHY is linked.

Checks if PHY is linked, either using an explicit register read or any other mechanism supported by the MDIO peripheral.

Parameters

  phyAddr | PHY device address
  isLinked | Whether PHY is linked or not
  args | Caller's arguments passed to the PHY driver at open time

Returns
  EnetPhy_ErrorCodes

## ◆ readC22

int32_t(* EnetPhy_Mdio::readC22) (uint32_t group, uint32_t phyAddr, uint32_t reg, uint16_t *val, Mdio_Obj *arg)

Read PHY register using Clause-22 frame.

Reads a PHY register using a Clause-22 frame.

Parameters

  group | User group (use 0 if single group is supported)
  phyAddr | PHY device address
  reg | Register address
  val | Value read from register
  args | Caller's arguments passed to the PHY driver at open time

Returns
  EnetPhy_ErrorCodes

## ◆ writeC22

int32_t(* EnetPhy_Mdio::writeC22) (uint32_t group, uint32_t phyAddr, uint32_t reg, uint16_t val, Mdio_Obj *arg)

Write PHY register using Clause-22 frame.

Writes a PHY register using a Clause-22 frame.

Parameters

  group | User group (use 0 if single group is supported)
  phyAddr | PHY device address
  reg | Register address
  val | Value to be written
  args | Caller's arguments passed to the PHY driver at open time

Returns
  EnetPhy_ErrorCodes

## ◆ readC45

int32_t(* EnetPhy_Mdio::readC45) (uint32_t group, uint32_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t *val, Mdio_Obj *arg)

Read PHY register using Clause-45 frame.

Reads a PHY register using a Clause-45 frame. Returns ENETPHY_ENOTSUPPORTED if MDIO doesn't support Clause-45 frames.

Parameters

  group | User group (use 0 if single group is supported)
  phyAddr | PHY device address
  reg | Register address
  val | Value read from register
  args | Caller's arguments passed to the PHY driver at open time

Returns
  EnetPhy_ErrorCodes

## ◆ writeC45

int32_t(* EnetPhy_Mdio::writeC45) (uint32_t group, uint32_t phyAddr, uint8_t mmd, uint16_t reg, uint16_t val, Mdio_Obj *arg)

Write PHY register using Clause-45 frame.

Writes a PHY register using a Clause-45 frame. Returns ENETPHY_ENOTSUPPORTED if MDIO doesn't support Clause-45 frames.

Parameters

  group | User group (use 0 if single group is supported)
  phyAddr | PHY device address
  reg | Register address
  val | Value to be written
  args | Caller's arguments passed to the PHY driver at open time

Returns
  EnetPhy_ErrorCodes