AM261x MCU+ SDK: MDIO

| AM261x MCU+ SDK 26.00.00 |

MDIO

MDIO driver provides an interface to the MDIO management interface module which implements the 802.3 serial management interface to interrogate and control the Ethernet PHYs on the board.

# Features Supported

- Initialize MDIO clock
- Ethernet PHY register access (IEEE defined registers and extended registers)
- Read the link status of Ethernet PHY
- Enable link change Interrupt

# Features NOT Supported

NA

# Example Usage

Include the below file to access the APIs

#include <drivers/mdio.h>

Initializing MDIO clock

status = MDIO_initClock(mdioBaseAddress);
DebugP_assert(status == SystemP_SUCCESS);

Reading PHY link status for a PHY connected to MDIO

status = MDIO_phyLinkStatus(mdioBaseAddress, phyAddress);

Reading/writing a PHY register using MDIO

uint16_t phyRegVal;
/* Read a PHY register */
status = MDIO_phyRegRead(mdioBaseAddress, NULL, phyAddress, 0, &phyRegVal);
/* Write a PHY register */
status = MDIO_phyRegWrite(mdioBaseAddress, NULL, phyAddress, 0, phyRegVal);

# API

APIs for MDIO

MDIO_phyLinkStatus
int32_t MDIO_phyLinkStatus(uint32_t baseAddr, uint32_t phyAddr)
This API reads the link status of all PHY connected to this MDIO. The bit corresponding to the PHY ad...
MDIO_phyRegRead
int32_t MDIO_phyRegRead(uint32_t baseAddr, void *pUserGroup, uint32_t phyAddr, uint32_t regNum, uint16_t *pData)
This API reads an IEEE defined PHY register using MDIO. It should be called only after successful exe...
MDIO_initClock
int32_t MDIO_initClock(uint32_t baseAddr)
This function initializes the MDIO clock.
MDIO_phyRegWrite
int32_t MDIO_phyRegWrite(uint32_t baseAddr, void *pUserGroup, uint32_t phyAddr, uint32_t regNum, uint16_t wrVal)
This API writes an IEEE defined PHY register using MDIO. It should be called only after successful ex...
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
mdio.h
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:187