libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
Loading...
Searching...
No Matches
mii.h
Go to the documentation of this file.
1
14/*
15 * This file is part of libethercat.
16 *
17 * libethercat is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 3 of the License, or (at your option) any later version.
21 *
22 * libethercat is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with libethercat (LICENSE.LGPL-V3); if not, write
29 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
30 * Floor, Boston, MA 02110-1301, USA.
31 *
32 * Please note that the use of the EtherCAT technology, the EtherCAT
33 * brand name and the EtherCAT logo is only permitted if the property
34 * rights of Beckhoff Automation GmbH are observed. For further
35 * information please contact Beckhoff Automation GmbH & Co. KG,
36 * Hülshorstweg 20, D-33415 Verl, Germany (www.beckhoff.com) or the
37 * EtherCAT Technology Group, Ostendstraße 196, D-90482 Nuremberg,
38 * Germany (ETG, www.ethercat.org).
39 *
40 */
41
42#ifndef LIBETHERCAT_MII_H
43#define LIBETHERCAT_MII_H
44
45#include <libosal/types.h>
46
47#include "libethercat/common.h"
48#include "libethercat/ec.h"
49
51
63int ec_miiread(struct ec *pec, osal_uint16_t slave,
64 osal_uint8_t phy_adr, osal_uint16_t phy_reg, osal_uint16_t *data);
65
66// Write 16-bit word via MII.
67/*
68 * \param[in] pec Pointer to EtherCAT master structure,
69 * which you got from \link ec_open \endlink.
70 * \param[in] slave Number of EtherCAT slave. this depends on
71 * the physical order of the EtherCAT slaves
72 * (usually the n'th slave attached).
73 * \param[in] phy_adr Address of PHY attached via MII.
74 * \param[in] phy_reg Register of PHY selected by \p phy_adr.
75 * \param[in] data Data contains 16-bit data value to write.
76 *
77 * \retval EC_OK On success
78 */
79int ec_miiwrite(struct ec *pec, osal_uint16_t slave,
80 osal_uint8_t phy_adr, osal_uint16_t phy_reg, osal_uint16_t *data);
81
82#endif // LIBETHERCAT_MII_H
83
ethercat master common stuff
ethercat master 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.
ethercat master structure
Definition ec.h:188