ar8035_driver.h File Reference

AR8035 Gigabit Ethernet PHY transceiver. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define AR8035_PHY_ADDR   0
 
#define AR8035_BMCR   0x00
 
#define AR8035_BMSR   0x01
 
#define AR8035_PHYID1   0x02
 
#define AR8035_PHYID2   0x03
 
#define AR8035_ANAR   0x04
 
#define AR8035_ANLPAR   0x05
 
#define AR8035_ANER   0x06
 
#define AR8035_ANNPR   0x07
 
#define AR8035_ANLPNPR   0x08
 
#define AR8035_GBCR   0x09
 
#define AR8035_GBSR   0x0A
 
#define AR8035_MMDACR   0x0D
 
#define AR8035_MMDAADR   0x0E
 
#define AR8035_GBESR   0x0F
 
#define AR8035_FUNC_CTRL   0x10
 
#define AR8035_PHY_STATUS   0x11
 
#define AR8035_INT_EN   0x12
 
#define AR8035_INT_STATUS   0x13
 
#define AR8035_SMART_SPEED   0x14
 
#define AR8035_CDT_CTRL   0x16
 
#define AR8035_LED_CTRL   0x18
 
#define AR8035_CDT_STATUS   0x1C
 
#define AR8035_DBG_PORT_ADDR_OFFSET   0x1D
 
#define AR8035_DBG_PORT_DATA   0x1E
 
#define AR8035_BMCR_RESET   0x8000
 
#define AR8035_BMCR_LOOPBACK   0x4000
 
#define AR8035_BMCR_SPEED_SEL_LSB   0x2000
 
#define AR8035_BMCR_AN_EN   0x1000
 
#define AR8035_BMCR_POWER_DOWN   0x0800
 
#define AR8035_BMCR_ISOLATE   0x0400
 
#define AR8035_BMCR_RESTART_AN   0x0200
 
#define AR8035_BMCR_DUPLEX_MODE   0x0100
 
#define AR8035_BMCR_COL_TEST   0x0080
 
#define AR8035_BMCR_SPEED_SEL_MSB   0x0040
 
#define AR8035_BMSR_100BT4   0x8000
 
#define AR8035_BMSR_100BTX_FD   0x4000
 
#define AR8035_BMSR_100BTX_HD   0x2000
 
#define AR8035_BMSR_10BT_FD   0x1000
 
#define AR8035_BMSR_10BT_HD   0x0800
 
#define AR8035_BMSR_100BT2_FD   0x0400
 
#define AR8035_BMSR_100BT2_HD   0x0200
 
#define AR8035_BMSR_EXTENDED_STATUS   0x0100
 
#define AR8035_BMSR_MF_PREAMBLE_SUPPR   0x0040
 
#define AR8035_BMSR_AN_COMPLETE   0x0020
 
#define AR8035_BMSR_REMOTE_FAULT   0x0010
 
#define AR8035_BMSR_AN_CAPABLE   0x0008
 
#define AR8035_BMSR_LINK_STATUS   0x0004
 
#define AR8035_BMSR_JABBER_DETECT   0x0002
 
#define AR8035_BMSR_EXTENDED_CAPABLE   0x0001
 
#define AR8035_PHYID1_OUI_MSB   0xFFFF
 
#define AR8035_PHYID1_OUI_MSB_DEFAULT   0x004D
 
#define AR8035_PHYID2_OUI_LSB   0xFC00
 
#define AR8035_PHYID2_OUI_LSB_DEFAULT   0xD000
 
#define AR8035_PHYID2_MODEL_NUM   0x03F0
 
#define AR8035_PHYID2_MODEL_NUM_DEFAULT   0x0070
 
#define AR8035_PHYID2_REVISION_NUM   0x000F
 
#define AR8035_ANAR_NEXT_PAGE   0x8000
 
#define AR8035_ANAR_ACK   0x4000
 
#define AR8035_ANAR_REMOTE_FAULT   0x2000
 
#define AR8035_ANAR_XNP_ABLE   0x1000
 
#define AR8035_ANAR_ASYM_PAUSE   0x0800
 
#define AR8035_ANAR_PAUSE   0x0400
 
#define AR8035_ANAR_100BT4   0x0200
 
#define AR8035_ANAR_100BTX_FD   0x0100
 
#define AR8035_ANAR_100BTX_HD   0x0080
 
#define AR8035_ANAR_10BT_FD   0x0040
 
#define AR8035_ANAR_10BT_HD   0x0020
 
#define AR8035_ANAR_SELECTOR   0x001F
 
#define AR8035_ANAR_SELECTOR_DEFAULT   0x0001
 
#define AR8035_ANLPAR_NEXT_PAGE   0x8000
 
#define AR8035_ANLPAR_ACK   0x4000
 
#define AR8035_ANLPAR_REMOTE_FAULT   0x2000
 
#define AR8035_ANLPAR_ASYM_PAUSE   0x0800
 
#define AR8035_ANLPAR_PAUSE   0x0400
 
#define AR8035_ANLPAR_100BT4   0x0200
 
#define AR8035_ANLPAR_100BTX_FD   0x0100
 
#define AR8035_ANLPAR_100BTX_HD   0x0080
 
#define AR8035_ANLPAR_10BT_FD   0x0040
 
#define AR8035_ANLPAR_10BT_HD   0x0020
 
#define AR8035_ANLPAR_SELECTOR   0x001F
 
#define AR8035_ANLPAR_SELECTOR_DEFAULT   0x0001
 
#define AR8035_ANER_PAR_DETECT_FAULT   0x0010
 
#define AR8035_ANER_LP_NEXT_PAGE_ABLE   0x0008
 
#define AR8035_ANER_NEXT_PAGE_ABLE   0x0004
 
#define AR8035_ANER_PAGE_RECEIVED   0x0002
 
#define AR8035_ANER_LP_AN_ABLE   0x0001
 
#define AR8035_ANNPR_NEXT_PAGE   0x8000
 
#define AR8035_ANNPR_MSG_PAGE   0x2000
 
#define AR8035_ANNPR_ACK2   0x1000
 
#define AR8035_ANNPR_TOGGLE   0x0800
 
#define AR8035_ANNPR_MESSAGE   0x07FF
 
#define AR8035_ANLPNPR_NEXT_PAGE   0x8000
 
#define AR8035_ANLPNPR_ACK   0x4000
 
#define AR8035_ANLPNPR_MSG_PAGE   0x2000
 
#define AR8035_ANLPNPR_ACK2   0x1000
 
#define AR8035_ANLPNPR_TOGGLE   0x0800
 
#define AR8035_ANLPNPR_MESSAGE   0x07FF
 
#define AR8035_GBCR_TEST_MODE   0xE000
 
#define AR8035_GBCR_MS_MAN_CONF_EN   0x1000
 
#define AR8035_GBCR_MS_MAN_CONF_VAL   0x0800
 
#define AR8035_GBCR_PORT_TYPE   0x0400
 
#define AR8035_GBCR_1000BT_FD   0x0200
 
#define AR8035_GBCR_1000BT_HD   0x0100
 
#define AR8035_GBSR_MS_CONF_FAULT   0x8000
 
#define AR8035_GBSR_MS_CONF_RES   0x4000
 
#define AR8035_GBSR_LOCAL_RECEIVER_STATUS   0x2000
 
#define AR8035_GBSR_REMOTE_RECEIVER_STATUS   0x1000
 
#define AR8035_GBSR_LP_1000BT_FD   0x0800
 
#define AR8035_GBSR_LP_1000BT_HD   0x0400
 
#define AR8035_GBSR_IDLE_ERR_COUNT   0x00FF
 
#define AR8035_MMDACR_FUNC   0xC000
 
#define AR8035_MMDACR_FUNC_ADDR   0x0000
 
#define AR8035_MMDACR_FUNC_DATA_NO_POST_INC   0x4000
 
#define AR8035_MMDACR_FUNC_DATA_POST_INC_RW   0x8000
 
#define AR8035_MMDACR_FUNC_DATA_POST_INC_W   0xC000
 
#define AR8035_MMDACR_DEVAD   0x001F
 
#define AR8035_GBESR_1000BX_FD   0x8000
 
#define AR8035_GBESR_1000BX_HD   0x4000
 
#define AR8035_GBESR_1000BT_FD   0x2000
 
#define AR8035_GBESR_1000BT_HD   0x1000
 
#define AR8035_FUNC_CTRL_ASSERT_CRS_ON_TX   0x0800
 
#define AR8035_FUNC_CTRL_MDIX_MODE   0x0060
 
#define AR8035_FUNC_CTRL_MDIX_MODE_MANUAL_MDI   0x0000
 
#define AR8035_FUNC_CTRL_MDIX_MODE_MANUAL_MDIX   0x0020
 
#define AR8035_FUNC_CTRL_MDIX_MODE_AUTO   0x0060
 
#define AR8035_FUNC_CTRL_SQE_TEST   0x0004
 
#define AR8035_FUNC_CTRL_POLARITY_REVERSAL   0x0002
 
#define AR8035_FUNC_CTRL_JABBER_DIS   0x0001
 
#define AR8035_PHY_STATUS_SPEED   0xC000
 
#define AR8035_PHY_STATUS_SPEED_10MBPS   0x0000
 
#define AR8035_PHY_STATUS_SPEED_100MBPS   0x4000
 
#define AR8035_PHY_STATUS_SPEED_1000MBPS   0x8000
 
#define AR8035_PHY_STATUS_DUPLEX   0x2000
 
#define AR8035_PHY_STATUS_PAGE_RECEIVED   0x1000
 
#define AR8035_PHY_STATUS_SPEED_DUPLEX_RESOLVED   0x0800
 
#define AR8035_PHY_STATUS_LINK   0x0400
 
#define AR8035_PHY_STATUS_MDI_CROSSOVER_STATUS   0x0040
 
#define AR8035_PHY_STATUS_WIRESPEED_DOWNGRADE   0x0020
 
#define AR8035_PHY_STATUS_TX_PAUSE_EN   0x0008
 
#define AR8035_PHY_STATUS_RX_PAUSE_EN   0x0004
 
#define AR8035_PHY_STATUS_POLARITY   0x0002
 
#define AR8035_PHY_STATUS_JABBER   0x0001
 
#define AR8035_INT_EN_AN_ERROR   0x8000
 
#define AR8035_INT_EN_SPEED_CHANGED   0x4000
 
#define AR8035_INT_EN_DUPLEX_CHANGED   0x2000
 
#define AR8035_INT_EN_PAGE_RECEIVED   0x1000
 
#define AR8035_INT_EN_LINK_FAIL   0x0800
 
#define AR8035_INT_EN_LINK_SUCCESS   0x0400
 
#define AR8035_INT_EN_WIRESPEED_DOWNGRADE   0x0020
 
#define AR8035_INT_EN_POLARITY_CHANGED   0x0002
 
#define AR8035_INT_EN_WOL_PTP   0x0001
 
#define AR8035_INT_STATUS_AN_ERROR   0x8000
 
#define AR8035_INT_STATUS_SPEED_CHANGED   0x4000
 
#define AR8035_INT_STATUS_DUPLEX_CHANGED   0x2000
 
#define AR8035_INT_STATUS_PAGE_RECEIVED   0x1000
 
#define AR8035_INT_STATUS_LINK_FAIL   0x0800
 
#define AR8035_INT_STATUS_LINK_SUCCESS   0x0400
 
#define AR8035_INT_STATUS_WIRESPEED_DOWNGRADE   0x0020
 
#define AR8035_INT_STATUS_POLARITY_CHANGED   0x0002
 
#define AR8035_INT_STATUS_WOL_PTP   0x0001
 
#define AR8035_SMART_SPEED_EN   0x0020
 
#define AR8035_SMART_SPEED_RETRY_LIMIT   0x001C
 
#define AR8035_SMART_SPEED_BYPASS_TIMER   0x0002
 
#define AR8035_CDT_CTRL_MDI_PAIR_SELECT   0x0300
 
#define AR8035_CDT_CTRL_TEST_EN   0x0001
 
#define AR8035_LED_CTRL_LED_ON_TIME   0x7000
 
#define AR8035_LED_CTRL_LED_OFF_TIME   0x0700
 
#define AR8035_CDT_STATUS_STATUS   0x0300
 
#define AR8035_CDT_STATUS_DELTA_TIME   0x00FF
 

Functions

error_t ar8035Init (NetInterface *interface)
 AR8035 PHY transceiver initialization. More...
 
void ar8035Tick (NetInterface *interface)
 AR8035 timer handler. More...
 
void ar8035EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ar8035DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ar8035EventHandler (NetInterface *interface)
 AR8035 event handler. More...
 
void ar8035WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ar8035ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void ar8035DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const PhyDriver ar8035PhyDriver
 AR8035 Ethernet PHY driver. More...
 

Detailed Description

AR8035 Gigabit Ethernet PHY transceiver.

License

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

Copyright (C) 2010-2019 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
1.9.6

Definition in file ar8035_driver.h.

Macro Definition Documentation

◆ AR8035_ANAR

#define AR8035_ANAR   0x04

Definition at line 49 of file ar8035_driver.h.

◆ AR8035_ANAR_100BT4

#define AR8035_ANAR_100BT4   0x0200

Definition at line 117 of file ar8035_driver.h.

◆ AR8035_ANAR_100BTX_FD

#define AR8035_ANAR_100BTX_FD   0x0100

Definition at line 118 of file ar8035_driver.h.

◆ AR8035_ANAR_100BTX_HD

#define AR8035_ANAR_100BTX_HD   0x0080

Definition at line 119 of file ar8035_driver.h.

◆ AR8035_ANAR_10BT_FD

#define AR8035_ANAR_10BT_FD   0x0040

Definition at line 120 of file ar8035_driver.h.

◆ AR8035_ANAR_10BT_HD

#define AR8035_ANAR_10BT_HD   0x0020

Definition at line 121 of file ar8035_driver.h.

◆ AR8035_ANAR_ACK

#define AR8035_ANAR_ACK   0x4000

Definition at line 112 of file ar8035_driver.h.

◆ AR8035_ANAR_ASYM_PAUSE

#define AR8035_ANAR_ASYM_PAUSE   0x0800

Definition at line 115 of file ar8035_driver.h.

◆ AR8035_ANAR_NEXT_PAGE

#define AR8035_ANAR_NEXT_PAGE   0x8000

Definition at line 111 of file ar8035_driver.h.

◆ AR8035_ANAR_PAUSE

#define AR8035_ANAR_PAUSE   0x0400

Definition at line 116 of file ar8035_driver.h.

◆ AR8035_ANAR_REMOTE_FAULT

#define AR8035_ANAR_REMOTE_FAULT   0x2000

Definition at line 113 of file ar8035_driver.h.

◆ AR8035_ANAR_SELECTOR

#define AR8035_ANAR_SELECTOR   0x001F

Definition at line 122 of file ar8035_driver.h.

◆ AR8035_ANAR_SELECTOR_DEFAULT

#define AR8035_ANAR_SELECTOR_DEFAULT   0x0001

Definition at line 123 of file ar8035_driver.h.

◆ AR8035_ANAR_XNP_ABLE

#define AR8035_ANAR_XNP_ABLE   0x1000

Definition at line 114 of file ar8035_driver.h.

◆ AR8035_ANER

#define AR8035_ANER   0x06

Definition at line 51 of file ar8035_driver.h.

◆ AR8035_ANER_LP_AN_ABLE

#define AR8035_ANER_LP_AN_ABLE   0x0001

Definition at line 144 of file ar8035_driver.h.

◆ AR8035_ANER_LP_NEXT_PAGE_ABLE

#define AR8035_ANER_LP_NEXT_PAGE_ABLE   0x0008

Definition at line 141 of file ar8035_driver.h.

◆ AR8035_ANER_NEXT_PAGE_ABLE

#define AR8035_ANER_NEXT_PAGE_ABLE   0x0004

Definition at line 142 of file ar8035_driver.h.

◆ AR8035_ANER_PAGE_RECEIVED

#define AR8035_ANER_PAGE_RECEIVED   0x0002

Definition at line 143 of file ar8035_driver.h.

◆ AR8035_ANER_PAR_DETECT_FAULT

#define AR8035_ANER_PAR_DETECT_FAULT   0x0010

Definition at line 140 of file ar8035_driver.h.

◆ AR8035_ANLPAR

#define AR8035_ANLPAR   0x05

Definition at line 50 of file ar8035_driver.h.

◆ AR8035_ANLPAR_100BT4

#define AR8035_ANLPAR_100BT4   0x0200

Definition at line 131 of file ar8035_driver.h.

◆ AR8035_ANLPAR_100BTX_FD

#define AR8035_ANLPAR_100BTX_FD   0x0100

Definition at line 132 of file ar8035_driver.h.

◆ AR8035_ANLPAR_100BTX_HD

#define AR8035_ANLPAR_100BTX_HD   0x0080

Definition at line 133 of file ar8035_driver.h.

◆ AR8035_ANLPAR_10BT_FD

#define AR8035_ANLPAR_10BT_FD   0x0040

Definition at line 134 of file ar8035_driver.h.

◆ AR8035_ANLPAR_10BT_HD

#define AR8035_ANLPAR_10BT_HD   0x0020

Definition at line 135 of file ar8035_driver.h.

◆ AR8035_ANLPAR_ACK

#define AR8035_ANLPAR_ACK   0x4000

Definition at line 127 of file ar8035_driver.h.

◆ AR8035_ANLPAR_ASYM_PAUSE

#define AR8035_ANLPAR_ASYM_PAUSE   0x0800

Definition at line 129 of file ar8035_driver.h.

◆ AR8035_ANLPAR_NEXT_PAGE

#define AR8035_ANLPAR_NEXT_PAGE   0x8000

Definition at line 126 of file ar8035_driver.h.

◆ AR8035_ANLPAR_PAUSE

#define AR8035_ANLPAR_PAUSE   0x0400

Definition at line 130 of file ar8035_driver.h.

◆ AR8035_ANLPAR_REMOTE_FAULT

#define AR8035_ANLPAR_REMOTE_FAULT   0x2000

Definition at line 128 of file ar8035_driver.h.

◆ AR8035_ANLPAR_SELECTOR

#define AR8035_ANLPAR_SELECTOR   0x001F

Definition at line 136 of file ar8035_driver.h.

◆ AR8035_ANLPAR_SELECTOR_DEFAULT

#define AR8035_ANLPAR_SELECTOR_DEFAULT   0x0001

Definition at line 137 of file ar8035_driver.h.

◆ AR8035_ANLPNPR

#define AR8035_ANLPNPR   0x08

Definition at line 53 of file ar8035_driver.h.

◆ AR8035_ANLPNPR_ACK

#define AR8035_ANLPNPR_ACK   0x4000

Definition at line 155 of file ar8035_driver.h.

◆ AR8035_ANLPNPR_ACK2

#define AR8035_ANLPNPR_ACK2   0x1000

Definition at line 157 of file ar8035_driver.h.

◆ AR8035_ANLPNPR_MESSAGE

#define AR8035_ANLPNPR_MESSAGE   0x07FF

Definition at line 159 of file ar8035_driver.h.

◆ AR8035_ANLPNPR_MSG_PAGE

#define AR8035_ANLPNPR_MSG_PAGE   0x2000

Definition at line 156 of file ar8035_driver.h.

◆ AR8035_ANLPNPR_NEXT_PAGE

#define AR8035_ANLPNPR_NEXT_PAGE   0x8000

Definition at line 154 of file ar8035_driver.h.

◆ AR8035_ANLPNPR_TOGGLE

#define AR8035_ANLPNPR_TOGGLE   0x0800

Definition at line 158 of file ar8035_driver.h.

◆ AR8035_ANNPR

#define AR8035_ANNPR   0x07

Definition at line 52 of file ar8035_driver.h.

◆ AR8035_ANNPR_ACK2

#define AR8035_ANNPR_ACK2   0x1000

Definition at line 149 of file ar8035_driver.h.

◆ AR8035_ANNPR_MESSAGE

#define AR8035_ANNPR_MESSAGE   0x07FF

Definition at line 151 of file ar8035_driver.h.

◆ AR8035_ANNPR_MSG_PAGE

#define AR8035_ANNPR_MSG_PAGE   0x2000

Definition at line 148 of file ar8035_driver.h.

◆ AR8035_ANNPR_NEXT_PAGE

#define AR8035_ANNPR_NEXT_PAGE   0x8000

Definition at line 147 of file ar8035_driver.h.

◆ AR8035_ANNPR_TOGGLE

#define AR8035_ANNPR_TOGGLE   0x0800

Definition at line 150 of file ar8035_driver.h.

◆ AR8035_BMCR

#define AR8035_BMCR   0x00

Definition at line 45 of file ar8035_driver.h.

◆ AR8035_BMCR_AN_EN

#define AR8035_BMCR_AN_EN   0x1000

Definition at line 74 of file ar8035_driver.h.

◆ AR8035_BMCR_COL_TEST

#define AR8035_BMCR_COL_TEST   0x0080

Definition at line 79 of file ar8035_driver.h.

◆ AR8035_BMCR_DUPLEX_MODE

#define AR8035_BMCR_DUPLEX_MODE   0x0100

Definition at line 78 of file ar8035_driver.h.

◆ AR8035_BMCR_ISOLATE

#define AR8035_BMCR_ISOLATE   0x0400

Definition at line 76 of file ar8035_driver.h.

◆ AR8035_BMCR_LOOPBACK

#define AR8035_BMCR_LOOPBACK   0x4000

Definition at line 72 of file ar8035_driver.h.

◆ AR8035_BMCR_POWER_DOWN

#define AR8035_BMCR_POWER_DOWN   0x0800

Definition at line 75 of file ar8035_driver.h.

◆ AR8035_BMCR_RESET

#define AR8035_BMCR_RESET   0x8000

Definition at line 71 of file ar8035_driver.h.

◆ AR8035_BMCR_RESTART_AN

#define AR8035_BMCR_RESTART_AN   0x0200

Definition at line 77 of file ar8035_driver.h.

◆ AR8035_BMCR_SPEED_SEL_LSB

#define AR8035_BMCR_SPEED_SEL_LSB   0x2000

Definition at line 73 of file ar8035_driver.h.

◆ AR8035_BMCR_SPEED_SEL_MSB

#define AR8035_BMCR_SPEED_SEL_MSB   0x0040

Definition at line 80 of file ar8035_driver.h.

◆ AR8035_BMSR

#define AR8035_BMSR   0x01

Definition at line 46 of file ar8035_driver.h.

◆ AR8035_BMSR_100BT2_FD

#define AR8035_BMSR_100BT2_FD   0x0400

Definition at line 88 of file ar8035_driver.h.

◆ AR8035_BMSR_100BT2_HD

#define AR8035_BMSR_100BT2_HD   0x0200

Definition at line 89 of file ar8035_driver.h.

◆ AR8035_BMSR_100BT4

#define AR8035_BMSR_100BT4   0x8000

Definition at line 83 of file ar8035_driver.h.

◆ AR8035_BMSR_100BTX_FD

#define AR8035_BMSR_100BTX_FD   0x4000

Definition at line 84 of file ar8035_driver.h.

◆ AR8035_BMSR_100BTX_HD

#define AR8035_BMSR_100BTX_HD   0x2000

Definition at line 85 of file ar8035_driver.h.

◆ AR8035_BMSR_10BT_FD

#define AR8035_BMSR_10BT_FD   0x1000

Definition at line 86 of file ar8035_driver.h.

◆ AR8035_BMSR_10BT_HD

#define AR8035_BMSR_10BT_HD   0x0800

Definition at line 87 of file ar8035_driver.h.

◆ AR8035_BMSR_AN_CAPABLE

#define AR8035_BMSR_AN_CAPABLE   0x0008

Definition at line 94 of file ar8035_driver.h.

◆ AR8035_BMSR_AN_COMPLETE

#define AR8035_BMSR_AN_COMPLETE   0x0020

Definition at line 92 of file ar8035_driver.h.

◆ AR8035_BMSR_EXTENDED_CAPABLE

#define AR8035_BMSR_EXTENDED_CAPABLE   0x0001

Definition at line 97 of file ar8035_driver.h.

◆ AR8035_BMSR_EXTENDED_STATUS

#define AR8035_BMSR_EXTENDED_STATUS   0x0100

Definition at line 90 of file ar8035_driver.h.

◆ AR8035_BMSR_JABBER_DETECT

#define AR8035_BMSR_JABBER_DETECT   0x0002

Definition at line 96 of file ar8035_driver.h.

◆ AR8035_BMSR_LINK_STATUS

#define AR8035_BMSR_LINK_STATUS   0x0004

Definition at line 95 of file ar8035_driver.h.

◆ AR8035_BMSR_MF_PREAMBLE_SUPPR

#define AR8035_BMSR_MF_PREAMBLE_SUPPR   0x0040

Definition at line 91 of file ar8035_driver.h.

◆ AR8035_BMSR_REMOTE_FAULT

#define AR8035_BMSR_REMOTE_FAULT   0x0010

Definition at line 93 of file ar8035_driver.h.

◆ AR8035_CDT_CTRL

#define AR8035_CDT_CTRL   0x16

Definition at line 64 of file ar8035_driver.h.

◆ AR8035_CDT_CTRL_MDI_PAIR_SELECT

#define AR8035_CDT_CTRL_MDI_PAIR_SELECT   0x0300

Definition at line 246 of file ar8035_driver.h.

◆ AR8035_CDT_CTRL_TEST_EN

#define AR8035_CDT_CTRL_TEST_EN   0x0001

Definition at line 247 of file ar8035_driver.h.

◆ AR8035_CDT_STATUS

#define AR8035_CDT_STATUS   0x1C

Definition at line 66 of file ar8035_driver.h.

◆ AR8035_CDT_STATUS_DELTA_TIME

#define AR8035_CDT_STATUS_DELTA_TIME   0x00FF

Definition at line 255 of file ar8035_driver.h.

◆ AR8035_CDT_STATUS_STATUS

#define AR8035_CDT_STATUS_STATUS   0x0300

Definition at line 254 of file ar8035_driver.h.

◆ AR8035_DBG_PORT_ADDR_OFFSET

#define AR8035_DBG_PORT_ADDR_OFFSET   0x1D

Definition at line 67 of file ar8035_driver.h.

◆ AR8035_DBG_PORT_DATA

#define AR8035_DBG_PORT_DATA   0x1E

Definition at line 68 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL

#define AR8035_FUNC_CTRL   0x10

Definition at line 59 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_ASSERT_CRS_ON_TX

#define AR8035_FUNC_CTRL_ASSERT_CRS_ON_TX   0x0800

Definition at line 193 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_JABBER_DIS

#define AR8035_FUNC_CTRL_JABBER_DIS   0x0001

Definition at line 200 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_MDIX_MODE

#define AR8035_FUNC_CTRL_MDIX_MODE   0x0060

Definition at line 194 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_MDIX_MODE_AUTO

#define AR8035_FUNC_CTRL_MDIX_MODE_AUTO   0x0060

Definition at line 197 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_MDIX_MODE_MANUAL_MDI

#define AR8035_FUNC_CTRL_MDIX_MODE_MANUAL_MDI   0x0000

Definition at line 195 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_MDIX_MODE_MANUAL_MDIX

#define AR8035_FUNC_CTRL_MDIX_MODE_MANUAL_MDIX   0x0020

Definition at line 196 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_POLARITY_REVERSAL

#define AR8035_FUNC_CTRL_POLARITY_REVERSAL   0x0002

Definition at line 199 of file ar8035_driver.h.

◆ AR8035_FUNC_CTRL_SQE_TEST

#define AR8035_FUNC_CTRL_SQE_TEST   0x0004

Definition at line 198 of file ar8035_driver.h.

◆ AR8035_GBCR

#define AR8035_GBCR   0x09

Definition at line 54 of file ar8035_driver.h.

◆ AR8035_GBCR_1000BT_FD

#define AR8035_GBCR_1000BT_FD   0x0200

Definition at line 166 of file ar8035_driver.h.

◆ AR8035_GBCR_1000BT_HD

#define AR8035_GBCR_1000BT_HD   0x0100

Definition at line 167 of file ar8035_driver.h.

◆ AR8035_GBCR_MS_MAN_CONF_EN

#define AR8035_GBCR_MS_MAN_CONF_EN   0x1000

Definition at line 163 of file ar8035_driver.h.

◆ AR8035_GBCR_MS_MAN_CONF_VAL

#define AR8035_GBCR_MS_MAN_CONF_VAL   0x0800

Definition at line 164 of file ar8035_driver.h.

◆ AR8035_GBCR_PORT_TYPE

#define AR8035_GBCR_PORT_TYPE   0x0400

Definition at line 165 of file ar8035_driver.h.

◆ AR8035_GBCR_TEST_MODE

#define AR8035_GBCR_TEST_MODE   0xE000

Definition at line 162 of file ar8035_driver.h.

◆ AR8035_GBESR

#define AR8035_GBESR   0x0F

Definition at line 58 of file ar8035_driver.h.

◆ AR8035_GBESR_1000BT_FD

#define AR8035_GBESR_1000BT_FD   0x2000

Definition at line 189 of file ar8035_driver.h.

◆ AR8035_GBESR_1000BT_HD

#define AR8035_GBESR_1000BT_HD   0x1000

Definition at line 190 of file ar8035_driver.h.

◆ AR8035_GBESR_1000BX_FD

#define AR8035_GBESR_1000BX_FD   0x8000

Definition at line 187 of file ar8035_driver.h.

◆ AR8035_GBESR_1000BX_HD

#define AR8035_GBESR_1000BX_HD   0x4000

Definition at line 188 of file ar8035_driver.h.

◆ AR8035_GBSR

#define AR8035_GBSR   0x0A

Definition at line 55 of file ar8035_driver.h.

◆ AR8035_GBSR_IDLE_ERR_COUNT

#define AR8035_GBSR_IDLE_ERR_COUNT   0x00FF

Definition at line 176 of file ar8035_driver.h.

◆ AR8035_GBSR_LOCAL_RECEIVER_STATUS

#define AR8035_GBSR_LOCAL_RECEIVER_STATUS   0x2000

Definition at line 172 of file ar8035_driver.h.

◆ AR8035_GBSR_LP_1000BT_FD

#define AR8035_GBSR_LP_1000BT_FD   0x0800

Definition at line 174 of file ar8035_driver.h.

◆ AR8035_GBSR_LP_1000BT_HD

#define AR8035_GBSR_LP_1000BT_HD   0x0400

Definition at line 175 of file ar8035_driver.h.

◆ AR8035_GBSR_MS_CONF_FAULT

#define AR8035_GBSR_MS_CONF_FAULT   0x8000

Definition at line 170 of file ar8035_driver.h.

◆ AR8035_GBSR_MS_CONF_RES

#define AR8035_GBSR_MS_CONF_RES   0x4000

Definition at line 171 of file ar8035_driver.h.

◆ AR8035_GBSR_REMOTE_RECEIVER_STATUS

#define AR8035_GBSR_REMOTE_RECEIVER_STATUS   0x1000

Definition at line 173 of file ar8035_driver.h.

◆ AR8035_INT_EN

#define AR8035_INT_EN   0x12

Definition at line 61 of file ar8035_driver.h.

◆ AR8035_INT_EN_AN_ERROR

#define AR8035_INT_EN_AN_ERROR   0x8000

Definition at line 219 of file ar8035_driver.h.

◆ AR8035_INT_EN_DUPLEX_CHANGED

#define AR8035_INT_EN_DUPLEX_CHANGED   0x2000

Definition at line 221 of file ar8035_driver.h.

◆ AR8035_INT_EN_LINK_FAIL

#define AR8035_INT_EN_LINK_FAIL   0x0800

Definition at line 223 of file ar8035_driver.h.

◆ AR8035_INT_EN_LINK_SUCCESS

#define AR8035_INT_EN_LINK_SUCCESS   0x0400

Definition at line 224 of file ar8035_driver.h.

◆ AR8035_INT_EN_PAGE_RECEIVED

#define AR8035_INT_EN_PAGE_RECEIVED   0x1000

Definition at line 222 of file ar8035_driver.h.

◆ AR8035_INT_EN_POLARITY_CHANGED

#define AR8035_INT_EN_POLARITY_CHANGED   0x0002

Definition at line 226 of file ar8035_driver.h.

◆ AR8035_INT_EN_SPEED_CHANGED

#define AR8035_INT_EN_SPEED_CHANGED   0x4000

Definition at line 220 of file ar8035_driver.h.

◆ AR8035_INT_EN_WIRESPEED_DOWNGRADE

#define AR8035_INT_EN_WIRESPEED_DOWNGRADE   0x0020

Definition at line 225 of file ar8035_driver.h.

◆ AR8035_INT_EN_WOL_PTP

#define AR8035_INT_EN_WOL_PTP   0x0001

Definition at line 227 of file ar8035_driver.h.

◆ AR8035_INT_STATUS

#define AR8035_INT_STATUS   0x13

Definition at line 62 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_AN_ERROR

#define AR8035_INT_STATUS_AN_ERROR   0x8000

Definition at line 230 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_DUPLEX_CHANGED

#define AR8035_INT_STATUS_DUPLEX_CHANGED   0x2000

Definition at line 232 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_LINK_FAIL

#define AR8035_INT_STATUS_LINK_FAIL   0x0800

Definition at line 234 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_LINK_SUCCESS

#define AR8035_INT_STATUS_LINK_SUCCESS   0x0400

Definition at line 235 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_PAGE_RECEIVED

#define AR8035_INT_STATUS_PAGE_RECEIVED   0x1000

Definition at line 233 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_POLARITY_CHANGED

#define AR8035_INT_STATUS_POLARITY_CHANGED   0x0002

Definition at line 237 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_SPEED_CHANGED

#define AR8035_INT_STATUS_SPEED_CHANGED   0x4000

Definition at line 231 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_WIRESPEED_DOWNGRADE

#define AR8035_INT_STATUS_WIRESPEED_DOWNGRADE   0x0020

Definition at line 236 of file ar8035_driver.h.

◆ AR8035_INT_STATUS_WOL_PTP

#define AR8035_INT_STATUS_WOL_PTP   0x0001

Definition at line 238 of file ar8035_driver.h.

◆ AR8035_LED_CTRL

#define AR8035_LED_CTRL   0x18

Definition at line 65 of file ar8035_driver.h.

◆ AR8035_LED_CTRL_LED_OFF_TIME

#define AR8035_LED_CTRL_LED_OFF_TIME   0x0700

Definition at line 251 of file ar8035_driver.h.

◆ AR8035_LED_CTRL_LED_ON_TIME

#define AR8035_LED_CTRL_LED_ON_TIME   0x7000

Definition at line 250 of file ar8035_driver.h.

◆ AR8035_MMDAADR

#define AR8035_MMDAADR   0x0E

Definition at line 57 of file ar8035_driver.h.

◆ AR8035_MMDACR

#define AR8035_MMDACR   0x0D

Definition at line 56 of file ar8035_driver.h.

◆ AR8035_MMDACR_DEVAD

#define AR8035_MMDACR_DEVAD   0x001F

Definition at line 184 of file ar8035_driver.h.

◆ AR8035_MMDACR_FUNC

#define AR8035_MMDACR_FUNC   0xC000

Definition at line 179 of file ar8035_driver.h.

◆ AR8035_MMDACR_FUNC_ADDR

#define AR8035_MMDACR_FUNC_ADDR   0x0000

Definition at line 180 of file ar8035_driver.h.

◆ AR8035_MMDACR_FUNC_DATA_NO_POST_INC

#define AR8035_MMDACR_FUNC_DATA_NO_POST_INC   0x4000

Definition at line 181 of file ar8035_driver.h.

◆ AR8035_MMDACR_FUNC_DATA_POST_INC_RW

#define AR8035_MMDACR_FUNC_DATA_POST_INC_RW   0x8000

Definition at line 182 of file ar8035_driver.h.

◆ AR8035_MMDACR_FUNC_DATA_POST_INC_W

#define AR8035_MMDACR_FUNC_DATA_POST_INC_W   0xC000

Definition at line 183 of file ar8035_driver.h.

◆ AR8035_PHY_ADDR

#define AR8035_PHY_ADDR   0

Definition at line 39 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS

#define AR8035_PHY_STATUS   0x11

Definition at line 60 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_DUPLEX

#define AR8035_PHY_STATUS_DUPLEX   0x2000

Definition at line 207 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_JABBER

#define AR8035_PHY_STATUS_JABBER   0x0001

Definition at line 216 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_LINK

#define AR8035_PHY_STATUS_LINK   0x0400

Definition at line 210 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_MDI_CROSSOVER_STATUS

#define AR8035_PHY_STATUS_MDI_CROSSOVER_STATUS   0x0040

Definition at line 211 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_PAGE_RECEIVED

#define AR8035_PHY_STATUS_PAGE_RECEIVED   0x1000

Definition at line 208 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_POLARITY

#define AR8035_PHY_STATUS_POLARITY   0x0002

Definition at line 215 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_RX_PAUSE_EN

#define AR8035_PHY_STATUS_RX_PAUSE_EN   0x0004

Definition at line 214 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_SPEED

#define AR8035_PHY_STATUS_SPEED   0xC000

Definition at line 203 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_SPEED_1000MBPS

#define AR8035_PHY_STATUS_SPEED_1000MBPS   0x8000

Definition at line 206 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_SPEED_100MBPS

#define AR8035_PHY_STATUS_SPEED_100MBPS   0x4000

Definition at line 205 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_SPEED_10MBPS

#define AR8035_PHY_STATUS_SPEED_10MBPS   0x0000

Definition at line 204 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_SPEED_DUPLEX_RESOLVED

#define AR8035_PHY_STATUS_SPEED_DUPLEX_RESOLVED   0x0800

Definition at line 209 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_TX_PAUSE_EN

#define AR8035_PHY_STATUS_TX_PAUSE_EN   0x0008

Definition at line 213 of file ar8035_driver.h.

◆ AR8035_PHY_STATUS_WIRESPEED_DOWNGRADE

#define AR8035_PHY_STATUS_WIRESPEED_DOWNGRADE   0x0020

Definition at line 212 of file ar8035_driver.h.

◆ AR8035_PHYID1

#define AR8035_PHYID1   0x02

Definition at line 47 of file ar8035_driver.h.

◆ AR8035_PHYID1_OUI_MSB

#define AR8035_PHYID1_OUI_MSB   0xFFFF

Definition at line 100 of file ar8035_driver.h.

◆ AR8035_PHYID1_OUI_MSB_DEFAULT

#define AR8035_PHYID1_OUI_MSB_DEFAULT   0x004D

Definition at line 101 of file ar8035_driver.h.

◆ AR8035_PHYID2

#define AR8035_PHYID2   0x03

Definition at line 48 of file ar8035_driver.h.

◆ AR8035_PHYID2_MODEL_NUM

#define AR8035_PHYID2_MODEL_NUM   0x03F0

Definition at line 106 of file ar8035_driver.h.

◆ AR8035_PHYID2_MODEL_NUM_DEFAULT

#define AR8035_PHYID2_MODEL_NUM_DEFAULT   0x0070

Definition at line 107 of file ar8035_driver.h.

◆ AR8035_PHYID2_OUI_LSB

#define AR8035_PHYID2_OUI_LSB   0xFC00

Definition at line 104 of file ar8035_driver.h.

◆ AR8035_PHYID2_OUI_LSB_DEFAULT

#define AR8035_PHYID2_OUI_LSB_DEFAULT   0xD000

Definition at line 105 of file ar8035_driver.h.

◆ AR8035_PHYID2_REVISION_NUM

#define AR8035_PHYID2_REVISION_NUM   0x000F

Definition at line 108 of file ar8035_driver.h.

◆ AR8035_SMART_SPEED

#define AR8035_SMART_SPEED   0x14

Definition at line 63 of file ar8035_driver.h.

◆ AR8035_SMART_SPEED_BYPASS_TIMER

#define AR8035_SMART_SPEED_BYPASS_TIMER   0x0002

Definition at line 243 of file ar8035_driver.h.

◆ AR8035_SMART_SPEED_EN

#define AR8035_SMART_SPEED_EN   0x0020

Definition at line 241 of file ar8035_driver.h.

◆ AR8035_SMART_SPEED_RETRY_LIMIT

#define AR8035_SMART_SPEED_RETRY_LIMIT   0x001C

Definition at line 242 of file ar8035_driver.h.

Function Documentation

◆ ar8035DisableIrq()

void ar8035DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 181 of file ar8035_driver.c.

◆ ar8035DumpPhyReg()

void ar8035DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 294 of file ar8035_driver.c.

◆ ar8035EnableIrq()

void ar8035EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 166 of file ar8035_driver.c.

◆ ar8035EventHandler()

void ar8035EventHandler ( NetInterface interface)

AR8035 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 196 of file ar8035_driver.c.

◆ ar8035Init()

error_t ar8035Init ( NetInterface interface)

AR8035 PHY transceiver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 62 of file ar8035_driver.c.

◆ ar8035ReadPhyReg()

uint16_t ar8035ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

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

Definition at line 281 of file ar8035_driver.c.

◆ ar8035Tick()

void ar8035Tick ( NetInterface interface)

AR8035 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 128 of file ar8035_driver.c.

◆ ar8035WritePhyReg()

void ar8035WritePhyReg ( 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 265 of file ar8035_driver.c.

Variable Documentation

◆ ar8035PhyDriver

const PhyDriver ar8035PhyDriver

AR8035 Ethernet PHY driver.

Definition at line 44 of file ar8035_driver.c.