ksz8721_driver.h File Reference

KSZ8721 Ethernet PHY transceiver. More...

#include "core/nic.h"

Go to the source code of this file.

Macros

#define KSZ8721_PHY_ADDR   1
 
#define KSZ8721_PHY_REG_BMCR   0x00
 
#define KSZ8721_PHY_REG_BMSR   0x01
 
#define KSZ8721_PHY_REG_PHYIDR1   0x02
 
#define KSZ8721_PHY_REG_PHYIDR2   0x03
 
#define KSZ8721_PHY_REG_ANAR   0x04
 
#define KSZ8721_PHY_REG_ANLPAR   0x05
 
#define KSZ8721_PHY_REG_ANER   0x06
 
#define KSZ8721_PHY_REG_ANNPTR   0x07
 
#define KSZ8721_PHY_REG_LPNPAR   0x08
 
#define KSZ8721_PHY_REG_RECR   0x15
 
#define KSZ8721_PHY_REG_ICSR   0x1B
 
#define KSZ8721_PHY_REG_PHYCON   0x1F
 
#define BMCR_RESET   (1 << 15)
 
#define BMCR_LOOPBACK   (1 << 14)
 
#define BMCR_SPEED_SEL   (1 << 13)
 
#define BMCR_AN_EN   (1 << 12)
 
#define BMCR_POWER_DOWN   (1 << 11)
 
#define BMCR_ISOLATE   (1 << 10)
 
#define BMCR_RESTART_AN   (1 << 9)
 
#define BMCR_DUPLEX_MODE   (1 << 8)
 
#define BMCR_COL_TEST   (1 << 7)
 
#define BMCR_TX_DIS   (1 << 0)
 
#define BMSR_100BT4   (1 << 15)
 
#define BMSR_100BTX_FD   (1 << 14)
 
#define BMSR_100BTX   (1 << 13)
 
#define BMSR_10BT_FD   (1 << 12)
 
#define BMSR_10BT   (1 << 11)
 
#define BMSR_NO_PREAMBLE   (1 << 6)
 
#define BMSR_AN_COMPLETE   (1 << 5)
 
#define BMSR_REMOTE_FAULT   (1 << 4)
 
#define BMSR_AN_ABLE   (1 << 3)
 
#define BMSR_LINK_STATUS   (1 << 2)
 
#define BMSR_JABBER_DETECT   (1 << 1)
 
#define BMSR_EXTENDED_CAP   (1 << 0)
 
#define ANAR_NEXT_PAGE   (1 << 15)
 
#define ANAR_REMOTE_FAULT   (1 << 13)
 
#define ANAR_PAUSE   (1 << 10)
 
#define ANAR_100BT4   (1 << 9)
 
#define ANAR_100BTX_FD   (1 << 8)
 
#define ANAR_100BTX   (1 << 7)
 
#define ANAR_10BT_FD   (1 << 6)
 
#define ANAR_10BT   (1 << 5)
 
#define ANAR_SELECTOR4   (1 << 4)
 
#define ANAR_SELECTOR3   (1 << 3)
 
#define ANAR_SELECTOR2   (1 << 2)
 
#define ANAR_SELECTOR1   (1 << 1)
 
#define ANAR_SELECTOR0   (1 << 0)
 
#define ANLPAR_NEXT_PAGE   (1 << 15)
 
#define ANLPAR_LP_ACK   (1 << 14)
 
#define ANLPAR_REMOTE_FAULT   (1 << 13)
 
#define ANLPAR_PAUSE1   (1 << 11)
 
#define ANLPAR_PAUSE0   (1 << 10)
 
#define ANLPAR_100BT4   (1 << 9)
 
#define ANLPAR_100BTX_FD   (1 << 8)
 
#define ANLPAR_100BTX   (1 << 7)
 
#define ANLPAR_10BT_FD   (1 << 6)
 
#define ANLPAR_10BT   (1 << 5)
 
#define ANLPAR_SELECTOR4   (1 << 4)
 
#define ANLPAR_SELECTOR3   (1 << 3)
 
#define ANLPAR_SELECTOR2   (1 << 2)
 
#define ANLPAR_SELECTOR1   (1 << 1)
 
#define ANLPAR_SELECTOR0   (1 << 0)
 
#define ANER_PAR_DET_FAULT   (1 << 4)
 
#define ANER_LP_NEXT_PAGE_ABLE   (1 << 3)
 
#define ANER_NEXT_PAGE_ABLE   (1 << 2)
 
#define ANER_PAGE_RECEIVED   (1 << 1)
 
#define ANER_LP_AN_ABLE   (1 << 0)
 
#define ANNPTR_NEXT_PAGE   (1 << 15)
 
#define ANNPTR_MSG_PAGE   (1 << 13)
 
#define ANNPTR_ACK2   (1 << 12)
 
#define ANNPTR_TOGGLE   (1 << 11)
 
#define ANNPTR_MESSAGE10   (1 << 10)
 
#define ANNPTR_MESSAGE9   (1 << 9)
 
#define ANNPTR_MESSAGE8   (1 << 8)
 
#define ANNPTR_MESSAGE7   (1 << 7)
 
#define ANNPTR_MESSAGE6   (1 << 6)
 
#define ANNPTR_MESSAGE5   (1 << 5)
 
#define ANNPTR_MESSAGE4   (1 << 4)
 
#define ANNPTR_MESSAGE3   (1 << 3)
 
#define ANNPTR_MESSAGE2   (1 << 2)
 
#define ANNPTR_MESSAGE1   (1 << 1)
 
#define ANNPTR_MESSAGE0   (1 << 0)
 
#define ICSR_JABBER_IE   (1 << 15)
 
#define ICSR_RECEIVE_ERROR_IE   (1 << 14)
 
#define ICSR_PAGE_RECEIVED_IE   (1 << 13)
 
#define ICSR_PAR_DET_FAULT_IE   (1 << 12)
 
#define ICSR_LP_ACK_IE   (1 << 11)
 
#define ICSR_LINK_DOWN_IE   (1 << 10)
 
#define ICSR_REMOTE_FAULT_IE   (1 << 9)
 
#define ICSR_LINK_UP_IE   (1 << 8)
 
#define ICSR_JABBER_IF   (1 << 7)
 
#define ICSR_RECEIVE_ERROR_IF   (1 << 6)
 
#define ICSR_PAGE_RECEIVED_IF   (1 << 5)
 
#define ICSR_PAR_DET_FAULT_IF   (1 << 4)
 
#define ICSR_LP_ACK_IF   (1 << 3)
 
#define ICSR_LINK_DOWN_IF   (1 << 2)
 
#define ICSR_REMOTE_FAULT_IF   (1 << 1)
 
#define ICSR_LINK_UP_IF   (1 << 0)
 
#define PHYCON_PAIR_SWAP_DIS   (1 << 13)
 
#define PHYCON_ENERGY_DETECT   (1 << 12)
 
#define PHYCON_FORCE_LINK   (1 << 11)
 
#define PHYCON_POWER_SAVING   (1 << 10)
 
#define PHYCON_INT_LEVEL   (1 << 9)
 
#define PHYCON_JABBER_EN   (1 << 8)
 
#define PHYCON_AN_COMPLETE   (1 << 7)
 
#define PHYCON_PAUSE_EN   (1 << 6)
 
#define PHYCON_ISOLATE   (1 << 5)
 
#define PHYCON_OP_MODE2   (1 << 4)
 
#define PHYCON_OP_MODE1   (1 << 3)
 
#define PHYCON_OP_MODE0   (1 << 2)
 
#define PHYCON_SQE_TEST_EN   (1 << 1)
 
#define PHYCON_SCRAMBLER_DIS   (1 << 0)
 
#define PHYCON_OP_MODE_MASK   (7 << 2)
 
#define PHYCON_OP_MODE_AN   (0 << 2)
 
#define PHYCON_OP_MODE_10BT   (1 << 2)
 
#define PHYCON_OP_MODE_100BTX   (2 << 2)
 
#define PHYCON_OP_MODE_10BT_FD   (5 << 2)
 
#define PHYCON_OP_MODE_100BTX_FD   (6 << 2)
 
#define PHYCON_OP_MODE_ISOLATE   (7 << 2)
 

Functions

error_t ksz8721Init (NetInterface *interface)
 KSZ8721 PHY transceiver initialization. More...
 
void ksz8721Tick (NetInterface *interface)
 KSZ8721 timer handler. More...
 
void ksz8721EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz8721DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void ksz8721EventHandler (NetInterface *interface)
 KSZ8721 event handler. More...
 
void ksz8721WritePhyReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write PHY register. More...
 
uint16_t ksz8721ReadPhyReg (NetInterface *interface, uint8_t address)
 Read PHY register. More...
 
void ksz8721DumpPhyReg (NetInterface *interface)
 Dump PHY registers for debugging purpose. More...
 

Variables

const PhyDriver ksz8721PhyDriver
 KSZ8721 Ethernet PHY driver. More...
 

Detailed Description

KSZ8721 Ethernet PHY transceiver.

License

Copyright (C) 2010-2018 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.0

Definition in file ksz8721_driver.h.

Macro Definition Documentation

◆ ANAR_100BT4

#define ANAR_100BT4   (1 << 9)

Definition at line 86 of file ksz8721_driver.h.

◆ ANAR_100BTX

#define ANAR_100BTX   (1 << 7)

Definition at line 88 of file ksz8721_driver.h.

◆ ANAR_100BTX_FD

#define ANAR_100BTX_FD   (1 << 8)

Definition at line 87 of file ksz8721_driver.h.

◆ ANAR_10BT

#define ANAR_10BT   (1 << 5)

Definition at line 90 of file ksz8721_driver.h.

◆ ANAR_10BT_FD

#define ANAR_10BT_FD   (1 << 6)

Definition at line 89 of file ksz8721_driver.h.

◆ ANAR_NEXT_PAGE

#define ANAR_NEXT_PAGE   (1 << 15)

Definition at line 83 of file ksz8721_driver.h.

◆ ANAR_PAUSE

#define ANAR_PAUSE   (1 << 10)

Definition at line 85 of file ksz8721_driver.h.

◆ ANAR_REMOTE_FAULT

#define ANAR_REMOTE_FAULT   (1 << 13)

Definition at line 84 of file ksz8721_driver.h.

◆ ANAR_SELECTOR0

#define ANAR_SELECTOR0   (1 << 0)

Definition at line 95 of file ksz8721_driver.h.

◆ ANAR_SELECTOR1

#define ANAR_SELECTOR1   (1 << 1)

Definition at line 94 of file ksz8721_driver.h.

◆ ANAR_SELECTOR2

#define ANAR_SELECTOR2   (1 << 2)

Definition at line 93 of file ksz8721_driver.h.

◆ ANAR_SELECTOR3

#define ANAR_SELECTOR3   (1 << 3)

Definition at line 92 of file ksz8721_driver.h.

◆ ANAR_SELECTOR4

#define ANAR_SELECTOR4   (1 << 4)

Definition at line 91 of file ksz8721_driver.h.

◆ ANER_LP_AN_ABLE

#define ANER_LP_AN_ABLE   (1 << 0)

Definition at line 119 of file ksz8721_driver.h.

◆ ANER_LP_NEXT_PAGE_ABLE

#define ANER_LP_NEXT_PAGE_ABLE   (1 << 3)

Definition at line 116 of file ksz8721_driver.h.

◆ ANER_NEXT_PAGE_ABLE

#define ANER_NEXT_PAGE_ABLE   (1 << 2)

Definition at line 117 of file ksz8721_driver.h.

◆ ANER_PAGE_RECEIVED

#define ANER_PAGE_RECEIVED   (1 << 1)

Definition at line 118 of file ksz8721_driver.h.

◆ ANER_PAR_DET_FAULT

#define ANER_PAR_DET_FAULT   (1 << 4)

Definition at line 115 of file ksz8721_driver.h.

◆ ANLPAR_100BT4

#define ANLPAR_100BT4   (1 << 9)

Definition at line 103 of file ksz8721_driver.h.

◆ ANLPAR_100BTX

#define ANLPAR_100BTX   (1 << 7)

Definition at line 105 of file ksz8721_driver.h.

◆ ANLPAR_100BTX_FD

#define ANLPAR_100BTX_FD   (1 << 8)

Definition at line 104 of file ksz8721_driver.h.

◆ ANLPAR_10BT

#define ANLPAR_10BT   (1 << 5)

Definition at line 107 of file ksz8721_driver.h.

◆ ANLPAR_10BT_FD

#define ANLPAR_10BT_FD   (1 << 6)

Definition at line 106 of file ksz8721_driver.h.

◆ ANLPAR_LP_ACK

#define ANLPAR_LP_ACK   (1 << 14)

Definition at line 99 of file ksz8721_driver.h.

◆ ANLPAR_NEXT_PAGE

#define ANLPAR_NEXT_PAGE   (1 << 15)

Definition at line 98 of file ksz8721_driver.h.

◆ ANLPAR_PAUSE0

#define ANLPAR_PAUSE0   (1 << 10)

Definition at line 102 of file ksz8721_driver.h.

◆ ANLPAR_PAUSE1

#define ANLPAR_PAUSE1   (1 << 11)

Definition at line 101 of file ksz8721_driver.h.

◆ ANLPAR_REMOTE_FAULT

#define ANLPAR_REMOTE_FAULT   (1 << 13)

Definition at line 100 of file ksz8721_driver.h.

◆ ANLPAR_SELECTOR0

#define ANLPAR_SELECTOR0   (1 << 0)

Definition at line 112 of file ksz8721_driver.h.

◆ ANLPAR_SELECTOR1

#define ANLPAR_SELECTOR1   (1 << 1)

Definition at line 111 of file ksz8721_driver.h.

◆ ANLPAR_SELECTOR2

#define ANLPAR_SELECTOR2   (1 << 2)

Definition at line 110 of file ksz8721_driver.h.

◆ ANLPAR_SELECTOR3

#define ANLPAR_SELECTOR3   (1 << 3)

Definition at line 109 of file ksz8721_driver.h.

◆ ANLPAR_SELECTOR4

#define ANLPAR_SELECTOR4   (1 << 4)

Definition at line 108 of file ksz8721_driver.h.

◆ ANNPTR_ACK2

#define ANNPTR_ACK2   (1 << 12)

Definition at line 124 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE0

#define ANNPTR_MESSAGE0   (1 << 0)

Definition at line 136 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE1

#define ANNPTR_MESSAGE1   (1 << 1)

Definition at line 135 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE10

#define ANNPTR_MESSAGE10   (1 << 10)

Definition at line 126 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE2

#define ANNPTR_MESSAGE2   (1 << 2)

Definition at line 134 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE3

#define ANNPTR_MESSAGE3   (1 << 3)

Definition at line 133 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE4

#define ANNPTR_MESSAGE4   (1 << 4)

Definition at line 132 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE5

#define ANNPTR_MESSAGE5   (1 << 5)

Definition at line 131 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE6

#define ANNPTR_MESSAGE6   (1 << 6)

Definition at line 130 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE7

#define ANNPTR_MESSAGE7   (1 << 7)

Definition at line 129 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE8

#define ANNPTR_MESSAGE8   (1 << 8)

Definition at line 128 of file ksz8721_driver.h.

◆ ANNPTR_MESSAGE9

#define ANNPTR_MESSAGE9   (1 << 9)

Definition at line 127 of file ksz8721_driver.h.

◆ ANNPTR_MSG_PAGE

#define ANNPTR_MSG_PAGE   (1 << 13)

Definition at line 123 of file ksz8721_driver.h.

◆ ANNPTR_NEXT_PAGE

#define ANNPTR_NEXT_PAGE   (1 << 15)

Definition at line 122 of file ksz8721_driver.h.

◆ ANNPTR_TOGGLE

#define ANNPTR_TOGGLE   (1 << 11)

Definition at line 125 of file ksz8721_driver.h.

◆ BMCR_AN_EN

#define BMCR_AN_EN   (1 << 12)

Definition at line 60 of file ksz8721_driver.h.

◆ BMCR_COL_TEST

#define BMCR_COL_TEST   (1 << 7)

Definition at line 65 of file ksz8721_driver.h.

◆ BMCR_DUPLEX_MODE

#define BMCR_DUPLEX_MODE   (1 << 8)

Definition at line 64 of file ksz8721_driver.h.

◆ BMCR_ISOLATE

#define BMCR_ISOLATE   (1 << 10)

Definition at line 62 of file ksz8721_driver.h.

◆ BMCR_LOOPBACK

#define BMCR_LOOPBACK   (1 << 14)

Definition at line 58 of file ksz8721_driver.h.

◆ BMCR_POWER_DOWN

#define BMCR_POWER_DOWN   (1 << 11)

Definition at line 61 of file ksz8721_driver.h.

◆ BMCR_RESET

#define BMCR_RESET   (1 << 15)

Definition at line 57 of file ksz8721_driver.h.

◆ BMCR_RESTART_AN

#define BMCR_RESTART_AN   (1 << 9)

Definition at line 63 of file ksz8721_driver.h.

◆ BMCR_SPEED_SEL

#define BMCR_SPEED_SEL   (1 << 13)

Definition at line 59 of file ksz8721_driver.h.

◆ BMCR_TX_DIS

#define BMCR_TX_DIS   (1 << 0)

Definition at line 66 of file ksz8721_driver.h.

◆ BMSR_100BT4

#define BMSR_100BT4   (1 << 15)

Definition at line 69 of file ksz8721_driver.h.

◆ BMSR_100BTX

#define BMSR_100BTX   (1 << 13)

Definition at line 71 of file ksz8721_driver.h.

◆ BMSR_100BTX_FD

#define BMSR_100BTX_FD   (1 << 14)

Definition at line 70 of file ksz8721_driver.h.

◆ BMSR_10BT

#define BMSR_10BT   (1 << 11)

Definition at line 73 of file ksz8721_driver.h.

◆ BMSR_10BT_FD

#define BMSR_10BT_FD   (1 << 12)

Definition at line 72 of file ksz8721_driver.h.

◆ BMSR_AN_ABLE

#define BMSR_AN_ABLE   (1 << 3)

Definition at line 77 of file ksz8721_driver.h.

◆ BMSR_AN_COMPLETE

#define BMSR_AN_COMPLETE   (1 << 5)

Definition at line 75 of file ksz8721_driver.h.

◆ BMSR_EXTENDED_CAP

#define BMSR_EXTENDED_CAP   (1 << 0)

Definition at line 80 of file ksz8721_driver.h.

◆ BMSR_JABBER_DETECT

#define BMSR_JABBER_DETECT   (1 << 1)

Definition at line 79 of file ksz8721_driver.h.

◆ BMSR_LINK_STATUS

#define BMSR_LINK_STATUS   (1 << 2)

Definition at line 78 of file ksz8721_driver.h.

◆ BMSR_NO_PREAMBLE

#define BMSR_NO_PREAMBLE   (1 << 6)

Definition at line 74 of file ksz8721_driver.h.

◆ BMSR_REMOTE_FAULT

#define BMSR_REMOTE_FAULT   (1 << 4)

Definition at line 76 of file ksz8721_driver.h.

◆ ICSR_JABBER_IE

#define ICSR_JABBER_IE   (1 << 15)

Definition at line 139 of file ksz8721_driver.h.

◆ ICSR_JABBER_IF

#define ICSR_JABBER_IF   (1 << 7)

Definition at line 147 of file ksz8721_driver.h.

◆ ICSR_LINK_DOWN_IE

#define ICSR_LINK_DOWN_IE   (1 << 10)

Definition at line 144 of file ksz8721_driver.h.

◆ ICSR_LINK_DOWN_IF

#define ICSR_LINK_DOWN_IF   (1 << 2)

Definition at line 152 of file ksz8721_driver.h.

◆ ICSR_LINK_UP_IE

#define ICSR_LINK_UP_IE   (1 << 8)

Definition at line 146 of file ksz8721_driver.h.

◆ ICSR_LINK_UP_IF

#define ICSR_LINK_UP_IF   (1 << 0)

Definition at line 154 of file ksz8721_driver.h.

◆ ICSR_LP_ACK_IE

#define ICSR_LP_ACK_IE   (1 << 11)

Definition at line 143 of file ksz8721_driver.h.

◆ ICSR_LP_ACK_IF

#define ICSR_LP_ACK_IF   (1 << 3)

Definition at line 151 of file ksz8721_driver.h.

◆ ICSR_PAGE_RECEIVED_IE

#define ICSR_PAGE_RECEIVED_IE   (1 << 13)

Definition at line 141 of file ksz8721_driver.h.

◆ ICSR_PAGE_RECEIVED_IF

#define ICSR_PAGE_RECEIVED_IF   (1 << 5)

Definition at line 149 of file ksz8721_driver.h.

◆ ICSR_PAR_DET_FAULT_IE

#define ICSR_PAR_DET_FAULT_IE   (1 << 12)

Definition at line 142 of file ksz8721_driver.h.

◆ ICSR_PAR_DET_FAULT_IF

#define ICSR_PAR_DET_FAULT_IF   (1 << 4)

Definition at line 150 of file ksz8721_driver.h.

◆ ICSR_RECEIVE_ERROR_IE

#define ICSR_RECEIVE_ERROR_IE   (1 << 14)

Definition at line 140 of file ksz8721_driver.h.

◆ ICSR_RECEIVE_ERROR_IF

#define ICSR_RECEIVE_ERROR_IF   (1 << 6)

Definition at line 148 of file ksz8721_driver.h.

◆ ICSR_REMOTE_FAULT_IE

#define ICSR_REMOTE_FAULT_IE   (1 << 9)

Definition at line 145 of file ksz8721_driver.h.

◆ ICSR_REMOTE_FAULT_IF

#define ICSR_REMOTE_FAULT_IF   (1 << 1)

Definition at line 153 of file ksz8721_driver.h.

◆ KSZ8721_PHY_ADDR

#define KSZ8721_PHY_ADDR   1

Definition at line 37 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_ANAR

#define KSZ8721_PHY_REG_ANAR   0x04

Definition at line 47 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_ANER

#define KSZ8721_PHY_REG_ANER   0x06

Definition at line 49 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_ANLPAR

#define KSZ8721_PHY_REG_ANLPAR   0x05

Definition at line 48 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_ANNPTR

#define KSZ8721_PHY_REG_ANNPTR   0x07

Definition at line 50 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_BMCR

#define KSZ8721_PHY_REG_BMCR   0x00

Definition at line 43 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_BMSR

#define KSZ8721_PHY_REG_BMSR   0x01

Definition at line 44 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_ICSR

#define KSZ8721_PHY_REG_ICSR   0x1B

Definition at line 53 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_LPNPAR

#define KSZ8721_PHY_REG_LPNPAR   0x08

Definition at line 51 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_PHYCON

#define KSZ8721_PHY_REG_PHYCON   0x1F

Definition at line 54 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_PHYIDR1

#define KSZ8721_PHY_REG_PHYIDR1   0x02

Definition at line 45 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_PHYIDR2

#define KSZ8721_PHY_REG_PHYIDR2   0x03

Definition at line 46 of file ksz8721_driver.h.

◆ KSZ8721_PHY_REG_RECR

#define KSZ8721_PHY_REG_RECR   0x15

Definition at line 52 of file ksz8721_driver.h.

◆ PHYCON_AN_COMPLETE

#define PHYCON_AN_COMPLETE   (1 << 7)

Definition at line 163 of file ksz8721_driver.h.

◆ PHYCON_ENERGY_DETECT

#define PHYCON_ENERGY_DETECT   (1 << 12)

Definition at line 158 of file ksz8721_driver.h.

◆ PHYCON_FORCE_LINK

#define PHYCON_FORCE_LINK   (1 << 11)

Definition at line 159 of file ksz8721_driver.h.

◆ PHYCON_INT_LEVEL

#define PHYCON_INT_LEVEL   (1 << 9)

Definition at line 161 of file ksz8721_driver.h.

◆ PHYCON_ISOLATE

#define PHYCON_ISOLATE   (1 << 5)

Definition at line 165 of file ksz8721_driver.h.

◆ PHYCON_JABBER_EN

#define PHYCON_JABBER_EN   (1 << 8)

Definition at line 162 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE0

#define PHYCON_OP_MODE0   (1 << 2)

Definition at line 168 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE1

#define PHYCON_OP_MODE1   (1 << 3)

Definition at line 167 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE2

#define PHYCON_OP_MODE2   (1 << 4)

Definition at line 166 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_100BTX

#define PHYCON_OP_MODE_100BTX   (2 << 2)

Definition at line 176 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_100BTX_FD

#define PHYCON_OP_MODE_100BTX_FD   (6 << 2)

Definition at line 178 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_10BT

#define PHYCON_OP_MODE_10BT   (1 << 2)

Definition at line 175 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_10BT_FD

#define PHYCON_OP_MODE_10BT_FD   (5 << 2)

Definition at line 177 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_AN

#define PHYCON_OP_MODE_AN   (0 << 2)

Definition at line 174 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_ISOLATE

#define PHYCON_OP_MODE_ISOLATE   (7 << 2)

Definition at line 179 of file ksz8721_driver.h.

◆ PHYCON_OP_MODE_MASK

#define PHYCON_OP_MODE_MASK   (7 << 2)

Definition at line 173 of file ksz8721_driver.h.

◆ PHYCON_PAIR_SWAP_DIS

#define PHYCON_PAIR_SWAP_DIS   (1 << 13)

Definition at line 157 of file ksz8721_driver.h.

◆ PHYCON_PAUSE_EN

#define PHYCON_PAUSE_EN   (1 << 6)

Definition at line 164 of file ksz8721_driver.h.

◆ PHYCON_POWER_SAVING

#define PHYCON_POWER_SAVING   (1 << 10)

Definition at line 160 of file ksz8721_driver.h.

◆ PHYCON_SCRAMBLER_DIS

#define PHYCON_SCRAMBLER_DIS   (1 << 0)

Definition at line 170 of file ksz8721_driver.h.

◆ PHYCON_SQE_TEST_EN

#define PHYCON_SQE_TEST_EN   (1 << 1)

Definition at line 169 of file ksz8721_driver.h.

Function Documentation

◆ ksz8721DisableIrq()

void ksz8721DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 144 of file ksz8721_driver.c.

◆ ksz8721DumpPhyReg()

void ksz8721DumpPhyReg ( NetInterface interface)

Dump PHY registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 275 of file ksz8721_driver.c.

◆ ksz8721EnableIrq()

void ksz8721EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 131 of file ksz8721_driver.c.

◆ ksz8721EventHandler()

void ksz8721EventHandler ( NetInterface interface)

KSZ8721 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 157 of file ksz8721_driver.c.

◆ ksz8721Init()

error_t ksz8721Init ( NetInterface interface)

KSZ8721 PHY transceiver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 58 of file ksz8721_driver.c.

◆ ksz8721ReadPhyReg()

uint16_t ksz8721ReadPhyReg ( NetInterface interface,
uint8_t  address 
)

Read PHY register.

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

Definition at line 255 of file ksz8721_driver.c.

◆ ksz8721Tick()

void ksz8721Tick ( NetInterface interface)

KSZ8721 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 93 of file ksz8721_driver.c.

◆ ksz8721WritePhyReg()

void ksz8721WritePhyReg ( 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 233 of file ksz8721_driver.c.

Variable Documentation

◆ ksz8721PhyDriver

const PhyDriver ksz8721PhyDriver

KSZ8721 Ethernet PHY driver.

Definition at line 42 of file ksz8721_driver.c.