upd60611_driver.h File Reference

uPD60611 Ethernet PHY driver More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define UPD60611_PHY_ADDR   0
 
#define UPD60611_BMCR   0x00
 
#define UPD60611_BMSR   0x01
 
#define UPD60611_PHYID1   0x02
 
#define UPD60611_PHYID2   0x03
 
#define UPD60611_ANAR   0x04
 
#define UPD60611_ANLPAR   0x05
 
#define UPD60611_ANER   0x06
 
#define UPD60611_ANNPTR   0x07
 
#define UPD60611_SRR   0x10
 
#define UPD60611_MCSR   0x11
 
#define UPD60611_SMR   0x12
 
#define UPD60611_EBSR   0x13
 
#define UPD60611_BER   0x17
 
#define UPD60611_FEQMR   0x18
 
#define UPD60611_DCSR   0x19
 
#define UPD60611_DCR   0x1A
 
#define UPD60611_SCSIR   0x1B
 
#define UPD60611_ISR   0x1D
 
#define UPD60611_IER   0x1E
 
#define UPD60611_PSCSR   0x1F
 
#define UPD60611_BMCR_RESET   0x8000
 
#define UPD60611_BMCR_LOOPBACK   0x4000
 
#define UPD60611_BMCR_SPEED_SEL   0x2000
 
#define UPD60611_BMCR_AN_EN   0x1000
 
#define UPD60611_BMCR_POWER_DOWN   0x0800
 
#define UPD60611_BMCR_ISOLATE   0x0400
 
#define UPD60611_BMCR_RESTART_AN   0x0200
 
#define UPD60611_BMCR_DUPLEX_MODE   0x0100
 
#define UPD60611_BMCR_COL_TEST   0x0080
 
#define UPD60611_BMSR_100BT4   0x8000
 
#define UPD60611_BMSR_100BTX_FD   0x4000
 
#define UPD60611_BMSR_100BTX_HD   0x2000
 
#define UPD60611_BMSR_10BT_FD   0x1000
 
#define UPD60611_BMSR_10BT_HD   0x0800
 
#define UPD60611_BMSR_AN_COMPLETE   0x0020
 
#define UPD60611_BMSR_REMOTE_FAULT   0x0010
 
#define UPD60611_BMSR_AN_CAPABLE   0x0008
 
#define UPD60611_BMSR_LINK_STATUS   0x0004
 
#define UPD60611_BMSR_JABBER_DETECT   0x0002
 
#define UPD60611_BMSR_EXTENDED_CAPABLE   0x0001
 
#define UPD60611_PHYID1_PHY_ID_NUM_MSB   0xFFFF
 
#define UPD60611_PHYID1_PHY_ID_NUM_MSB_DEFAULT   0xB824
 
#define UPD60611_PHYID2_PHY_ID_NUM_LSB   0xFC00
 
#define UPD60611_PHYID2_PHY_ID_NUM_LSB_DEFAULT   0x2800
 
#define UPD60611_PHYID2_MODEL_NUM   0x03F0
 
#define UPD60611_PHYID2_MODEL_NUM_DEFAULT   0x0010
 
#define UPD60611_PHYID2_REVISION_NUM   0x000F
 
#define UPD60611_ANAR_NEXT_PAGE   0x8000
 
#define UPD60611_ANAR_REMOTE_FAULT   0x2000
 
#define UPD60611_ANAR_PAUSE   0x0C00
 
#define UPD60611_ANAR_100BT4   0x0200
 
#define UPD60611_ANAR_100BTX_FD   0x0100
 
#define UPD60611_ANAR_100BTX_HD   0x0080
 
#define UPD60611_ANAR_10BT_FD   0x0040
 
#define UPD60611_ANAR_10BT_HD   0x0020
 
#define UPD60611_ANAR_SELECTOR   0x001F
 
#define UPD60611_ANAR_SELECTOR_DEFAULT   0x0001
 
#define UPD60611_ANLPAR_NEXT_PAGE   0x8000
 
#define UPD60611_ANLPAR_ACK   0x4000
 
#define UPD60611_ANLPAR_REMOTE_FAULT   0x2000
 
#define UPD60611_ANLPAR_PAUSE   0x0400
 
#define UPD60611_ANLPAR_100BT4   0x0200
 
#define UPD60611_ANLPAR_100BTX_FD   0x0100
 
#define UPD60611_ANLPAR_100BTX_HD   0x0080
 
#define UPD60611_ANLPAR_10BT_FD   0x0040
 
#define UPD60611_ANLPAR_10BT_HD   0x0020
 
#define UPD60611_ANLPAR_SELECTOR   0x001F
 
#define UPD60611_ANLPAR_SELECTOR_DEFAULT   0x0001
 
#define UPD60611_ANER_PAR_DETECT_FAULT   0x0010
 
#define UPD60611_ANER_LP_NEXT_PAGE_ABLE   0x0008
 
#define UPD60611_ANER_NEXT_PAGE_ABLE   0x0004
 
#define UPD60611_ANER_PAGE_RECEIVED   0x0002
 
#define UPD60611_ANER_LP_AN_ABLE   0x0001
 
#define UPD60611_ANNPTR_NEXT_PAGE   0x8000
 
#define UPD60611_ANNPTR_MSG_PAGE   0x2000
 
#define UPD60611_ANNPTR_ACK2   0x1000
 
#define UPD60611_ANNPTR_TOGGLE   0x0800
 
#define UPD60611_ANNPTR_MESSAGE   0x07FF
 
#define UPD60611_SRR_SILICON_REV   0x03C0
 
#define UPD60611_MCSR_EDPWRDOWN   0x2000
 
#define UPD60611_MCSR_FARLOOPBACK   0x0200
 
#define UPD60611_MCSR_FASTEST   0x0100
 
#define UPD60611_MCSR_AUTOMDIX_EN   0x0080
 
#define UPD60611_MCSR_MDI_MODE   0x0040
 
#define UPD60611_MCSR_FORCE_GOOD_LINK   0x0004
 
#define UPD60611_MCSR_ENERGYON   0x0002
 
#define UPD60611_SMR_FX_MODE   0x0400
 
#define UPD60611_SMR_PHY_MODE   0x01E0
 
#define UPD60611_SMR_PHY_ADD_DEV   0x0018
 
#define UPD60611_SMR_PHY_ADD_MOD   0x0007
 
#define UPD60611_EBSR_T_EL_BUF_OVF   0x0080
 
#define UPD60611_EBSR_T_EL_BUF_UDF   0x0040
 
#define UPD60611_EBSR_R_EL_BUF_OVF   0x0020
 
#define UPD60611_EBSR_R_EL_BUF_UDF   0x0010
 
#define UPD60611_BER_LNK_OK   0x8000
 
#define UPD60611_BER_CNT_LNK_EN   0x4000
 
#define UPD60611_BER_CNT_TRIG   0x3800
 
#define UPD60611_BER_WINDOW   0x0780
 
#define UPD60611_BER_COUNT   0x007F
 
#define UPD60611_DCSR_DIAG_INIT   0x4000
 
#define UPD60611_DCSR_ADC_MAX_VALUE   0x3F00
 
#define UPD60611_DCSR_DIAG_DONE   0x0080
 
#define UPD60611_DCSR_DIAG_POL   0x0040
 
#define UPD60611_DCSR_DIAG_SEL_LINE   0x0020
 
#define UPD60611_DCSR_PW_DIAG   0x001F
 
#define UPD60611_DCR_CNT_WINDOW   0xFF00
 
#define UPD60611_DCR_DIAGCNT   0x00FF
 
#define UPD60611_SCSIR_SWRST_FAST   0x1000
 
#define UPD60611_SCSIR_SQEOFF   0x0800
 
#define UPD60611_SCSIR_FEFIEN   0x0020
 
#define UPD60611_SCSIR_XPOL   0x0010
 
#define UPD60611_ISR_BER   0x0400
 
#define UPD60611_ISR_FEQ   0x0200
 
#define UPD60611_ISR_ENERGYON   0x0080
 
#define UPD60611_ISR_AN_COMPLETE   0x0040
 
#define UPD60611_ISR_REMOTE_FAULT   0x0020
 
#define UPD60611_ISR_LINK_DOWN   0x0010
 
#define UPD60611_ISR_AN_LP_ACK   0x0008
 
#define UPD60611_ISR_PAR_DETECT_FAULT   0x0004
 
#define UPD60611_ISR_AN_PAGE_RECEIVED   0x0002
 
#define UPD60611_IER_BER   0x0400
 
#define UPD60611_IER_FEQ   0x0200
 
#define UPD60611_IER_ENERGYON   0x0080
 
#define UPD60611_IER_AN_COMPLETE   0x0040
 
#define UPD60611_IER_REMOTE_FAULT   0x0020
 
#define UPD60611_IER_LINK_DOWN   0x0010
 
#define UPD60611_IER_AN_LP_ACK   0x0008
 
#define UPD60611_IER_PAR_DETECT_FAULT   0x0004
 
#define UPD60611_IER_AN_PAGE_RECEIVED   0x0002
 
#define UPD60611_PSCSR_AUTODONE   0x1000
 
#define UPD60611_PSCSR_4B5B_EN   0x0040
 
#define UPD60611_PSCSR_HCDSPEED   0x001C
 
#define UPD60611_PSCSR_HCDSPEED_10BT_HD   0x0004
 
#define UPD60611_PSCSR_HCDSPEED_100BTX_HD   0x0008
 
#define UPD60611_PSCSR_HCDSPEED_10BT_FD   0x0014
 
#define UPD60611_PSCSR_HCDSPEED_100BTX_FD   0x0018
 
#define UPD60611_PSCSR_RX_DV_J2T   0x0002
 
#define UPD60611_PSCSR_SCRAMBLE_DIS   0x0001
 

Functions

error_t upd60611Init (NetInterface *interface)
 uPD60611 PHY transceiver initialization More...
 
void upd60611InitHook (NetInterface *interface)
 uPD60611 custom configuration More...
 
void upd60611Tick (NetInterface *interface)
 uPD60611 timer handler More...
 
void upd60611EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void upd60611DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void upd60611EventHandler (NetInterface *interface)
 uPD60611 event handler More...
 
void upd60611WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t upd60611ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void upd60611DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const PhyDriver upd60611PhyDriver
 uPD60611 Ethernet PHY driver More...
 

Detailed Description

uPD60611 Ethernet PHY driver

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file upd60611_driver.h.

Macro Definition Documentation

◆ UPD60611_ANAR

#define UPD60611_ANAR   0x04

Definition at line 49 of file upd60611_driver.h.

◆ UPD60611_ANAR_100BT4

#define UPD60611_ANAR_100BT4   0x0200

Definition at line 105 of file upd60611_driver.h.

◆ UPD60611_ANAR_100BTX_FD

#define UPD60611_ANAR_100BTX_FD   0x0100

Definition at line 106 of file upd60611_driver.h.

◆ UPD60611_ANAR_100BTX_HD

#define UPD60611_ANAR_100BTX_HD   0x0080

Definition at line 107 of file upd60611_driver.h.

◆ UPD60611_ANAR_10BT_FD

#define UPD60611_ANAR_10BT_FD   0x0040

Definition at line 108 of file upd60611_driver.h.

◆ UPD60611_ANAR_10BT_HD

#define UPD60611_ANAR_10BT_HD   0x0020

Definition at line 109 of file upd60611_driver.h.

◆ UPD60611_ANAR_NEXT_PAGE

#define UPD60611_ANAR_NEXT_PAGE   0x8000

Definition at line 102 of file upd60611_driver.h.

◆ UPD60611_ANAR_PAUSE

#define UPD60611_ANAR_PAUSE   0x0C00

Definition at line 104 of file upd60611_driver.h.

◆ UPD60611_ANAR_REMOTE_FAULT

#define UPD60611_ANAR_REMOTE_FAULT   0x2000

Definition at line 103 of file upd60611_driver.h.

◆ UPD60611_ANAR_SELECTOR

#define UPD60611_ANAR_SELECTOR   0x001F

Definition at line 110 of file upd60611_driver.h.

◆ UPD60611_ANAR_SELECTOR_DEFAULT

#define UPD60611_ANAR_SELECTOR_DEFAULT   0x0001

Definition at line 111 of file upd60611_driver.h.

◆ UPD60611_ANER

#define UPD60611_ANER   0x06

Definition at line 51 of file upd60611_driver.h.

◆ UPD60611_ANER_LP_AN_ABLE

#define UPD60611_ANER_LP_AN_ABLE   0x0001

Definition at line 131 of file upd60611_driver.h.

◆ UPD60611_ANER_LP_NEXT_PAGE_ABLE

#define UPD60611_ANER_LP_NEXT_PAGE_ABLE   0x0008

Definition at line 128 of file upd60611_driver.h.

◆ UPD60611_ANER_NEXT_PAGE_ABLE

#define UPD60611_ANER_NEXT_PAGE_ABLE   0x0004

Definition at line 129 of file upd60611_driver.h.

◆ UPD60611_ANER_PAGE_RECEIVED

#define UPD60611_ANER_PAGE_RECEIVED   0x0002

Definition at line 130 of file upd60611_driver.h.

◆ UPD60611_ANER_PAR_DETECT_FAULT

#define UPD60611_ANER_PAR_DETECT_FAULT   0x0010

Definition at line 127 of file upd60611_driver.h.

◆ UPD60611_ANLPAR

#define UPD60611_ANLPAR   0x05

Definition at line 50 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_100BT4

#define UPD60611_ANLPAR_100BT4   0x0200

Definition at line 118 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_100BTX_FD

#define UPD60611_ANLPAR_100BTX_FD   0x0100

Definition at line 119 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_100BTX_HD

#define UPD60611_ANLPAR_100BTX_HD   0x0080

Definition at line 120 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_10BT_FD

#define UPD60611_ANLPAR_10BT_FD   0x0040

Definition at line 121 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_10BT_HD

#define UPD60611_ANLPAR_10BT_HD   0x0020

Definition at line 122 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_ACK

#define UPD60611_ANLPAR_ACK   0x4000

Definition at line 115 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_NEXT_PAGE

#define UPD60611_ANLPAR_NEXT_PAGE   0x8000

Definition at line 114 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_PAUSE

#define UPD60611_ANLPAR_PAUSE   0x0400

Definition at line 117 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_REMOTE_FAULT

#define UPD60611_ANLPAR_REMOTE_FAULT   0x2000

Definition at line 116 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_SELECTOR

#define UPD60611_ANLPAR_SELECTOR   0x001F

Definition at line 123 of file upd60611_driver.h.

◆ UPD60611_ANLPAR_SELECTOR_DEFAULT

#define UPD60611_ANLPAR_SELECTOR_DEFAULT   0x0001

Definition at line 124 of file upd60611_driver.h.

◆ UPD60611_ANNPTR

#define UPD60611_ANNPTR   0x07

Definition at line 52 of file upd60611_driver.h.

◆ UPD60611_ANNPTR_ACK2

#define UPD60611_ANNPTR_ACK2   0x1000

Definition at line 136 of file upd60611_driver.h.

◆ UPD60611_ANNPTR_MESSAGE

#define UPD60611_ANNPTR_MESSAGE   0x07FF

Definition at line 138 of file upd60611_driver.h.

◆ UPD60611_ANNPTR_MSG_PAGE

#define UPD60611_ANNPTR_MSG_PAGE   0x2000

Definition at line 135 of file upd60611_driver.h.

◆ UPD60611_ANNPTR_NEXT_PAGE

#define UPD60611_ANNPTR_NEXT_PAGE   0x8000

Definition at line 134 of file upd60611_driver.h.

◆ UPD60611_ANNPTR_TOGGLE

#define UPD60611_ANNPTR_TOGGLE   0x0800

Definition at line 137 of file upd60611_driver.h.

◆ UPD60611_BER

#define UPD60611_BER   0x17

Definition at line 57 of file upd60611_driver.h.

◆ UPD60611_BER_CNT_LNK_EN

#define UPD60611_BER_CNT_LNK_EN   0x4000

Definition at line 166 of file upd60611_driver.h.

◆ UPD60611_BER_CNT_TRIG

#define UPD60611_BER_CNT_TRIG   0x3800

Definition at line 167 of file upd60611_driver.h.

◆ UPD60611_BER_COUNT

#define UPD60611_BER_COUNT   0x007F

Definition at line 169 of file upd60611_driver.h.

◆ UPD60611_BER_LNK_OK

#define UPD60611_BER_LNK_OK   0x8000

Definition at line 165 of file upd60611_driver.h.

◆ UPD60611_BER_WINDOW

#define UPD60611_BER_WINDOW   0x0780

Definition at line 168 of file upd60611_driver.h.

◆ UPD60611_BMCR

#define UPD60611_BMCR   0x00

Definition at line 45 of file upd60611_driver.h.

◆ UPD60611_BMCR_AN_EN

#define UPD60611_BMCR_AN_EN   0x1000

Definition at line 70 of file upd60611_driver.h.

◆ UPD60611_BMCR_COL_TEST

#define UPD60611_BMCR_COL_TEST   0x0080

Definition at line 75 of file upd60611_driver.h.

◆ UPD60611_BMCR_DUPLEX_MODE

#define UPD60611_BMCR_DUPLEX_MODE   0x0100

Definition at line 74 of file upd60611_driver.h.

◆ UPD60611_BMCR_ISOLATE

#define UPD60611_BMCR_ISOLATE   0x0400

Definition at line 72 of file upd60611_driver.h.

◆ UPD60611_BMCR_LOOPBACK

#define UPD60611_BMCR_LOOPBACK   0x4000

Definition at line 68 of file upd60611_driver.h.

◆ UPD60611_BMCR_POWER_DOWN

#define UPD60611_BMCR_POWER_DOWN   0x0800

Definition at line 71 of file upd60611_driver.h.

◆ UPD60611_BMCR_RESET

#define UPD60611_BMCR_RESET   0x8000

Definition at line 67 of file upd60611_driver.h.

◆ UPD60611_BMCR_RESTART_AN

#define UPD60611_BMCR_RESTART_AN   0x0200

Definition at line 73 of file upd60611_driver.h.

◆ UPD60611_BMCR_SPEED_SEL

#define UPD60611_BMCR_SPEED_SEL   0x2000

Definition at line 69 of file upd60611_driver.h.

◆ UPD60611_BMSR

#define UPD60611_BMSR   0x01

Definition at line 46 of file upd60611_driver.h.

◆ UPD60611_BMSR_100BT4

#define UPD60611_BMSR_100BT4   0x8000

Definition at line 78 of file upd60611_driver.h.

◆ UPD60611_BMSR_100BTX_FD

#define UPD60611_BMSR_100BTX_FD   0x4000

Definition at line 79 of file upd60611_driver.h.

◆ UPD60611_BMSR_100BTX_HD

#define UPD60611_BMSR_100BTX_HD   0x2000

Definition at line 80 of file upd60611_driver.h.

◆ UPD60611_BMSR_10BT_FD

#define UPD60611_BMSR_10BT_FD   0x1000

Definition at line 81 of file upd60611_driver.h.

◆ UPD60611_BMSR_10BT_HD

#define UPD60611_BMSR_10BT_HD   0x0800

Definition at line 82 of file upd60611_driver.h.

◆ UPD60611_BMSR_AN_CAPABLE

#define UPD60611_BMSR_AN_CAPABLE   0x0008

Definition at line 85 of file upd60611_driver.h.

◆ UPD60611_BMSR_AN_COMPLETE

#define UPD60611_BMSR_AN_COMPLETE   0x0020

Definition at line 83 of file upd60611_driver.h.

◆ UPD60611_BMSR_EXTENDED_CAPABLE

#define UPD60611_BMSR_EXTENDED_CAPABLE   0x0001

Definition at line 88 of file upd60611_driver.h.

◆ UPD60611_BMSR_JABBER_DETECT

#define UPD60611_BMSR_JABBER_DETECT   0x0002

Definition at line 87 of file upd60611_driver.h.

◆ UPD60611_BMSR_LINK_STATUS

#define UPD60611_BMSR_LINK_STATUS   0x0004

Definition at line 86 of file upd60611_driver.h.

◆ UPD60611_BMSR_REMOTE_FAULT

#define UPD60611_BMSR_REMOTE_FAULT   0x0010

Definition at line 84 of file upd60611_driver.h.

◆ UPD60611_DCR

#define UPD60611_DCR   0x1A

Definition at line 60 of file upd60611_driver.h.

◆ UPD60611_DCR_CNT_WINDOW

#define UPD60611_DCR_CNT_WINDOW   0xFF00

Definition at line 180 of file upd60611_driver.h.

◆ UPD60611_DCR_DIAGCNT

#define UPD60611_DCR_DIAGCNT   0x00FF

Definition at line 181 of file upd60611_driver.h.

◆ UPD60611_DCSR

#define UPD60611_DCSR   0x19

Definition at line 59 of file upd60611_driver.h.

◆ UPD60611_DCSR_ADC_MAX_VALUE

#define UPD60611_DCSR_ADC_MAX_VALUE   0x3F00

Definition at line 173 of file upd60611_driver.h.

◆ UPD60611_DCSR_DIAG_DONE

#define UPD60611_DCSR_DIAG_DONE   0x0080

Definition at line 174 of file upd60611_driver.h.

◆ UPD60611_DCSR_DIAG_INIT

#define UPD60611_DCSR_DIAG_INIT   0x4000

Definition at line 172 of file upd60611_driver.h.

◆ UPD60611_DCSR_DIAG_POL

#define UPD60611_DCSR_DIAG_POL   0x0040

Definition at line 175 of file upd60611_driver.h.

◆ UPD60611_DCSR_DIAG_SEL_LINE

#define UPD60611_DCSR_DIAG_SEL_LINE   0x0020

Definition at line 176 of file upd60611_driver.h.

◆ UPD60611_DCSR_PW_DIAG

#define UPD60611_DCSR_PW_DIAG   0x001F

Definition at line 177 of file upd60611_driver.h.

◆ UPD60611_EBSR

#define UPD60611_EBSR   0x13

Definition at line 56 of file upd60611_driver.h.

◆ UPD60611_EBSR_R_EL_BUF_OVF

#define UPD60611_EBSR_R_EL_BUF_OVF   0x0020

Definition at line 161 of file upd60611_driver.h.

◆ UPD60611_EBSR_R_EL_BUF_UDF

#define UPD60611_EBSR_R_EL_BUF_UDF   0x0010

Definition at line 162 of file upd60611_driver.h.

◆ UPD60611_EBSR_T_EL_BUF_OVF

#define UPD60611_EBSR_T_EL_BUF_OVF   0x0080

Definition at line 159 of file upd60611_driver.h.

◆ UPD60611_EBSR_T_EL_BUF_UDF

#define UPD60611_EBSR_T_EL_BUF_UDF   0x0040

Definition at line 160 of file upd60611_driver.h.

◆ UPD60611_FEQMR

#define UPD60611_FEQMR   0x18

Definition at line 58 of file upd60611_driver.h.

◆ UPD60611_IER

#define UPD60611_IER   0x1E

Definition at line 63 of file upd60611_driver.h.

◆ UPD60611_IER_AN_COMPLETE

#define UPD60611_IER_AN_COMPLETE   0x0040

Definition at line 204 of file upd60611_driver.h.

◆ UPD60611_IER_AN_LP_ACK

#define UPD60611_IER_AN_LP_ACK   0x0008

Definition at line 207 of file upd60611_driver.h.

◆ UPD60611_IER_AN_PAGE_RECEIVED

#define UPD60611_IER_AN_PAGE_RECEIVED   0x0002

Definition at line 209 of file upd60611_driver.h.

◆ UPD60611_IER_BER

#define UPD60611_IER_BER   0x0400

Definition at line 201 of file upd60611_driver.h.

◆ UPD60611_IER_ENERGYON

#define UPD60611_IER_ENERGYON   0x0080

Definition at line 203 of file upd60611_driver.h.

◆ UPD60611_IER_FEQ

#define UPD60611_IER_FEQ   0x0200

Definition at line 202 of file upd60611_driver.h.

◆ UPD60611_IER_LINK_DOWN

#define UPD60611_IER_LINK_DOWN   0x0010

Definition at line 206 of file upd60611_driver.h.

◆ UPD60611_IER_PAR_DETECT_FAULT

#define UPD60611_IER_PAR_DETECT_FAULT   0x0004

Definition at line 208 of file upd60611_driver.h.

◆ UPD60611_IER_REMOTE_FAULT

#define UPD60611_IER_REMOTE_FAULT   0x0020

Definition at line 205 of file upd60611_driver.h.

◆ UPD60611_ISR

#define UPD60611_ISR   0x1D

Definition at line 62 of file upd60611_driver.h.

◆ UPD60611_ISR_AN_COMPLETE

#define UPD60611_ISR_AN_COMPLETE   0x0040

Definition at line 193 of file upd60611_driver.h.

◆ UPD60611_ISR_AN_LP_ACK

#define UPD60611_ISR_AN_LP_ACK   0x0008

Definition at line 196 of file upd60611_driver.h.

◆ UPD60611_ISR_AN_PAGE_RECEIVED

#define UPD60611_ISR_AN_PAGE_RECEIVED   0x0002

Definition at line 198 of file upd60611_driver.h.

◆ UPD60611_ISR_BER

#define UPD60611_ISR_BER   0x0400

Definition at line 190 of file upd60611_driver.h.

◆ UPD60611_ISR_ENERGYON

#define UPD60611_ISR_ENERGYON   0x0080

Definition at line 192 of file upd60611_driver.h.

◆ UPD60611_ISR_FEQ

#define UPD60611_ISR_FEQ   0x0200

Definition at line 191 of file upd60611_driver.h.

◆ UPD60611_ISR_LINK_DOWN

#define UPD60611_ISR_LINK_DOWN   0x0010

Definition at line 195 of file upd60611_driver.h.

◆ UPD60611_ISR_PAR_DETECT_FAULT

#define UPD60611_ISR_PAR_DETECT_FAULT   0x0004

Definition at line 197 of file upd60611_driver.h.

◆ UPD60611_ISR_REMOTE_FAULT

#define UPD60611_ISR_REMOTE_FAULT   0x0020

Definition at line 194 of file upd60611_driver.h.

◆ UPD60611_MCSR

#define UPD60611_MCSR   0x11

Definition at line 54 of file upd60611_driver.h.

◆ UPD60611_MCSR_AUTOMDIX_EN

#define UPD60611_MCSR_AUTOMDIX_EN   0x0080

Definition at line 147 of file upd60611_driver.h.

◆ UPD60611_MCSR_EDPWRDOWN

#define UPD60611_MCSR_EDPWRDOWN   0x2000

Definition at line 144 of file upd60611_driver.h.

◆ UPD60611_MCSR_ENERGYON

#define UPD60611_MCSR_ENERGYON   0x0002

Definition at line 150 of file upd60611_driver.h.

◆ UPD60611_MCSR_FARLOOPBACK

#define UPD60611_MCSR_FARLOOPBACK   0x0200

Definition at line 145 of file upd60611_driver.h.

◆ UPD60611_MCSR_FASTEST

#define UPD60611_MCSR_FASTEST   0x0100

Definition at line 146 of file upd60611_driver.h.

◆ UPD60611_MCSR_FORCE_GOOD_LINK

#define UPD60611_MCSR_FORCE_GOOD_LINK   0x0004

Definition at line 149 of file upd60611_driver.h.

◆ UPD60611_MCSR_MDI_MODE

#define UPD60611_MCSR_MDI_MODE   0x0040

Definition at line 148 of file upd60611_driver.h.

◆ UPD60611_PHY_ADDR

#define UPD60611_PHY_ADDR   0

Definition at line 39 of file upd60611_driver.h.

◆ UPD60611_PHYID1

#define UPD60611_PHYID1   0x02

Definition at line 47 of file upd60611_driver.h.

◆ UPD60611_PHYID1_PHY_ID_NUM_MSB

#define UPD60611_PHYID1_PHY_ID_NUM_MSB   0xFFFF

Definition at line 91 of file upd60611_driver.h.

◆ UPD60611_PHYID1_PHY_ID_NUM_MSB_DEFAULT

#define UPD60611_PHYID1_PHY_ID_NUM_MSB_DEFAULT   0xB824

Definition at line 92 of file upd60611_driver.h.

◆ UPD60611_PHYID2

#define UPD60611_PHYID2   0x03

Definition at line 48 of file upd60611_driver.h.

◆ UPD60611_PHYID2_MODEL_NUM

#define UPD60611_PHYID2_MODEL_NUM   0x03F0

Definition at line 97 of file upd60611_driver.h.

◆ UPD60611_PHYID2_MODEL_NUM_DEFAULT

#define UPD60611_PHYID2_MODEL_NUM_DEFAULT   0x0010

Definition at line 98 of file upd60611_driver.h.

◆ UPD60611_PHYID2_PHY_ID_NUM_LSB

#define UPD60611_PHYID2_PHY_ID_NUM_LSB   0xFC00

Definition at line 95 of file upd60611_driver.h.

◆ UPD60611_PHYID2_PHY_ID_NUM_LSB_DEFAULT

#define UPD60611_PHYID2_PHY_ID_NUM_LSB_DEFAULT   0x2800

Definition at line 96 of file upd60611_driver.h.

◆ UPD60611_PHYID2_REVISION_NUM

#define UPD60611_PHYID2_REVISION_NUM   0x000F

Definition at line 99 of file upd60611_driver.h.

◆ UPD60611_PSCSR

#define UPD60611_PSCSR   0x1F

Definition at line 64 of file upd60611_driver.h.

◆ UPD60611_PSCSR_4B5B_EN

#define UPD60611_PSCSR_4B5B_EN   0x0040

Definition at line 213 of file upd60611_driver.h.

◆ UPD60611_PSCSR_AUTODONE

#define UPD60611_PSCSR_AUTODONE   0x1000

Definition at line 212 of file upd60611_driver.h.

◆ UPD60611_PSCSR_HCDSPEED

#define UPD60611_PSCSR_HCDSPEED   0x001C

Definition at line 214 of file upd60611_driver.h.

◆ UPD60611_PSCSR_HCDSPEED_100BTX_FD

#define UPD60611_PSCSR_HCDSPEED_100BTX_FD   0x0018

Definition at line 218 of file upd60611_driver.h.

◆ UPD60611_PSCSR_HCDSPEED_100BTX_HD

#define UPD60611_PSCSR_HCDSPEED_100BTX_HD   0x0008

Definition at line 216 of file upd60611_driver.h.

◆ UPD60611_PSCSR_HCDSPEED_10BT_FD

#define UPD60611_PSCSR_HCDSPEED_10BT_FD   0x0014

Definition at line 217 of file upd60611_driver.h.

◆ UPD60611_PSCSR_HCDSPEED_10BT_HD

#define UPD60611_PSCSR_HCDSPEED_10BT_HD   0x0004

Definition at line 215 of file upd60611_driver.h.

◆ UPD60611_PSCSR_RX_DV_J2T

#define UPD60611_PSCSR_RX_DV_J2T   0x0002

Definition at line 219 of file upd60611_driver.h.

◆ UPD60611_PSCSR_SCRAMBLE_DIS

#define UPD60611_PSCSR_SCRAMBLE_DIS   0x0001

Definition at line 220 of file upd60611_driver.h.

◆ UPD60611_SCSIR

#define UPD60611_SCSIR   0x1B

Definition at line 61 of file upd60611_driver.h.

◆ UPD60611_SCSIR_FEFIEN

#define UPD60611_SCSIR_FEFIEN   0x0020

Definition at line 186 of file upd60611_driver.h.

◆ UPD60611_SCSIR_SQEOFF

#define UPD60611_SCSIR_SQEOFF   0x0800

Definition at line 185 of file upd60611_driver.h.

◆ UPD60611_SCSIR_SWRST_FAST

#define UPD60611_SCSIR_SWRST_FAST   0x1000

Definition at line 184 of file upd60611_driver.h.

◆ UPD60611_SCSIR_XPOL

#define UPD60611_SCSIR_XPOL   0x0010

Definition at line 187 of file upd60611_driver.h.

◆ UPD60611_SMR

#define UPD60611_SMR   0x12

Definition at line 55 of file upd60611_driver.h.

◆ UPD60611_SMR_FX_MODE

#define UPD60611_SMR_FX_MODE   0x0400

Definition at line 153 of file upd60611_driver.h.

◆ UPD60611_SMR_PHY_ADD_DEV

#define UPD60611_SMR_PHY_ADD_DEV   0x0018

Definition at line 155 of file upd60611_driver.h.

◆ UPD60611_SMR_PHY_ADD_MOD

#define UPD60611_SMR_PHY_ADD_MOD   0x0007

Definition at line 156 of file upd60611_driver.h.

◆ UPD60611_SMR_PHY_MODE

#define UPD60611_SMR_PHY_MODE   0x01E0

Definition at line 154 of file upd60611_driver.h.

◆ UPD60611_SRR

#define UPD60611_SRR   0x10

Definition at line 53 of file upd60611_driver.h.

◆ UPD60611_SRR_SILICON_REV

#define UPD60611_SRR_SILICON_REV   0x03C0

Definition at line 141 of file upd60611_driver.h.

Function Documentation

◆ upd60611DisableIrq()

void upd60611DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 161 of file upd60611_driver.c.

◆ upd60611DumpPhyReg()

void upd60611DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 302 of file upd60611_driver.c.

◆ upd60611EnableIrq()

void upd60611EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 151 of file upd60611_driver.c.

◆ upd60611EventHandler()

void upd60611EventHandler ( NetInterface interface)

uPD60611 event handler

Parameters
[in]interfaceUnderlying network interface

Definition at line 171 of file upd60611_driver.c.

◆ upd60611Init()

error_t upd60611Init ( NetInterface interface)

uPD60611 PHY transceiver initialization

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 60 of file upd60611_driver.c.

◆ upd60611InitHook()

void upd60611InitHook ( NetInterface interface)

uPD60611 custom configuration

Parameters
[in]interfaceUnderlying network interface

Definition at line 107 of file upd60611_driver.c.

◆ upd60611ReadPhyReg()

uint16_t upd60611ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
Returns
Register value

Definition at line 276 of file upd60611_driver.c.

◆ upd60611Tick()

void upd60611Tick ( NetInterface interface)

uPD60611 timer handler

Parameters
[in]interfaceUnderlying network interface

Definition at line 117 of file upd60611_driver.c.

◆ upd60611WritePhyReg()

void upd60611WritePhyReg ( NetInterface interface,
uint8_t  address,
uint16_t  data 
)

Write PHY register.

Parameters
[in]interfaceUnderlying network interface
[in]addressPHY register address
[in]dataRegister value

Definition at line 252 of file upd60611_driver.c.

Variable Documentation

◆ upd60611PhyDriver

const PhyDriver upd60611PhyDriver
extern

uPD60611 Ethernet PHY driver

Definition at line 44 of file upd60611_driver.c.