src/ENC28J60.c
static uint8_t rcr(const struct enc28j60_dev *priv, uint8_t addr) {
    uint8_t result;

    change_memory_bank(priv, addr);
    
    chip_select(priv->spi_dev->cs);
    spi_write(ENC28J60_RCR_OP | (addr & ENC28J60_ADDR_MASK));
    if (addr & ENC28J60_DUMMY_MASK)  // dummy read
        spi_read_8();
    result = spi_read_8();
    chip_desel(priv->spi_dev->cs);

    return result;
}
/*!
 * @brief Read Control Register
 * @param addr Control Register Address
 * @param dummy If the address specifies one of the MAC or MII registers,
 * a dummy byte will first be shifted out on the SO pin.
 * @return 8-bit data from register
 */
@brief Read Control Register
@param addr Control Register Address
@param dummy If the address specifies one of the MAC or MII registers,
a dummy byte will first be shifted out on the SO pin.
@return 8-bit data from register
@brief Read Control Register @param addr Control Register Address @param dummy If the address specifies one of the MAC or MII registers a dummy byte will first be shifted out on the SO pin . @return 8 - bit data from register
static uint8_t rcr(const struct enc28j60_dev *priv, uint8_t addr) {
    uint8_t result;
    change_memory_bank(priv, addr);
    chip_select(priv->spi_dev->cs);
    spi_write(ENC28J60_RCR_OP | (addr & ENC28J60_ADDR_MASK));
    if (addr & ENC28J60_DUMMY_MASK)  
        spi_read_8();
    result = spi_read_8();
    chip_desel(priv->spi_dev->cs);
    return result;
}
static uint8_t rcr ( const struct enc28j60_dev * priv , uint8_t addr ) { uint8_t result ; change_memory_bank ( priv , addr ) ; chip_select ( priv -> spi_dev -> cs ) ; spi_write ( ENC28J60_RCR_OP | ( addr & ENC28J60_ADDR_MASK ) ) ; if ( addr & ENC28J60_DUMMY_MASK ) spi_read_8 ( ) ; result = spi_read_8 ( ) ; chip_desel ( priv -> spi_dev -> cs ) ; return result ; }
@brief Read Control Register
 @param addr Control Register Address
 @param dummy If the address specifies one of the MAC or MII registers,
 a dummy byte will first be shifted out on the SO pin.
@brief Read Control Register @param addr Control Register Address @param dummy If the address specifies one of the MAC or MII registers a dummy byte will first be shifted out on the SO pin .
// dummy read