libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
mii.h File Reference

EtherCAT MII access fuctions. More...

#include <libosal/types.h>
#include "libethercat/common.h"
#include "libethercat/ec.h"

Go to the source code of this file.

Functions

int ec_miiread (struct ec *pec, osal_uint16_t slave, osal_uint8_t phy_adr, osal_uint16_t phy_reg, osal_uint16_t *data)
 Read 16-bit word via MII.
 
int ec_miiwrite (struct ec *pec, osal_uint16_t slave, osal_uint8_t phy_adr, osal_uint16_t phy_reg, osal_uint16_t *data)
 

Detailed Description

EtherCAT MII access fuctions.

Author
Robert Burger rober.nosp@m.t.bu.nosp@m.rger@.nosp@m.dlr..nosp@m.de
Date
24 Nov 2016

These functions are used to ensure access to the EtherCAT slaves MII.

Function Documentation

◆ ec_miiread()

int ec_miiread ( struct ec pec,
osal_uint16_t  slave,
osal_uint8_t  phy_adr,
osal_uint16_t  phy_reg,
osal_uint16_t *  data 
)

Read 16-bit word via MII.

Parameters
[in]pecPointer to EtherCAT master structure, which you got from ec_open.
[in]slaveNumber of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached).
[in]phy_adrAddress of PHY attached via MII.
[in]phy_regRegister of PHY selected by phy_adr.
[out]dataReturns read 16-bit data value.
Return values
EC_OOn success