Go to the documentation of this file.
   31 #ifndef _IP101_DRIVER_H 
   32 #define _IP101_DRIVER_H 
   38 #ifndef IP101_PHY_ADDR 
   39    #define IP101_PHY_ADDR 1 
   40 #elif (IP101_PHY_ADDR < 0 || IP101_PHY_ADDR > 31) 
   41    #error IP101_PHY_ADDR parameter is not valid 
   45 #define IP101_BMCR                         0x00 
   46 #define IP101_BMSR                         0x01 
   47 #define IP101_PHYID1                       0x02 
   48 #define IP101_PHYID2                       0x03 
   49 #define IP101_ANAR                         0x04 
   50 #define IP101_ANLPAR                       0x05 
   51 #define IP101_ANER                         0x06 
   52 #define IP101_ANNPTR                       0x07 
   53 #define IP101_ANLPNPR                      0x08 
   54 #define IP101_MMDACR                       0x0D 
   55 #define IP101_MMDAADR                      0x0E 
   56 #define IP101_PHYSCR                       0x10 
   57 #define IP101_ICSR                         0x11 
   58 #define IP101_PHYSMR                       0x12 
   59 #define IP101_IOSCR                        0x1D 
   60 #define IP101_PHYMCSSR                     0x1E 
   63 #define IP101_PCS_CTRL1                    0x03, 0x00 
   64 #define IP101_PCS_STAT1                    0x03, 0x01 
   65 #define IP101_EEE_CAPABILITY               0x03, 0x14 
   66 #define IP101_EEE_WAKE_ERROR_COUNT         0x03, 0x16 
   67 #define IP101_EEE_ADV                      0x07, 0x3C 
   68 #define IP101_EEE_LP_ABILITY               0x07, 0x3D 
   71 #define IP101_BMCR_RESET                   0x8000 
   72 #define IP101_BMCR_LOOPBACK                0x4000 
   73 #define IP101_BMCR_SPEED_SEL               0x2000 
   74 #define IP101_BMCR_AN_EN                   0x1000 
   75 #define IP101_BMCR_POWER_DOWN              0x0800 
   76 #define IP101_BMCR_ISOLATE                 0x0400 
   77 #define IP101_BMCR_RESTART_AN              0x0200 
   78 #define IP101_BMCR_DUPLEX_MODE             0x0100 
   79 #define IP101_BMCR_COL_TEST                0x0080 
   82 #define IP101_BMSR_100BT4                  0x8000 
   83 #define IP101_BMSR_100BTX_FD               0x4000 
   84 #define IP101_BMSR_100BTX_HD               0x2000 
   85 #define IP101_BMSR_10BT_FD                 0x1000 
   86 #define IP101_BMSR_10BT_HD                 0x0800 
   87 #define IP101_BMSR_MF_PREAMBLE_SUPPR       0x0040 
   88 #define IP101_BMSR_AN_COMPLETE             0x0020 
   89 #define IP101_BMSR_REMOTE_FAULT            0x0010 
   90 #define IP101_BMSR_AN_CAPABLE              0x0008 
   91 #define IP101_BMSR_LINK_STATUS             0x0004 
   92 #define IP101_BMSR_JABBER_DETECT           0x0002 
   93 #define IP101_BMSR_EXTENDED_CAPABLE        0x0001 
   96 #define IP101_PHYID1_PHY_ID_MSB            0xFFFF 
   97 #define IP101_PHYID1_PHY_ID_MSB_DEFAULT    0x0243 
  100 #define IP101_PHYID2__DEFAULT              0xC54 
  103 #define IP101_ANAR_NEXT_PAGE               0x8000 
  104 #define IP101_ANAR_REMOTE_FAULT            0x2000 
  105 #define IP101_ANAR_ASYM_PAUSE              0x0800 
  106 #define IP101_ANAR_PAUSE                   0x0400 
  107 #define IP101_ANAR_100BT4                  0x0200 
  108 #define IP101_ANAR_100BTX_FD               0x0100 
  109 #define IP101_ANAR_100BTX_HD               0x0080 
  110 #define IP101_ANAR_10BT_FD                 0x0040 
  111 #define IP101_ANAR_10BT_HD                 0x0020 
  112 #define IP101_ANAR_SELECTOR                0x001F 
  113 #define IP101_ANAR_SELECTOR_DEFAULT        0x0001 
  116 #define IP101_ANLPAR_NEXT_PAGE             0x8000 
  117 #define IP101_ANLPAR_ACK                   0x4000 
  118 #define IP101_ANLPAR_REMOTE_FAULT          0x2000 
  119 #define IP101_ANLPAR_ASYM_PAUSE            0x0800 
  120 #define IP101_ANLPAR_PAUSE                 0x0400 
  121 #define IP101_ANLPAR_100BT4                0x0200 
  122 #define IP101_ANLPAR_100BTX_FD             0x0100 
  123 #define IP101_ANLPAR_100BTX_HD             0x0080 
  124 #define IP101_ANLPAR_10BT_FD               0x0040 
  125 #define IP101_ANLPAR_10BT_HD               0x0020 
  126 #define IP101_ANLPAR_SELECTOR              0x001F 
  127 #define IP101_ANLPAR_SELECTOR_DEFAULT      0x0001 
  130 #define IP101_ANER_MLF                     0x0010 
  131 #define IP101_ANER_LP_NP_ABLE              0x0008 
  132 #define IP101_ANER_NP_ABLE                 0x0004 
  133 #define IP101_ANER_PAGE_RX                 0x0002 
  134 #define IP101_ANER_LP_AN_ABLE              0x0001 
  137 #define IP101_ANNPTR_NEXT_PAGE             0x8000 
  138 #define IP101_ANNPTR_MSG_PAGE              0x2000 
  139 #define IP101_ANNPTR_ACK2                  0x1000 
  140 #define IP101_ANNPTR_TOGGLE                0x0800 
  141 #define IP101_ANNPTR_MESSAGE               0x07FF 
  144 #define IP101_ANLPNPR_NEXT_PAGE            0x8000 
  145 #define IP101_ANLPNPR_ACK                  0x4000 
  146 #define IP101_ANLPNPR_MSG_PAGE             0x2000 
  147 #define IP101_ANLPNPR_ACK2                 0x1000 
  148 #define IP101_ANLPNPR_TOGGLE               0x0800 
  149 #define IP101_ANLPNPR_MESSAGE              0x07FF 
  152 #define IP101_MMDACR_FUNC                  0xC000 
  153 #define IP101_MMDACR_FUNC_ADDR             0x0000 
  154 #define IP101_MMDACR_FUNC_DATA_NO_POST_INC 0x4000 
  155 #define IP101_MMDACR_FUNC_DATA_POST_INC_RW 0x8000 
  156 #define IP101_MMDACR_FUNC_DATA_POST_INC_W  0xC000 
  157 #define IP101_MMDACR_DEVAD                 0x001F 
  160 #define IP101_PHYSCR_RMII_V10              0x2000 
  161 #define IP101_PHYSCR_RMII_V12              0x1000 
  162 #define IP101_PHYSCR_AUTO_MDIX_DIS         0x0800 
  163 #define IP101_PHYSCR_JABBER_EN             0x0200 
  164 #define IP101_PHYSCR_FEF_DIS               0x0100 
  165 #define IP101_PHYSCR_NWAY_PSAVE_DIS        0x0080 
  166 #define IP101_PHYSCR_BYPASS_DSP_RESET      0x0020 
  167 #define IP101_PHYSCR_REPEATER_MODE         0x0004 
  168 #define IP101_PHYSCR_LDPS_EN               0x0002 
  169 #define IP101_PHYSCR_ANALOG_OFF            0x0001 
  172 #define IP101_ICSR_INTR_EN                 0x8000 
  173 #define IP101_ICSR_ALL_MASK                0x0800 
  174 #define IP101_ICSR_SPEED_MASK              0x0400 
  175 #define IP101_ICSR_DUPLEX_MASK             0x0200 
  176 #define IP101_ICSR_LINK_MASK               0x0100 
  177 #define IP101_ICSR_INTR_STATUS             0x0008 
  178 #define IP101_ICSR_SPEED_CHANGE            0x0004 
  179 #define IP101_ICSR_DUPLEX_CHANGE           0x0002 
  180 #define IP101_ICSR_LINK_CHANGE             0x0001 
  183 #define IP101_PHYSMR_SPEED                 0x4000 
  184 #define IP101_PHYSMR_DUPLEX                0x2000 
  185 #define IP101_PHYSMR_AN_COMPLETE           0x0800 
  186 #define IP101_PHYSMR_LINK_UP               0x0400 
  187 #define IP101_PHYSMR_MDIX                  0x0200 
  188 #define IP101_PHYSMR_POLARITY              0x0100 
  189 #define IP101_PHYSMR_JABBER                0x0080 
  190 #define IP101_PHYSMR_AN_ARBIT_STATE        0x000F 
  193 #define IP101_IOSCR_RMII_WITH_ER           0x0080 
  194 #define IP101_IOSCR_SEL_INTR32             0x0004 
  197 #define IP101_PHYMCSSR_LINK_UP             0x0100 
  198 #define IP101_PHYMCSSR_FORCE_MDIX          0x0008 
  199 #define IP101_PHYMCSSR_OP_MODE             0x0007 
  200 #define IP101_PHYMCSSR_OP_MODE_LINK_OFF    0x0000 
  201 #define IP101_PHYMCSSR_OP_MODE_10M_HD      0x0001 
  202 #define IP101_PHYMCSSR_OP_MODE_100M_HD     0x0002 
  203 #define IP101_PHYMCSSR_OP_MODE_10M_FD      0x0005 
  204 #define IP101_PHYMCSSR_OP_MODE_100M_FD     0x0006 
  
const PhyDriver ip101PhyDriver
IP101 Ethernet PHY driver.
 
void ip101DumpPhyReg(NetInterface *interface)
Dump PHY registers for debugging purpose.
 
error_t ip101Init(NetInterface *interface)
IP101 PHY transceiver initialization.
 
void ip101EnableIrq(NetInterface *interface)
Enable interrupts.
 
void ip101Tick(NetInterface *interface)
IP101 timer handler.
 
void ip101WritePhyReg(NetInterface *interface, uint8_t address, uint16_t data)
Write PHY register.
 
uint16_t ip101ReadMmdReg(NetInterface *interface, uint8_t devAddr, uint16_t regAddr)
Read MMD register.
 
void ip101WriteMmdReg(NetInterface *interface, uint8_t devAddr, uint16_t regAddr, uint16_t data)
Write MMD register.
 
void ip101InitHook(NetInterface *interface)
IP101 custom configuration.
 
void ip101DisableIrq(NetInterface *interface)
Disable interrupts.
 
Network interface controller abstraction layer.
 
uint16_t ip101ReadPhyReg(NetInterface *interface, uint8_t address)
Read PHY register.
 
void ip101EventHandler(NetInterface *interface)
IP101 event handler.