Webserver+3d print

Dependents:   Nucleo

Committer:
Sergunb
Date:
Sat Feb 04 18:15:49 2017 +0000
Revision:
0:8918a71cdbe9
nothing else

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Sergunb 0:8918a71cdbe9 1 /**
Sergunb 0:8918a71cdbe9 2 * @file rtl8211.h
Sergunb 0:8918a71cdbe9 3 * @brief RTL8211 Ethernet PHY transceiver
Sergunb 0:8918a71cdbe9 4 *
Sergunb 0:8918a71cdbe9 5 * @section License
Sergunb 0:8918a71cdbe9 6 *
Sergunb 0:8918a71cdbe9 7 * Copyright (C) 2010-2017 Oryx Embedded SARL. All rights reserved.
Sergunb 0:8918a71cdbe9 8 *
Sergunb 0:8918a71cdbe9 9 * This file is part of CycloneTCP Open.
Sergunb 0:8918a71cdbe9 10 *
Sergunb 0:8918a71cdbe9 11 * This program is free software; you can redistribute it and/or
Sergunb 0:8918a71cdbe9 12 * modify it under the terms of the GNU General Public License
Sergunb 0:8918a71cdbe9 13 * as published by the Free Software Foundation; either version 2
Sergunb 0:8918a71cdbe9 14 * of the License, or (at your option) any later version.
Sergunb 0:8918a71cdbe9 15 *
Sergunb 0:8918a71cdbe9 16 * This program is distributed in the hope that it will be useful,
Sergunb 0:8918a71cdbe9 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Sergunb 0:8918a71cdbe9 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Sergunb 0:8918a71cdbe9 19 * GNU General Public License for more details.
Sergunb 0:8918a71cdbe9 20 *
Sergunb 0:8918a71cdbe9 21 * You should have received a copy of the GNU General Public License
Sergunb 0:8918a71cdbe9 22 * along with this program; if not, write to the Free Software Foundation,
Sergunb 0:8918a71cdbe9 23 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Sergunb 0:8918a71cdbe9 24 *
Sergunb 0:8918a71cdbe9 25 * @author Oryx Embedded SARL (www.oryx-embedded.com)
Sergunb 0:8918a71cdbe9 26 * @version 1.7.6
Sergunb 0:8918a71cdbe9 27 **/
Sergunb 0:8918a71cdbe9 28
Sergunb 0:8918a71cdbe9 29 #ifndef _RTL8211_H
Sergunb 0:8918a71cdbe9 30 #define _RTL8211_H
Sergunb 0:8918a71cdbe9 31
Sergunb 0:8918a71cdbe9 32 //Dependencies
Sergunb 0:8918a71cdbe9 33 #include "core/nic.h"
Sergunb 0:8918a71cdbe9 34
Sergunb 0:8918a71cdbe9 35 //PHY address
Sergunb 0:8918a71cdbe9 36 #ifndef RTL8211_PHY_ADDR
Sergunb 0:8918a71cdbe9 37 #define RTL8211_PHY_ADDR 1
Sergunb 0:8918a71cdbe9 38 #elif (RTL8211_PHY_ADDR < 0 || RTL8211_PHY_ADDR > 31)
Sergunb 0:8918a71cdbe9 39 #error RTL8211_PHY_ADDR parameter is not valid
Sergunb 0:8918a71cdbe9 40 #endif
Sergunb 0:8918a71cdbe9 41
Sergunb 0:8918a71cdbe9 42 //RTL8211 registers
Sergunb 0:8918a71cdbe9 43 #define RTL8211_PHY_REG_BMCR 0x00
Sergunb 0:8918a71cdbe9 44 #define RTL8211_PHY_REG_BMSR 0x01
Sergunb 0:8918a71cdbe9 45 #define RTL8211_PHY_REG_PHYIDR1 0x02
Sergunb 0:8918a71cdbe9 46 #define RTL8211_PHY_REG_PHYIDR2 0x03
Sergunb 0:8918a71cdbe9 47 #define RTL8211_PHY_REG_ANAR 0x04
Sergunb 0:8918a71cdbe9 48 #define RTL8211_PHY_REG_ANLPAR 0x05
Sergunb 0:8918a71cdbe9 49 #define RTL8211_PHY_REG_ANER 0x06
Sergunb 0:8918a71cdbe9 50 #define RTL8211_PHY_REG_ANNPRR 0x07
Sergunb 0:8918a71cdbe9 51 #define RTL8211_PHY_REG_LPNPAR 0x08
Sergunb 0:8918a71cdbe9 52 #define RTL8211_PHY_REG_GBCR 0x09
Sergunb 0:8918a71cdbe9 53 #define RTL8211_PHY_REG_GBSR 0x0A
Sergunb 0:8918a71cdbe9 54 #define RTL8211_PHY_REG_MACR 0x0D
Sergunb 0:8918a71cdbe9 55 #define RTL8211_PHY_REG_MAADR 0x0E
Sergunb 0:8918a71cdbe9 56 #define RTL8211_PHY_REG_GBESR 0x0F
Sergunb 0:8918a71cdbe9 57 #define RTL8211_PHY_REG_PHYCR 0x10
Sergunb 0:8918a71cdbe9 58 #define RTL8211_PHY_REG_PHYSR 0x11
Sergunb 0:8918a71cdbe9 59 #define RTL8211_PHY_REG_INER 0x12
Sergunb 0:8918a71cdbe9 60 #define RTL8211_PHY_REG_INSR 0x13
Sergunb 0:8918a71cdbe9 61 #define RTL8211_PHY_REG_RXERC 0x18
Sergunb 0:8918a71cdbe9 62 #define RTL8211_PHY_REG_LDPSR 0x1B
Sergunb 0:8918a71cdbe9 63 #define RTL8211_PHY_REG_EPAGSR 0x1E
Sergunb 0:8918a71cdbe9 64 #define RTL8211_PHY_REG_PAGSEL 0x1F
Sergunb 0:8918a71cdbe9 65
Sergunb 0:8918a71cdbe9 66 //BMCR register
Sergunb 0:8918a71cdbe9 67 #define BMCR_RESET (1 << 15)
Sergunb 0:8918a71cdbe9 68 #define BMCR_LOOPBACK (1 << 14)
Sergunb 0:8918a71cdbe9 69 #define BMCR_SPEED_SEL (1 << 13)
Sergunb 0:8918a71cdbe9 70 #define BMCR_AN_EN (1 << 12)
Sergunb 0:8918a71cdbe9 71 #define BMCR_POWER_DOWN (1 << 11)
Sergunb 0:8918a71cdbe9 72 #define BMCR_ISOLATE (1 << 10)
Sergunb 0:8918a71cdbe9 73 #define BMCR_RESTART_AN (1 << 9)
Sergunb 0:8918a71cdbe9 74 #define BMCR_DUPLEX_MODE (1 << 8)
Sergunb 0:8918a71cdbe9 75 #define BMCR_COL_TEST (1 << 7)
Sergunb 0:8918a71cdbe9 76
Sergunb 0:8918a71cdbe9 77 //BMSR register
Sergunb 0:8918a71cdbe9 78 #define BMSR_100BT4 (1 << 15)
Sergunb 0:8918a71cdbe9 79 #define BMSR_100BTX_FD (1 << 14)
Sergunb 0:8918a71cdbe9 80 #define BMSR_100BTX (1 << 13)
Sergunb 0:8918a71cdbe9 81 #define BMSR_10BT_FD (1 << 12)
Sergunb 0:8918a71cdbe9 82 #define BMSR_10BT (1 << 11)
Sergunb 0:8918a71cdbe9 83 #define BMSR_NO_PREAMBLE (1 << 6)
Sergunb 0:8918a71cdbe9 84 #define BMSR_AN_COMPLETE (1 << 5)
Sergunb 0:8918a71cdbe9 85 #define BMSR_REMOTE_FAULT (1 << 4)
Sergunb 0:8918a71cdbe9 86 #define BMSR_AN_ABLE (1 << 3)
Sergunb 0:8918a71cdbe9 87 #define BMSR_LINK_STATUS (1 << 2)
Sergunb 0:8918a71cdbe9 88 #define BMSR_JABBER_DETECT (1 << 1)
Sergunb 0:8918a71cdbe9 89 #define BMSR_EXTENDED_CAP (1 << 0)
Sergunb 0:8918a71cdbe9 90
Sergunb 0:8918a71cdbe9 91 //ANAR register
Sergunb 0:8918a71cdbe9 92 #define ANAR_NEXT_PAGE (1 << 15)
Sergunb 0:8918a71cdbe9 93 #define ANAR_REMOTE_FAULT (1 << 13)
Sergunb 0:8918a71cdbe9 94 #define ANAR_PAUSE1 (1 << 11)
Sergunb 0:8918a71cdbe9 95 #define ANAR_PAUSE0 (1 << 10)
Sergunb 0:8918a71cdbe9 96 #define ANAR_100BT4 (1 << 9)
Sergunb 0:8918a71cdbe9 97 #define ANAR_100BTX_FD (1 << 8)
Sergunb 0:8918a71cdbe9 98 #define ANAR_100BTX (1 << 7)
Sergunb 0:8918a71cdbe9 99 #define ANAR_10BT_FD (1 << 6)
Sergunb 0:8918a71cdbe9 100 #define ANAR_10BT (1 << 5)
Sergunb 0:8918a71cdbe9 101 #define ANAR_SELECTOR4 (1 << 4)
Sergunb 0:8918a71cdbe9 102 #define ANAR_SELECTOR3 (1 << 3)
Sergunb 0:8918a71cdbe9 103 #define ANAR_SELECTOR2 (1 << 2)
Sergunb 0:8918a71cdbe9 104 #define ANAR_SELECTOR1 (1 << 1)
Sergunb 0:8918a71cdbe9 105 #define ANAR_SELECTOR0 (1 << 0)
Sergunb 0:8918a71cdbe9 106
Sergunb 0:8918a71cdbe9 107 //ANLPAR register
Sergunb 0:8918a71cdbe9 108 #define ANLPAR_NEXT_PAGE (1 << 15)
Sergunb 0:8918a71cdbe9 109 #define ANLPAR_LP_ACK (1 << 14)
Sergunb 0:8918a71cdbe9 110 #define ANLPAR_REMOTE_FAULT (1 << 13)
Sergunb 0:8918a71cdbe9 111 #define ANLPAR_PAUSE1 (1 << 11)
Sergunb 0:8918a71cdbe9 112 #define ANLPAR_PAUSE0 (1 << 10)
Sergunb 0:8918a71cdbe9 113 #define ANLPAR_100BT4 (1 << 9)
Sergunb 0:8918a71cdbe9 114 #define ANLPAR_100BTX_FD (1 << 8)
Sergunb 0:8918a71cdbe9 115 #define ANLPAR_100BTX (1 << 7)
Sergunb 0:8918a71cdbe9 116 #define ANLPAR_10BT_FD (1 << 6)
Sergunb 0:8918a71cdbe9 117 #define ANLPAR_10BT (1 << 5)
Sergunb 0:8918a71cdbe9 118 #define ANLPAR_SELECTOR4 (1 << 4)
Sergunb 0:8918a71cdbe9 119 #define ANLPAR_SELECTOR3 (1 << 3)
Sergunb 0:8918a71cdbe9 120 #define ANLPAR_SELECTOR2 (1 << 2)
Sergunb 0:8918a71cdbe9 121 #define ANLPAR_SELECTOR1 (1 << 1)
Sergunb 0:8918a71cdbe9 122 #define ANLPAR_SELECTOR0 (1 << 0)
Sergunb 0:8918a71cdbe9 123
Sergunb 0:8918a71cdbe9 124 //ANER register
Sergunb 0:8918a71cdbe9 125 #define ANER_PAR_DET_FAULT (1 << 4)
Sergunb 0:8918a71cdbe9 126 #define ANER_LP_NEXT_PAGE_ABLE (1 << 3)
Sergunb 0:8918a71cdbe9 127 #define ANER_NEXT_PAGE_ABLE (1 << 2)
Sergunb 0:8918a71cdbe9 128 #define ANER_PAGE_RECEIVED (1 << 1)
Sergunb 0:8918a71cdbe9 129 #define ANER_LP_AN_ABLE (1 << 0)
Sergunb 0:8918a71cdbe9 130
Sergunb 0:8918a71cdbe9 131 //ANNPTR register
Sergunb 0:8918a71cdbe9 132 #define ANNPTR_NEXT_PAGE (1 << 15)
Sergunb 0:8918a71cdbe9 133 #define ANNPTR_MSG_PAGE (1 << 13)
Sergunb 0:8918a71cdbe9 134 #define ANNPTR_ACK2 (1 << 12)
Sergunb 0:8918a71cdbe9 135 #define ANNPTR_TOGGLE (1 << 11)
Sergunb 0:8918a71cdbe9 136 #define ANNPTR_MESSAGE10 (1 << 10)
Sergunb 0:8918a71cdbe9 137 #define ANNPTR_MESSAGE9 (1 << 9)
Sergunb 0:8918a71cdbe9 138 #define ANNPTR_MESSAGE8 (1 << 8)
Sergunb 0:8918a71cdbe9 139 #define ANNPTR_MESSAGE7 (1 << 7)
Sergunb 0:8918a71cdbe9 140 #define ANNPTR_MESSAGE6 (1 << 6)
Sergunb 0:8918a71cdbe9 141 #define ANNPTR_MESSAGE5 (1 << 5)
Sergunb 0:8918a71cdbe9 142 #define ANNPTR_MESSAGE4 (1 << 4)
Sergunb 0:8918a71cdbe9 143 #define ANNPTR_MESSAGE3 (1 << 3)
Sergunb 0:8918a71cdbe9 144 #define ANNPTR_MESSAGE2 (1 << 2)
Sergunb 0:8918a71cdbe9 145 #define ANNPTR_MESSAGE1 (1 << 1)
Sergunb 0:8918a71cdbe9 146 #define ANNPTR_MESSAGE0 (1 << 0)
Sergunb 0:8918a71cdbe9 147
Sergunb 0:8918a71cdbe9 148 //ANNPRR register
Sergunb 0:8918a71cdbe9 149 #define ANNPRR_NEXT_PAGE (1 << 15)
Sergunb 0:8918a71cdbe9 150 #define ANNPRR_ACK (1 << 14)
Sergunb 0:8918a71cdbe9 151 #define ANNPRR_MSG_PAGE (1 << 13)
Sergunb 0:8918a71cdbe9 152 #define ANNPRR_ACK2 (1 << 12)
Sergunb 0:8918a71cdbe9 153 #define ANNPRR_TOGGLE (1 << 11)
Sergunb 0:8918a71cdbe9 154 #define ANNPRR_MESSAGE10 (1 << 10)
Sergunb 0:8918a71cdbe9 155 #define ANNPRR_MESSAGE9 (1 << 9)
Sergunb 0:8918a71cdbe9 156 #define ANNPRR_MESSAGE8 (1 << 8)
Sergunb 0:8918a71cdbe9 157 #define ANNPRR_MESSAGE7 (1 << 7)
Sergunb 0:8918a71cdbe9 158 #define ANNPRR_MESSAGE6 (1 << 6)
Sergunb 0:8918a71cdbe9 159 #define ANNPRR_MESSAGE5 (1 << 5)
Sergunb 0:8918a71cdbe9 160 #define ANNPRR_MESSAGE4 (1 << 4)
Sergunb 0:8918a71cdbe9 161 #define ANNPRR_MESSAGE3 (1 << 3)
Sergunb 0:8918a71cdbe9 162 #define ANNPRR_MESSAGE2 (1 << 2)
Sergunb 0:8918a71cdbe9 163 #define ANNPRR_MESSAGE1 (1 << 1)
Sergunb 0:8918a71cdbe9 164 #define ANNPRR_MESSAGE0 (1 << 0)
Sergunb 0:8918a71cdbe9 165
Sergunb 0:8918a71cdbe9 166 //GBCR register
Sergunb 0:8918a71cdbe9 167 #define GBCR_TEST_MODE2 (1 << 15)
Sergunb 0:8918a71cdbe9 168 #define GBCR_TEST_MODE1 (1 << 14)
Sergunb 0:8918a71cdbe9 169 #define GBCR_TEST_MODE0 (1 << 13)
Sergunb 0:8918a71cdbe9 170 #define GBCR_MS_MAN_CONF_EN (1 << 12)
Sergunb 0:8918a71cdbe9 171 #define GBCR_MS_MAN_CONF_VAL (1 << 11)
Sergunb 0:8918a71cdbe9 172 #define GBCR_PORT_TYPE (1 << 10)
Sergunb 0:8918a71cdbe9 173 #define GBCR_1000BT_FD (1 << 9)
Sergunb 0:8918a71cdbe9 174 #define GBCR_1000BT_HD (1 << 8)
Sergunb 0:8918a71cdbe9 175
Sergunb 0:8918a71cdbe9 176 //GBSR register
Sergunb 0:8918a71cdbe9 177 #define GBSR_MS_CONF_FAULT (1 << 15)
Sergunb 0:8918a71cdbe9 178 #define GBSR_MS_CONF_RES (1 << 14)
Sergunb 0:8918a71cdbe9 179 #define GBSR_LOC_REC_STATUS (1 << 13)
Sergunb 0:8918a71cdbe9 180 #define GBSR_REM_REC_STATUS (1 << 12)
Sergunb 0:8918a71cdbe9 181 #define GBSR_LP_1000BT_FD (1 << 11)
Sergunb 0:8918a71cdbe9 182 #define GBSR_LP_1000BT_HD (1 << 10)
Sergunb 0:8918a71cdbe9 183 #define GBSR_IDLE_ERR_CTR7 (1 << 7)
Sergunb 0:8918a71cdbe9 184 #define GBSR_IDLE_ERR_CTR6 (1 << 6)
Sergunb 0:8918a71cdbe9 185 #define GBSR_IDLE_ERR_CTR5 (1 << 5)
Sergunb 0:8918a71cdbe9 186 #define GBSR_IDLE_ERR_CTR4 (1 << 4)
Sergunb 0:8918a71cdbe9 187 #define GBSR_IDLE_ERR_CTR3 (1 << 3)
Sergunb 0:8918a71cdbe9 188 #define GBSR_IDLE_ERR_CTR2 (1 << 2)
Sergunb 0:8918a71cdbe9 189 #define GBSR_IDLE_ERR_CTR1 (1 << 1)
Sergunb 0:8918a71cdbe9 190 #define GBSR_IDLE_ERR_CTR0 (1 << 0)
Sergunb 0:8918a71cdbe9 191
Sergunb 0:8918a71cdbe9 192 //MACR register
Sergunb 0:8918a71cdbe9 193 #define MACR_FUNCTION1 (1 << 15)
Sergunb 0:8918a71cdbe9 194 #define MACR_FUNCTION0 (1 << 14)
Sergunb 0:8918a71cdbe9 195 #define MACR_DEVAD4 (1 << 4)
Sergunb 0:8918a71cdbe9 196 #define MACR_DEVAD3 (1 << 3)
Sergunb 0:8918a71cdbe9 197 #define MACR_DEVAD2 (1 << 2)
Sergunb 0:8918a71cdbe9 198 #define MACR_DEVAD1 (1 << 1)
Sergunb 0:8918a71cdbe9 199 #define MACR_DEVAD0 (1 << 0)
Sergunb 0:8918a71cdbe9 200
Sergunb 0:8918a71cdbe9 201 //GBESR register
Sergunb 0:8918a71cdbe9 202 #define GBESR_1000BX_FD (1 << 15)
Sergunb 0:8918a71cdbe9 203 #define GBESR_1000BX_HD (1 << 14)
Sergunb 0:8918a71cdbe9 204 #define GBESR_1000BT_FD (1 << 13)
Sergunb 0:8918a71cdbe9 205 #define GBESR_1000BT_HD (1 << 12)
Sergunb 0:8918a71cdbe9 206
Sergunb 0:8918a71cdbe9 207 //PHYCR register
Sergunb 0:8918a71cdbe9 208 #define PHYCR_DISABLE_RXC (1 << 15)
Sergunb 0:8918a71cdbe9 209 #define PHYCR_FPR_FAIL_SEL2 (1 << 14)
Sergunb 0:8918a71cdbe9 210 #define PHYCR_FPR_FAIL_SEL1 (1 << 13)
Sergunb 0:8918a71cdbe9 211 #define PHYCR_FPR_FAIL_SEL0 (1 << 12)
Sergunb 0:8918a71cdbe9 212 #define PHYCR_ASSERT_CRS_ON_TX (1 << 11)
Sergunb 0:8918a71cdbe9 213 #define PHYCR_FORCE_LINK_GOOD (1 << 10)
Sergunb 0:8918a71cdbe9 214 #define PHYCR_ENABLE_CROSSOVER (1 << 6)
Sergunb 0:8918a71cdbe9 215 #define PHYCR_MDI_MODE (1 << 5)
Sergunb 0:8918a71cdbe9 216 #define PHYCR_DISABLE CLK125 (1 << 4)
Sergunb 0:8918a71cdbe9 217 #define PHYCR_DISABLE_JABBER (1 << 0)
Sergunb 0:8918a71cdbe9 218
Sergunb 0:8918a71cdbe9 219 //PHYSR register
Sergunb 0:8918a71cdbe9 220 #define PHYSR_SPEED1 (1 << 15)
Sergunb 0:8918a71cdbe9 221 #define PHYSR_SPEED0 (1 << 14)
Sergunb 0:8918a71cdbe9 222 #define PHYSR_DUPLEX (1 << 13)
Sergunb 0:8918a71cdbe9 223 #define PHYSR_PAGE_RECEIVED (1 << 12)
Sergunb 0:8918a71cdbe9 224 #define PHYSR_SPEED_DUPLEX_RESOLVED (1 << 11)
Sergunb 0:8918a71cdbe9 225 #define PHYSR_LINK (1 << 10)
Sergunb 0:8918a71cdbe9 226 #define PHYSR_MDI_CROSSOVER_STATUS (1 << 6)
Sergunb 0:8918a71cdbe9 227 #define PHYSR_RE_LINK_OK (1 << 1)
Sergunb 0:8918a71cdbe9 228 #define PHYSR_JABBER (1 << 0)
Sergunb 0:8918a71cdbe9 229
Sergunb 0:8918a71cdbe9 230 //Speed
Sergunb 0:8918a71cdbe9 231 #define PHYSR_SPEED_MASK (3 << 14)
Sergunb 0:8918a71cdbe9 232 #define PHYSR_SPEED_10 (0 << 14)
Sergunb 0:8918a71cdbe9 233 #define PHYSR_SPEED_100 (1 << 14)
Sergunb 0:8918a71cdbe9 234 #define PHYSR_SPEED_1000 (2 << 14)
Sergunb 0:8918a71cdbe9 235
Sergunb 0:8918a71cdbe9 236 //INER register
Sergunb 0:8918a71cdbe9 237 #define INER_AN_ERROR (1 << 15)
Sergunb 0:8918a71cdbe9 238 #define INER_PAGE_RECEIVED (1 << 12)
Sergunb 0:8918a71cdbe9 239 #define INER_AN_COMPLETE (1 << 11)
Sergunb 0:8918a71cdbe9 240 #define INER_LINK_STATUS (1 << 10)
Sergunb 0:8918a71cdbe9 241 #define INER_SYMBOL_ERROR (1 << 9)
Sergunb 0:8918a71cdbe9 242 #define INER_FALSE_CARRIER (1 << 8)
Sergunb 0:8918a71cdbe9 243 #define INER_JABBER (1 << 0)
Sergunb 0:8918a71cdbe9 244
Sergunb 0:8918a71cdbe9 245 //INSR register
Sergunb 0:8918a71cdbe9 246 #define INSR_AN_ERROR (1 << 15)
Sergunb 0:8918a71cdbe9 247 #define INSR_PAGE_RECEIVED (1 << 12)
Sergunb 0:8918a71cdbe9 248 #define INSR_AN_COMPLETE (1 << 11)
Sergunb 0:8918a71cdbe9 249 #define INSR_LINK_STATUS (1 << 10)
Sergunb 0:8918a71cdbe9 250 #define INSR_SYMBOL_ERROR (1 << 9)
Sergunb 0:8918a71cdbe9 251 #define INSR_FALSE_CARRIER (1 << 8)
Sergunb 0:8918a71cdbe9 252 #define INSR_JABBER (1 << 0)
Sergunb 0:8918a71cdbe9 253
Sergunb 0:8918a71cdbe9 254 //LDPSR register
Sergunb 0:8918a71cdbe9 255 #define LDPSR_POWER_SAVE_MODE (1 << 0)
Sergunb 0:8918a71cdbe9 256
Sergunb 0:8918a71cdbe9 257 //EPAGSR register
Sergunb 0:8918a71cdbe9 258 #define EPAGSR_EXT_PAGE_SEL7 (1 << 7)
Sergunb 0:8918a71cdbe9 259 #define EPAGSR_EXT_PAGE_SEL6 (1 << 6)
Sergunb 0:8918a71cdbe9 260 #define EPAGSR_EXT_PAGE_SEL5 (1 << 5)
Sergunb 0:8918a71cdbe9 261 #define EPAGSR_EXT_PAGE_SEL4 (1 << 4)
Sergunb 0:8918a71cdbe9 262 #define EPAGSR_EXT_PAGE_SEL3 (1 << 3)
Sergunb 0:8918a71cdbe9 263 #define EPAGSR_EXT_PAGE_SEL2 (1 << 2)
Sergunb 0:8918a71cdbe9 264 #define EPAGSR_EXT_PAGE_SEL1 (1 << 1)
Sergunb 0:8918a71cdbe9 265 #define EPAGSR_EXT_PAGE_SEL0 (1 << 0)
Sergunb 0:8918a71cdbe9 266
Sergunb 0:8918a71cdbe9 267 //PAGSEL register
Sergunb 0:8918a71cdbe9 268 #define PAGSEL_PAGE_SEL2 (1 << 2)
Sergunb 0:8918a71cdbe9 269 #define PAGSEL_PAGE_SEL1 (1 << 1)
Sergunb 0:8918a71cdbe9 270 #define PAGSEL_PAGE_SEL0 (1 << 0)
Sergunb 0:8918a71cdbe9 271
Sergunb 0:8918a71cdbe9 272 //RTL8211 Ethernet PHY driver
Sergunb 0:8918a71cdbe9 273 extern const PhyDriver rtl8211PhyDriver;
Sergunb 0:8918a71cdbe9 274
Sergunb 0:8918a71cdbe9 275 //RTL8211 related functions
Sergunb 0:8918a71cdbe9 276 error_t rtl8211Init(NetInterface *interface);
Sergunb 0:8918a71cdbe9 277
Sergunb 0:8918a71cdbe9 278 void rtl8211Tick(NetInterface *interface);
Sergunb 0:8918a71cdbe9 279
Sergunb 0:8918a71cdbe9 280 void rtl8211EnableIrq(NetInterface *interface);
Sergunb 0:8918a71cdbe9 281 void rtl8211DisableIrq(NetInterface *interface);
Sergunb 0:8918a71cdbe9 282
Sergunb 0:8918a71cdbe9 283 void rtl8211EventHandler(NetInterface *interface);
Sergunb 0:8918a71cdbe9 284
Sergunb 0:8918a71cdbe9 285 void rtl8211WritePhyReg(NetInterface *interface, uint8_t address, uint16_t data);
Sergunb 0:8918a71cdbe9 286 uint16_t rtl8211ReadPhyReg(NetInterface *interface, uint8_t address);
Sergunb 0:8918a71cdbe9 287
Sergunb 0:8918a71cdbe9 288 void rtl8211DumpPhyReg(NetInterface *interface);
Sergunb 0:8918a71cdbe9 289
Sergunb 0:8918a71cdbe9 290 #endif
Sergunb 0:8918a71cdbe9 291