src/ENC28J60.c
static uint16_t phy_read(const struct enc28j60_dev *priv, uint8_t reg) {
    uint16_t result = 0;

    wcr(priv, ENC28J60_MIREGADR, reg);
    bfs(priv, ENC28J60_MICMD, _BV(MIIRD));    // starting read
    _delay_us(10.24);
    while (rcr(priv, ENC28J60_MISTAT) & _BV(BUSY)) {}
    bfc(priv, ENC28J60_MICMD, _BV(MIIRD));
    result = rcr(priv, ENC28J60_MIRDH) << 8;
    result |= rcr(priv, ENC28J60_MIRDL);

    return result;
}
/*!
 * @brief Reading PHY register
 * @param reg PHY Register Address
 * @return 16-bit data from \p reg
 */
@brief Reading PHY register
@param reg PHY Register Address
@return 16-bit data from \p reg
@brief Reading PHY register @param reg PHY Register Address @return 16 - bit data from \ p reg
static uint16_t phy_read(const struct enc28j60_dev *priv, uint8_t reg) {
    uint16_t result = 0;
    wcr(priv, ENC28J60_MIREGADR, reg);
    bfs(priv, ENC28J60_MICMD, _BV(MIIRD));    
    _delay_us(10.24);
    while (rcr(priv, ENC28J60_MISTAT) & _BV(BUSY)) {}
    bfc(priv, ENC28J60_MICMD, _BV(MIIRD));
    result = rcr(priv, ENC28J60_MIRDH) << 8;
    result |= rcr(priv, ENC28J60_MIRDL);
    return result;
}
static uint16_t phy_read ( const struct enc28j60_dev * priv , uint8_t reg ) { uint16_t result = 0 ; wcr ( priv , ENC28J60_MIREGADR , reg ) ; bfs ( priv , ENC28J60_MICMD , _BV ( MIIRD ) ) ; _delay_us ( 10.24 ) ; while ( rcr ( priv , ENC28J60_MISTAT ) & _BV ( BUSY ) ) { } bfc ( priv , ENC28J60_MICMD , _BV ( MIIRD ) ) ; result = rcr ( priv , ENC28J60_MIRDH ) << 8 ; result |= rcr ( priv , ENC28J60_MIRDL ) ; return result ; }
@brief Reading PHY register
 @param reg PHY Register Address
 @return 16-bit data from \p reg
@brief Reading PHY register @param reg PHY Register Address @return 16 - bit data from \ p reg
// starting read