dp83848_driver.h File Reference

DP83848 Ethernet PHY driver. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define DP83848_PHY_ADDR   1
 
#define DP83848_BMCR   0x00
 
#define DP83848_BMSR   0x01
 
#define DP83848_PHYIDR1   0x02
 
#define DP83848_PHYIDR2   0x03
 
#define DP83848_ANAR   0x04
 
#define DP83848_ANLPAR   0x05
 
#define DP83848_ANER   0x06
 
#define DP83848_ANNPTR   0x07
 
#define DP83848_PHYSTS   0x10
 
#define DP83848_MICR   0x11
 
#define DP83848_MISR   0x12
 
#define DP83848_FCSCR   0x14
 
#define DP83848_RECR   0x15
 
#define DP83848_PCSR   0x16
 
#define DP83848_RBR   0x17
 
#define DP83848_LEDCR   0x18
 
#define DP83848_PHYCR   0x19
 
#define DP83848_10BTSCR   0x1A
 
#define DP83848_CDCTRL1   0x1B
 
#define DP83848_EDCR   0x1D
 
#define DP83848_BMCR_RESET   0x8000
 
#define DP83848_BMCR_LOOPBACK   0x4000
 
#define DP83848_BMCR_SPEED_SEL   0x2000
 
#define DP83848_BMCR_AN_EN   0x1000
 
#define DP83848_BMCR_POWER_DOWN   0x0800
 
#define DP83848_BMCR_ISOLATE   0x0400
 
#define DP83848_BMCR_RESTART_AN   0x0200
 
#define DP83848_BMCR_DUPLEX_MODE   0x0100
 
#define DP83848_BMCR_COL_TEST   0x0080
 
#define DP83848_BMSR_100BT4   0x8000
 
#define DP83848_BMSR_100BTX_FD   0x4000
 
#define DP83848_BMSR_100BTX_HD   0x2000
 
#define DP83848_BMSR_10BT_FD   0x1000
 
#define DP83848_BMSR_10BT_HD   0x0800
 
#define DP83848_BMSR_MF_PREAMBLE_SUPPR   0x0040
 
#define DP83848_BMSR_AN_COMPLETE   0x0020
 
#define DP83848_BMSR_REMOTE_FAULT   0x0010
 
#define DP83848_BMSR_AN_CAPABLE   0x0008
 
#define DP83848_BMSR_LINK_STATUS   0x0004
 
#define DP83848_BMSR_JABBER_DETECT   0x0002
 
#define DP83848_BMSR_EXTENDED_CAPABLE   0x0001
 
#define DP83848_PHYIDR1_OUI_MSB   0xFFFF
 
#define DP83848_PHYIDR1_OUI_MSB_DEFAULT   0x2000
 
#define DP83848_PHYIDR2_OUI_LSB   0xFC00
 
#define DP83848_PHYIDR2_OUI_LSB_DEFAULT   0x5C00
 
#define DP83848_PHYIDR2_VNDR_MDL   0x03F0
 
#define DP83848_PHYIDR2_VNDR_MDL_DEFAULT   0x0090
 
#define DP83848_PHYIDR2_MDL_REV   0x000F
 
#define DP83848_ANAR_NEXT_PAGE   0x8000
 
#define DP83848_ANAR_REMOTE_FAULT   0x2000
 
#define DP83848_ANAR_ASM_DIR   0x0800
 
#define DP83848_ANAR_PAUSE   0x0400
 
#define DP83848_ANAR_100BT4   0x0200
 
#define DP83848_ANAR_100BTX_FD   0x0100
 
#define DP83848_ANAR_100BTX_HD   0x0080
 
#define DP83848_ANAR_10BT_FD   0x0040
 
#define DP83848_ANAR_10BT_HD   0x0020
 
#define DP83848_ANAR_SELECTOR   0x001F
 
#define DP83848_ANAR_SELECTOR_DEFAULT   0x0001
 
#define DP83848_ANLPAR_NEXT_PAGE   0x8000
 
#define DP83848_ANLPAR_ACK   0x4000
 
#define DP83848_ANLPAR_REMOTE_FAULT   0x2000
 
#define DP83848_ANLPAR_ASM_DIR   0x0800
 
#define DP83848_ANLPAR_PAUSE   0x0400
 
#define DP83848_ANLPAR_100BT4   0x0200
 
#define DP83848_ANLPAR_100BTX_FD   0x0100
 
#define DP83848_ANLPAR_100BTX_HD   0x0080
 
#define DP83848_ANLPAR_10BT_FD   0x0040
 
#define DP83848_ANLPAR_10BT_HD   0x0020
 
#define DP83848_ANLPAR_SELECTOR   0x001F
 
#define DP83848_ANLPAR_SELECTOR_DEFAULT   0x0001
 
#define DP83848_ANER_PAR_DETECT_FAULT   0x0010
 
#define DP83848_ANER_LP_NP_ABLE   0x0008
 
#define DP83848_ANER_NP_ABLE   0x0004
 
#define DP83848_ANER_PAGE_RX   0x0002
 
#define DP83848_ANER_LP_AN_ABLE   0x0001
 
#define DP83848_ANNPTR_NEXT_PAGE   0x8000
 
#define DP83848_ANNPTR_MSG_PAGE   0x2000
 
#define DP83848_ANNPTR_ACK2   0x1000
 
#define DP83848_ANNPTR_TOGGLE   0x0800
 
#define DP83848_ANNPTR_CODE   0x07FF
 
#define DP83848_PHYSTS_MDIX_MODE   0x4000
 
#define DP83848_PHYSTS_RECEIVE_ERROR_LATCH   0x2000
 
#define DP83848_PHYSTS_POLARITY_STATUS   0x1000
 
#define DP83848_PHYSTS_FALSE_CARRIER_SENSE_LATCH   0x0800
 
#define DP83848_PHYSTS_SIGNAL_DETECT   0x0400
 
#define DP83848_PHYSTS_DESCRAMBLER_LOCK   0x0200
 
#define DP83848_PHYSTS_PAGE_RECEIVED   0x0100
 
#define DP83848_PHYSTS_MII_INTERRUPT   0x0080
 
#define DP83848_PHYSTS_REMOTE_FAULT   0x0040
 
#define DP83848_PHYSTS_JABBER_DETECT   0x0020
 
#define DP83848_PHYSTS_AN_COMPLETE   0x0010
 
#define DP83848_PHYSTS_LOOPBACK_STATUS   0x0008
 
#define DP83848_PHYSTS_DUPLEX_STATUS   0x0004
 
#define DP83848_PHYSTS_SPEED_STATUS   0x0002
 
#define DP83848_PHYSTS_LINK_STATUS   0x0001
 
#define DP83848_MICR_TINT   0x0004
 
#define DP83848_MICR_INTEN   0x0002
 
#define DP83848_MICR_INT_OE   0x0001
 
#define DP83848_MISR_ED_INT   0x4000
 
#define DP83848_MISR_LINK_INT   0x2000
 
#define DP83848_MISR_SPD_INT   0x1000
 
#define DP83848_MISR_DUP_INT   0x0800
 
#define DP83848_MISR_ANC_INT   0x0400
 
#define DP83848_MISR_FHF_INT   0x0200
 
#define DP83848_MISR_RHF_INT   0x0100
 
#define DP83848_MISR_ED_INT_EN   0x0040
 
#define DP83848_MISR_LINK_INT_EN   0x0020
 
#define DP83848_MISR_SPD_INT_EN   0x0010
 
#define DP83848_MISR_DUP_INT_EN   0x0008
 
#define DP83848_MISR_ANC_INT_EN   0x0004
 
#define DP83848_MISR_FHF_INT_EN   0x0002
 
#define DP83848_MISR_RHF_INT_EN   0x0001
 
#define DP83848_FCSCR_FCSCNT   0x00FF
 
#define DP83848_RECR_RXERCNT   0x00FF
 
#define DP83848_PCSR_TQ_EN   0x0400
 
#define DP83848_PCSR_SD_FORCE_PMA   0x0200
 
#define DP83848_PCSR_SD_OPTION   0x0100
 
#define DP83848_PCSR_DESC_TIME   0x0080
 
#define DP83848_PCSR_FORCE_100_OK   0x0020
 
#define DP83848_PCSR_NRZI_BYPASS   0x0004
 
#define DP83848_RBR_RMII_MODE   0x0020
 
#define DP83848_RBR_RMII_REV1_0   0x0010
 
#define DP83848_RBR_RX_OVF_STS   0x0008
 
#define DP83848_RBR_RX_UNF_STS   0x0004
 
#define DP83848_RBR_ELAST_BUF   0x0003
 
#define DP83848_LEDCR_DRV_SPDLED   0x0020
 
#define DP83848_LEDCR_DRV_LNKLED   0x0010
 
#define DP83848_LEDCR_DRV_ACTLED   0x0008
 
#define DP83848_LEDCR_SPDLED   0x0004
 
#define DP83848_LEDCR_LNKLED   0x0002
 
#define DP83848_LEDCR_ACTLED   0x0001
 
#define DP83848_PHYCR_MDIX_EN   0x8000
 
#define DP83848_PHYCR_FORCE_MDIX   0x4000
 
#define DP83848_PHYCR_PAUSE_RX   0x2000
 
#define DP83848_PHYCR_PAUSE_TX   0x1000
 
#define DP83848_PHYCR_BIST_FE   0x0800
 
#define DP83848_PHYCR_PSR_15   0x0400
 
#define DP83848_PHYCR_BIST_STATUS   0x0200
 
#define DP83848_PHYCR_BIST_START   0x0100
 
#define DP83848_PHYCR_BP_STRETCH   0x0080
 
#define DP83848_PHYCR_LED_CNFG   0x0060
 
#define DP83848_PHYCR_PHYADDR   0x001F
 
#define DP83848_10BTSCR_10BT_SERIAL   0x8000
 
#define DP83848_10BTSCR_SQUELCH   0x0E00
 
#define DP83848_10BTSCR_LOOPBACK_10_DIS   0x0100
 
#define DP83848_10BTSCR_LP_DIS   0x0080
 
#define DP83848_10BTSCR_FORCE_LINK_10   0x0040
 
#define DP83848_10BTSCR_POLARITY   0x0010
 
#define DP83848_10BTSCR_HEARTBEAT_DIS   0x0002
 
#define DP83848_10BTSCR_JABBER_DIS   0x0001
 
#define DP83848_CDCTRL1_BIST_ERROR_COUNT   0xFF00
 
#define DP83848_CDCTRL1_BIST_CONT_MODE   0x0020
 
#define DP83848_CDCTRL1_CDPATTEN_10   0x0010
 
#define DP83848_CDCTRL1_10MEG_PATT_GAP   0x0004
 
#define DP83848_CDCTRL1_CDPATTSEL   0x0003
 
#define DP83848_EDCR_ED_EN   0x8000
 
#define DP83848_EDCR_ED_AUTO_UP   0x4000
 
#define DP83848_EDCR_ED_AUTO_DOWN   0x2000
 
#define DP83848_EDCR_ED_MAN   0x1000
 
#define DP83848_EDCR_ED_BURST_DIS   0x0800
 
#define DP83848_EDCR_ED_PWR_STATE   0x0400
 
#define DP83848_EDCR_ED_ERR_MET   0x0200
 
#define DP83848_EDCR_ED_DATA_MET   0x0100
 
#define DP83848_EDCR_ED_ERR_COUNT   0x00F0
 
#define DP83848_EDCR_ED_DATA_COUNT   0x000F
 

Functions

error_t dp83848Init (NetInterface *interface)
 DP83848 PHY transceiver initialization. More...
 
void dp83848InitHook (NetInterface *interface)
 DP83848 custom configuration. More...
 
void dp83848Tick (NetInterface *interface)
 DP83848 timer handler. More...
 
void dp83848EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void dp83848DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void dp83848EventHandler (NetInterface *interface)
 DP83848 event handler. More...
 
void dp83848WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t dp83848ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void dp83848DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const PhyDriver dp83848PhyDriver
 DP83848 Ethernet PHY driver. More...
 

Detailed Description

DP83848 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 dp83848_driver.h.

Macro Definition Documentation

◆ DP83848_10BTSCR

#define DP83848_10BTSCR   0x1A

Definition at line 62 of file dp83848_driver.h.

◆ DP83848_10BTSCR_10BT_SERIAL

#define DP83848_10BTSCR_10BT_SERIAL   0x8000

Definition at line 224 of file dp83848_driver.h.

◆ DP83848_10BTSCR_FORCE_LINK_10

#define DP83848_10BTSCR_FORCE_LINK_10   0x0040

Definition at line 228 of file dp83848_driver.h.

◆ DP83848_10BTSCR_HEARTBEAT_DIS

#define DP83848_10BTSCR_HEARTBEAT_DIS   0x0002

Definition at line 230 of file dp83848_driver.h.

◆ DP83848_10BTSCR_JABBER_DIS

#define DP83848_10BTSCR_JABBER_DIS   0x0001

Definition at line 231 of file dp83848_driver.h.

◆ DP83848_10BTSCR_LOOPBACK_10_DIS

#define DP83848_10BTSCR_LOOPBACK_10_DIS   0x0100

Definition at line 226 of file dp83848_driver.h.

◆ DP83848_10BTSCR_LP_DIS

#define DP83848_10BTSCR_LP_DIS   0x0080

Definition at line 227 of file dp83848_driver.h.

◆ DP83848_10BTSCR_POLARITY

#define DP83848_10BTSCR_POLARITY   0x0010

Definition at line 229 of file dp83848_driver.h.

◆ DP83848_10BTSCR_SQUELCH

#define DP83848_10BTSCR_SQUELCH   0x0E00

Definition at line 225 of file dp83848_driver.h.

◆ DP83848_ANAR

#define DP83848_ANAR   0x04

Definition at line 49 of file dp83848_driver.h.

◆ DP83848_ANAR_100BT4

#define DP83848_ANAR_100BT4   0x0200

Definition at line 107 of file dp83848_driver.h.

◆ DP83848_ANAR_100BTX_FD

#define DP83848_ANAR_100BTX_FD   0x0100

Definition at line 108 of file dp83848_driver.h.

◆ DP83848_ANAR_100BTX_HD

#define DP83848_ANAR_100BTX_HD   0x0080

Definition at line 109 of file dp83848_driver.h.

◆ DP83848_ANAR_10BT_FD

#define DP83848_ANAR_10BT_FD   0x0040

Definition at line 110 of file dp83848_driver.h.

◆ DP83848_ANAR_10BT_HD

#define DP83848_ANAR_10BT_HD   0x0020

Definition at line 111 of file dp83848_driver.h.

◆ DP83848_ANAR_ASM_DIR

#define DP83848_ANAR_ASM_DIR   0x0800

Definition at line 105 of file dp83848_driver.h.

◆ DP83848_ANAR_NEXT_PAGE

#define DP83848_ANAR_NEXT_PAGE   0x8000

Definition at line 103 of file dp83848_driver.h.

◆ DP83848_ANAR_PAUSE

#define DP83848_ANAR_PAUSE   0x0400

Definition at line 106 of file dp83848_driver.h.

◆ DP83848_ANAR_REMOTE_FAULT

#define DP83848_ANAR_REMOTE_FAULT   0x2000

Definition at line 104 of file dp83848_driver.h.

◆ DP83848_ANAR_SELECTOR

#define DP83848_ANAR_SELECTOR   0x001F

Definition at line 112 of file dp83848_driver.h.

◆ DP83848_ANAR_SELECTOR_DEFAULT

#define DP83848_ANAR_SELECTOR_DEFAULT   0x0001

Definition at line 113 of file dp83848_driver.h.

◆ DP83848_ANER

#define DP83848_ANER   0x06

Definition at line 51 of file dp83848_driver.h.

◆ DP83848_ANER_LP_AN_ABLE

#define DP83848_ANER_LP_AN_ABLE   0x0001

Definition at line 134 of file dp83848_driver.h.

◆ DP83848_ANER_LP_NP_ABLE

#define DP83848_ANER_LP_NP_ABLE   0x0008

Definition at line 131 of file dp83848_driver.h.

◆ DP83848_ANER_NP_ABLE

#define DP83848_ANER_NP_ABLE   0x0004

Definition at line 132 of file dp83848_driver.h.

◆ DP83848_ANER_PAGE_RX

#define DP83848_ANER_PAGE_RX   0x0002

Definition at line 133 of file dp83848_driver.h.

◆ DP83848_ANER_PAR_DETECT_FAULT

#define DP83848_ANER_PAR_DETECT_FAULT   0x0010

Definition at line 130 of file dp83848_driver.h.

◆ DP83848_ANLPAR

#define DP83848_ANLPAR   0x05

Definition at line 50 of file dp83848_driver.h.

◆ DP83848_ANLPAR_100BT4

#define DP83848_ANLPAR_100BT4   0x0200

Definition at line 121 of file dp83848_driver.h.

◆ DP83848_ANLPAR_100BTX_FD

#define DP83848_ANLPAR_100BTX_FD   0x0100

Definition at line 122 of file dp83848_driver.h.

◆ DP83848_ANLPAR_100BTX_HD

#define DP83848_ANLPAR_100BTX_HD   0x0080

Definition at line 123 of file dp83848_driver.h.

◆ DP83848_ANLPAR_10BT_FD

#define DP83848_ANLPAR_10BT_FD   0x0040

Definition at line 124 of file dp83848_driver.h.

◆ DP83848_ANLPAR_10BT_HD

#define DP83848_ANLPAR_10BT_HD   0x0020

Definition at line 125 of file dp83848_driver.h.

◆ DP83848_ANLPAR_ACK

#define DP83848_ANLPAR_ACK   0x4000

Definition at line 117 of file dp83848_driver.h.

◆ DP83848_ANLPAR_ASM_DIR

#define DP83848_ANLPAR_ASM_DIR   0x0800

Definition at line 119 of file dp83848_driver.h.

◆ DP83848_ANLPAR_NEXT_PAGE

#define DP83848_ANLPAR_NEXT_PAGE   0x8000

Definition at line 116 of file dp83848_driver.h.

◆ DP83848_ANLPAR_PAUSE

#define DP83848_ANLPAR_PAUSE   0x0400

Definition at line 120 of file dp83848_driver.h.

◆ DP83848_ANLPAR_REMOTE_FAULT

#define DP83848_ANLPAR_REMOTE_FAULT   0x2000

Definition at line 118 of file dp83848_driver.h.

◆ DP83848_ANLPAR_SELECTOR

#define DP83848_ANLPAR_SELECTOR   0x001F

Definition at line 126 of file dp83848_driver.h.

◆ DP83848_ANLPAR_SELECTOR_DEFAULT

#define DP83848_ANLPAR_SELECTOR_DEFAULT   0x0001

Definition at line 127 of file dp83848_driver.h.

◆ DP83848_ANNPTR

#define DP83848_ANNPTR   0x07

Definition at line 52 of file dp83848_driver.h.

◆ DP83848_ANNPTR_ACK2

#define DP83848_ANNPTR_ACK2   0x1000

Definition at line 139 of file dp83848_driver.h.

◆ DP83848_ANNPTR_CODE

#define DP83848_ANNPTR_CODE   0x07FF

Definition at line 141 of file dp83848_driver.h.

◆ DP83848_ANNPTR_MSG_PAGE

#define DP83848_ANNPTR_MSG_PAGE   0x2000

Definition at line 138 of file dp83848_driver.h.

◆ DP83848_ANNPTR_NEXT_PAGE

#define DP83848_ANNPTR_NEXT_PAGE   0x8000

Definition at line 137 of file dp83848_driver.h.

◆ DP83848_ANNPTR_TOGGLE

#define DP83848_ANNPTR_TOGGLE   0x0800

Definition at line 140 of file dp83848_driver.h.

◆ DP83848_BMCR

#define DP83848_BMCR   0x00

Definition at line 45 of file dp83848_driver.h.

◆ DP83848_BMCR_AN_EN

#define DP83848_BMCR_AN_EN   0x1000

Definition at line 70 of file dp83848_driver.h.

◆ DP83848_BMCR_COL_TEST

#define DP83848_BMCR_COL_TEST   0x0080

Definition at line 75 of file dp83848_driver.h.

◆ DP83848_BMCR_DUPLEX_MODE

#define DP83848_BMCR_DUPLEX_MODE   0x0100

Definition at line 74 of file dp83848_driver.h.

◆ DP83848_BMCR_ISOLATE

#define DP83848_BMCR_ISOLATE   0x0400

Definition at line 72 of file dp83848_driver.h.

◆ DP83848_BMCR_LOOPBACK

#define DP83848_BMCR_LOOPBACK   0x4000

Definition at line 68 of file dp83848_driver.h.

◆ DP83848_BMCR_POWER_DOWN

#define DP83848_BMCR_POWER_DOWN   0x0800

Definition at line 71 of file dp83848_driver.h.

◆ DP83848_BMCR_RESET

#define DP83848_BMCR_RESET   0x8000

Definition at line 67 of file dp83848_driver.h.

◆ DP83848_BMCR_RESTART_AN

#define DP83848_BMCR_RESTART_AN   0x0200

Definition at line 73 of file dp83848_driver.h.

◆ DP83848_BMCR_SPEED_SEL

#define DP83848_BMCR_SPEED_SEL   0x2000

Definition at line 69 of file dp83848_driver.h.

◆ DP83848_BMSR

#define DP83848_BMSR   0x01

Definition at line 46 of file dp83848_driver.h.

◆ DP83848_BMSR_100BT4

#define DP83848_BMSR_100BT4   0x8000

Definition at line 78 of file dp83848_driver.h.

◆ DP83848_BMSR_100BTX_FD

#define DP83848_BMSR_100BTX_FD   0x4000

Definition at line 79 of file dp83848_driver.h.

◆ DP83848_BMSR_100BTX_HD

#define DP83848_BMSR_100BTX_HD   0x2000

Definition at line 80 of file dp83848_driver.h.

◆ DP83848_BMSR_10BT_FD

#define DP83848_BMSR_10BT_FD   0x1000

Definition at line 81 of file dp83848_driver.h.

◆ DP83848_BMSR_10BT_HD

#define DP83848_BMSR_10BT_HD   0x0800

Definition at line 82 of file dp83848_driver.h.

◆ DP83848_BMSR_AN_CAPABLE

#define DP83848_BMSR_AN_CAPABLE   0x0008

Definition at line 86 of file dp83848_driver.h.

◆ DP83848_BMSR_AN_COMPLETE

#define DP83848_BMSR_AN_COMPLETE   0x0020

Definition at line 84 of file dp83848_driver.h.

◆ DP83848_BMSR_EXTENDED_CAPABLE

#define DP83848_BMSR_EXTENDED_CAPABLE   0x0001

Definition at line 89 of file dp83848_driver.h.

◆ DP83848_BMSR_JABBER_DETECT

#define DP83848_BMSR_JABBER_DETECT   0x0002

Definition at line 88 of file dp83848_driver.h.

◆ DP83848_BMSR_LINK_STATUS

#define DP83848_BMSR_LINK_STATUS   0x0004

Definition at line 87 of file dp83848_driver.h.

◆ DP83848_BMSR_MF_PREAMBLE_SUPPR

#define DP83848_BMSR_MF_PREAMBLE_SUPPR   0x0040

Definition at line 83 of file dp83848_driver.h.

◆ DP83848_BMSR_REMOTE_FAULT

#define DP83848_BMSR_REMOTE_FAULT   0x0010

Definition at line 85 of file dp83848_driver.h.

◆ DP83848_CDCTRL1

#define DP83848_CDCTRL1   0x1B

Definition at line 63 of file dp83848_driver.h.

◆ DP83848_CDCTRL1_10MEG_PATT_GAP

#define DP83848_CDCTRL1_10MEG_PATT_GAP   0x0004

Definition at line 237 of file dp83848_driver.h.

◆ DP83848_CDCTRL1_BIST_CONT_MODE

#define DP83848_CDCTRL1_BIST_CONT_MODE   0x0020

Definition at line 235 of file dp83848_driver.h.

◆ DP83848_CDCTRL1_BIST_ERROR_COUNT

#define DP83848_CDCTRL1_BIST_ERROR_COUNT   0xFF00

Definition at line 234 of file dp83848_driver.h.

◆ DP83848_CDCTRL1_CDPATTEN_10

#define DP83848_CDCTRL1_CDPATTEN_10   0x0010

Definition at line 236 of file dp83848_driver.h.

◆ DP83848_CDCTRL1_CDPATTSEL

#define DP83848_CDCTRL1_CDPATTSEL   0x0003

Definition at line 238 of file dp83848_driver.h.

◆ DP83848_EDCR

#define DP83848_EDCR   0x1D

Definition at line 64 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_AUTO_DOWN

#define DP83848_EDCR_ED_AUTO_DOWN   0x2000

Definition at line 243 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_AUTO_UP

#define DP83848_EDCR_ED_AUTO_UP   0x4000

Definition at line 242 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_BURST_DIS

#define DP83848_EDCR_ED_BURST_DIS   0x0800

Definition at line 245 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_DATA_COUNT

#define DP83848_EDCR_ED_DATA_COUNT   0x000F

Definition at line 250 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_DATA_MET

#define DP83848_EDCR_ED_DATA_MET   0x0100

Definition at line 248 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_EN

#define DP83848_EDCR_ED_EN   0x8000

Definition at line 241 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_ERR_COUNT

#define DP83848_EDCR_ED_ERR_COUNT   0x00F0

Definition at line 249 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_ERR_MET

#define DP83848_EDCR_ED_ERR_MET   0x0200

Definition at line 247 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_MAN

#define DP83848_EDCR_ED_MAN   0x1000

Definition at line 244 of file dp83848_driver.h.

◆ DP83848_EDCR_ED_PWR_STATE

#define DP83848_EDCR_ED_PWR_STATE   0x0400

Definition at line 246 of file dp83848_driver.h.

◆ DP83848_FCSCR

#define DP83848_FCSCR   0x14

Definition at line 56 of file dp83848_driver.h.

◆ DP83848_FCSCR_FCSCNT

#define DP83848_FCSCR_FCSCNT   0x00FF

Definition at line 182 of file dp83848_driver.h.

◆ DP83848_LEDCR

#define DP83848_LEDCR   0x18

Definition at line 60 of file dp83848_driver.h.

◆ DP83848_LEDCR_ACTLED

#define DP83848_LEDCR_ACTLED   0x0001

Definition at line 208 of file dp83848_driver.h.

◆ DP83848_LEDCR_DRV_ACTLED

#define DP83848_LEDCR_DRV_ACTLED   0x0008

Definition at line 205 of file dp83848_driver.h.

◆ DP83848_LEDCR_DRV_LNKLED

#define DP83848_LEDCR_DRV_LNKLED   0x0010

Definition at line 204 of file dp83848_driver.h.

◆ DP83848_LEDCR_DRV_SPDLED

#define DP83848_LEDCR_DRV_SPDLED   0x0020

Definition at line 203 of file dp83848_driver.h.

◆ DP83848_LEDCR_LNKLED

#define DP83848_LEDCR_LNKLED   0x0002

Definition at line 207 of file dp83848_driver.h.

◆ DP83848_LEDCR_SPDLED

#define DP83848_LEDCR_SPDLED   0x0004

Definition at line 206 of file dp83848_driver.h.

◆ DP83848_MICR

#define DP83848_MICR   0x11

Definition at line 54 of file dp83848_driver.h.

◆ DP83848_MICR_INT_OE

#define DP83848_MICR_INT_OE   0x0001

Definition at line 163 of file dp83848_driver.h.

◆ DP83848_MICR_INTEN

#define DP83848_MICR_INTEN   0x0002

Definition at line 162 of file dp83848_driver.h.

◆ DP83848_MICR_TINT

#define DP83848_MICR_TINT   0x0004

Definition at line 161 of file dp83848_driver.h.

◆ DP83848_MISR

#define DP83848_MISR   0x12

Definition at line 55 of file dp83848_driver.h.

◆ DP83848_MISR_ANC_INT

#define DP83848_MISR_ANC_INT   0x0400

Definition at line 170 of file dp83848_driver.h.

◆ DP83848_MISR_ANC_INT_EN

#define DP83848_MISR_ANC_INT_EN   0x0004

Definition at line 177 of file dp83848_driver.h.

◆ DP83848_MISR_DUP_INT

#define DP83848_MISR_DUP_INT   0x0800

Definition at line 169 of file dp83848_driver.h.

◆ DP83848_MISR_DUP_INT_EN

#define DP83848_MISR_DUP_INT_EN   0x0008

Definition at line 176 of file dp83848_driver.h.

◆ DP83848_MISR_ED_INT

#define DP83848_MISR_ED_INT   0x4000

Definition at line 166 of file dp83848_driver.h.

◆ DP83848_MISR_ED_INT_EN

#define DP83848_MISR_ED_INT_EN   0x0040

Definition at line 173 of file dp83848_driver.h.

◆ DP83848_MISR_FHF_INT

#define DP83848_MISR_FHF_INT   0x0200

Definition at line 171 of file dp83848_driver.h.

◆ DP83848_MISR_FHF_INT_EN

#define DP83848_MISR_FHF_INT_EN   0x0002

Definition at line 178 of file dp83848_driver.h.

◆ DP83848_MISR_LINK_INT

#define DP83848_MISR_LINK_INT   0x2000

Definition at line 167 of file dp83848_driver.h.

◆ DP83848_MISR_LINK_INT_EN

#define DP83848_MISR_LINK_INT_EN   0x0020

Definition at line 174 of file dp83848_driver.h.

◆ DP83848_MISR_RHF_INT

#define DP83848_MISR_RHF_INT   0x0100

Definition at line 172 of file dp83848_driver.h.

◆ DP83848_MISR_RHF_INT_EN

#define DP83848_MISR_RHF_INT_EN   0x0001

Definition at line 179 of file dp83848_driver.h.

◆ DP83848_MISR_SPD_INT

#define DP83848_MISR_SPD_INT   0x1000

Definition at line 168 of file dp83848_driver.h.

◆ DP83848_MISR_SPD_INT_EN

#define DP83848_MISR_SPD_INT_EN   0x0010

Definition at line 175 of file dp83848_driver.h.

◆ DP83848_PCSR

#define DP83848_PCSR   0x16

Definition at line 58 of file dp83848_driver.h.

◆ DP83848_PCSR_DESC_TIME

#define DP83848_PCSR_DESC_TIME   0x0080

Definition at line 191 of file dp83848_driver.h.

◆ DP83848_PCSR_FORCE_100_OK

#define DP83848_PCSR_FORCE_100_OK   0x0020

Definition at line 192 of file dp83848_driver.h.

◆ DP83848_PCSR_NRZI_BYPASS

#define DP83848_PCSR_NRZI_BYPASS   0x0004

Definition at line 193 of file dp83848_driver.h.

◆ DP83848_PCSR_SD_FORCE_PMA

#define DP83848_PCSR_SD_FORCE_PMA   0x0200

Definition at line 189 of file dp83848_driver.h.

◆ DP83848_PCSR_SD_OPTION

#define DP83848_PCSR_SD_OPTION   0x0100

Definition at line 190 of file dp83848_driver.h.

◆ DP83848_PCSR_TQ_EN

#define DP83848_PCSR_TQ_EN   0x0400

Definition at line 188 of file dp83848_driver.h.

◆ DP83848_PHY_ADDR

#define DP83848_PHY_ADDR   1

Definition at line 39 of file dp83848_driver.h.

◆ DP83848_PHYCR

#define DP83848_PHYCR   0x19

Definition at line 61 of file dp83848_driver.h.

◆ DP83848_PHYCR_BIST_FE

#define DP83848_PHYCR_BIST_FE   0x0800

Definition at line 215 of file dp83848_driver.h.

◆ DP83848_PHYCR_BIST_START

#define DP83848_PHYCR_BIST_START   0x0100

Definition at line 218 of file dp83848_driver.h.

◆ DP83848_PHYCR_BIST_STATUS

#define DP83848_PHYCR_BIST_STATUS   0x0200

Definition at line 217 of file dp83848_driver.h.

◆ DP83848_PHYCR_BP_STRETCH

#define DP83848_PHYCR_BP_STRETCH   0x0080

Definition at line 219 of file dp83848_driver.h.

◆ DP83848_PHYCR_FORCE_MDIX

#define DP83848_PHYCR_FORCE_MDIX   0x4000

Definition at line 212 of file dp83848_driver.h.

◆ DP83848_PHYCR_LED_CNFG

#define DP83848_PHYCR_LED_CNFG   0x0060

Definition at line 220 of file dp83848_driver.h.

◆ DP83848_PHYCR_MDIX_EN

#define DP83848_PHYCR_MDIX_EN   0x8000

Definition at line 211 of file dp83848_driver.h.

◆ DP83848_PHYCR_PAUSE_RX

#define DP83848_PHYCR_PAUSE_RX   0x2000

Definition at line 213 of file dp83848_driver.h.

◆ DP83848_PHYCR_PAUSE_TX

#define DP83848_PHYCR_PAUSE_TX   0x1000

Definition at line 214 of file dp83848_driver.h.

◆ DP83848_PHYCR_PHYADDR

#define DP83848_PHYCR_PHYADDR   0x001F

Definition at line 221 of file dp83848_driver.h.

◆ DP83848_PHYCR_PSR_15

#define DP83848_PHYCR_PSR_15   0x0400

Definition at line 216 of file dp83848_driver.h.

◆ DP83848_PHYIDR1

#define DP83848_PHYIDR1   0x02

Definition at line 47 of file dp83848_driver.h.

◆ DP83848_PHYIDR1_OUI_MSB

#define DP83848_PHYIDR1_OUI_MSB   0xFFFF

Definition at line 92 of file dp83848_driver.h.

◆ DP83848_PHYIDR1_OUI_MSB_DEFAULT

#define DP83848_PHYIDR1_OUI_MSB_DEFAULT   0x2000

Definition at line 93 of file dp83848_driver.h.

◆ DP83848_PHYIDR2

#define DP83848_PHYIDR2   0x03

Definition at line 48 of file dp83848_driver.h.

◆ DP83848_PHYIDR2_MDL_REV

#define DP83848_PHYIDR2_MDL_REV   0x000F

Definition at line 100 of file dp83848_driver.h.

◆ DP83848_PHYIDR2_OUI_LSB

#define DP83848_PHYIDR2_OUI_LSB   0xFC00

Definition at line 96 of file dp83848_driver.h.

◆ DP83848_PHYIDR2_OUI_LSB_DEFAULT

#define DP83848_PHYIDR2_OUI_LSB_DEFAULT   0x5C00

Definition at line 97 of file dp83848_driver.h.

◆ DP83848_PHYIDR2_VNDR_MDL

#define DP83848_PHYIDR2_VNDR_MDL   0x03F0

Definition at line 98 of file dp83848_driver.h.

◆ DP83848_PHYIDR2_VNDR_MDL_DEFAULT

#define DP83848_PHYIDR2_VNDR_MDL_DEFAULT   0x0090

Definition at line 99 of file dp83848_driver.h.

◆ DP83848_PHYSTS

#define DP83848_PHYSTS   0x10

Definition at line 53 of file dp83848_driver.h.

◆ DP83848_PHYSTS_AN_COMPLETE

#define DP83848_PHYSTS_AN_COMPLETE   0x0010

Definition at line 154 of file dp83848_driver.h.

◆ DP83848_PHYSTS_DESCRAMBLER_LOCK

#define DP83848_PHYSTS_DESCRAMBLER_LOCK   0x0200

Definition at line 149 of file dp83848_driver.h.

◆ DP83848_PHYSTS_DUPLEX_STATUS

#define DP83848_PHYSTS_DUPLEX_STATUS   0x0004

Definition at line 156 of file dp83848_driver.h.

◆ DP83848_PHYSTS_FALSE_CARRIER_SENSE_LATCH

#define DP83848_PHYSTS_FALSE_CARRIER_SENSE_LATCH   0x0800

Definition at line 147 of file dp83848_driver.h.

◆ DP83848_PHYSTS_JABBER_DETECT

#define DP83848_PHYSTS_JABBER_DETECT   0x0020

Definition at line 153 of file dp83848_driver.h.

◆ DP83848_PHYSTS_LINK_STATUS

#define DP83848_PHYSTS_LINK_STATUS   0x0001

Definition at line 158 of file dp83848_driver.h.

◆ DP83848_PHYSTS_LOOPBACK_STATUS

#define DP83848_PHYSTS_LOOPBACK_STATUS   0x0008

Definition at line 155 of file dp83848_driver.h.

◆ DP83848_PHYSTS_MDIX_MODE

#define DP83848_PHYSTS_MDIX_MODE   0x4000

Definition at line 144 of file dp83848_driver.h.

◆ DP83848_PHYSTS_MII_INTERRUPT

#define DP83848_PHYSTS_MII_INTERRUPT   0x0080

Definition at line 151 of file dp83848_driver.h.

◆ DP83848_PHYSTS_PAGE_RECEIVED

#define DP83848_PHYSTS_PAGE_RECEIVED   0x0100

Definition at line 150 of file dp83848_driver.h.

◆ DP83848_PHYSTS_POLARITY_STATUS

#define DP83848_PHYSTS_POLARITY_STATUS   0x1000

Definition at line 146 of file dp83848_driver.h.

◆ DP83848_PHYSTS_RECEIVE_ERROR_LATCH

#define DP83848_PHYSTS_RECEIVE_ERROR_LATCH   0x2000

Definition at line 145 of file dp83848_driver.h.

◆ DP83848_PHYSTS_REMOTE_FAULT

#define DP83848_PHYSTS_REMOTE_FAULT   0x0040

Definition at line 152 of file dp83848_driver.h.

◆ DP83848_PHYSTS_SIGNAL_DETECT

#define DP83848_PHYSTS_SIGNAL_DETECT   0x0400

Definition at line 148 of file dp83848_driver.h.

◆ DP83848_PHYSTS_SPEED_STATUS

#define DP83848_PHYSTS_SPEED_STATUS   0x0002

Definition at line 157 of file dp83848_driver.h.

◆ DP83848_RBR

#define DP83848_RBR   0x17

Definition at line 59 of file dp83848_driver.h.

◆ DP83848_RBR_ELAST_BUF

#define DP83848_RBR_ELAST_BUF   0x0003

Definition at line 200 of file dp83848_driver.h.

◆ DP83848_RBR_RMII_MODE

#define DP83848_RBR_RMII_MODE   0x0020

Definition at line 196 of file dp83848_driver.h.

◆ DP83848_RBR_RMII_REV1_0

#define DP83848_RBR_RMII_REV1_0   0x0010

Definition at line 197 of file dp83848_driver.h.

◆ DP83848_RBR_RX_OVF_STS

#define DP83848_RBR_RX_OVF_STS   0x0008

Definition at line 198 of file dp83848_driver.h.

◆ DP83848_RBR_RX_UNF_STS

#define DP83848_RBR_RX_UNF_STS   0x0004

Definition at line 199 of file dp83848_driver.h.

◆ DP83848_RECR

#define DP83848_RECR   0x15

Definition at line 57 of file dp83848_driver.h.

◆ DP83848_RECR_RXERCNT

#define DP83848_RECR_RXERCNT   0x00FF

Definition at line 185 of file dp83848_driver.h.

Function Documentation

◆ dp83848DisableIrq()

void dp83848DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 183 of file dp83848_driver.c.

◆ dp83848DumpPhyReg()

void dp83848DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 309 of file dp83848_driver.c.

◆ dp83848EnableIrq()

void dp83848EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 168 of file dp83848_driver.c.

◆ dp83848EventHandler()

void dp83848EventHandler ( NetInterface interface)

DP83848 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 198 of file dp83848_driver.c.

◆ dp83848Init()

error_t dp83848Init ( NetInterface interface)

DP83848 PHY transceiver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 60 of file dp83848_driver.c.

◆ dp83848InitHook()

void dp83848InitHook ( NetInterface interface)

DP83848 custom configuration.

Parameters
[in]interfaceUnderlying network interface

Definition at line 120 of file dp83848_driver.c.

◆ dp83848ReadPhyReg()

uint16_t dp83848ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

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

Definition at line 283 of file dp83848_driver.c.

◆ dp83848Tick()

void dp83848Tick ( NetInterface interface)

DP83848 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 130 of file dp83848_driver.c.

◆ dp83848WritePhyReg()

void dp83848WritePhyReg ( 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 259 of file dp83848_driver.c.

Variable Documentation

◆ dp83848PhyDriver

const PhyDriver dp83848PhyDriver
extern

DP83848 Ethernet PHY driver.

Definition at line 44 of file dp83848_driver.c.