libethercat - an embeddable realtime EtherCAT-master library
Communicate with EtherCAT slaves attached to a Network interface.
|
EtherCAT MII access fuctions. More...
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) |
EtherCAT MII access fuctions.
These functions are used to ensure access to the EtherCAT slaves MII.
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.
[in] | pec | Pointer to EtherCAT master structure, which you got from ec_open. |
[in] | slave | Number of EtherCAT slave. this depends on the physical order of the EtherCAT slaves (usually the n'th slave attached). |
[in] | phy_adr | Address of PHY attached via MII. |
[in] | phy_reg | Register of PHY selected by phy_adr . |
[out] | data | Returns read 16-bit data value. |
EC_O | On success |