ksz8851_driver.h File Reference

KSZ8851 Ethernet controller. More...

Go to the source code of this file.

Data Structures

struct  Ksz8851Context
 KSZ8851 driver context. More...
 

Macros

#define KSZ8851_SPI_SUPPORT   ENABLED
 
#define KSZ8851_DATA_REG   *((volatile uint16_t *) 0x60000000)
 
#define KSZ8851_CMD_REG   *((volatile uint16_t *) 0x60000004)
 
#define KSZ8851_REV_A2_ID   0x8870
 
#define KSZ8851_REV_A3_ID   0x8872
 
#define KSZ8851_CMD_RD_REG   0x00
 
#define KSZ8851_CMD_WR_REG   0x40
 
#define KSZ8851_CMD_RD_FIFO   0x80
 
#define KSZ8851_CMD_WR_FIFO   0xC0
 
#define KSZ8851_CMD_B0   0x04
 
#define KSZ8851_CMD_B1   0x08
 
#define KSZ8851_CMD_B2   0x10
 
#define KSZ8851_CMD_B3   0x20
 
#define KSZ8851_REG_CCR   0x08
 
#define KSZ8851_REG_MARL   0x10
 
#define KSZ8851_REG_MARM   0x12
 
#define KSZ8851_REG_MARH   0x14
 
#define KSZ8851_REG_OBCR   0x20
 
#define KSZ8851_REG_EEPCR   0x22
 
#define KSZ8851_REG_MBIR   0x24
 
#define KSZ8851_REG_GRR   0x26
 
#define KSZ8851_REG_WFCR   0x2A
 
#define KSZ8851_REG_WF0CRC0   0x30
 
#define KSZ8851_REG_WF0CRC1   0x32
 
#define KSZ8851_REG_WF0BM0   0x34
 
#define KSZ8851_REG_WF0BM1   0x36
 
#define KSZ8851_REG_WF0BM2   0x38
 
#define KSZ8851_REG_WF0BM3   0x3A
 
#define KSZ8851_REG_WF1CRC0   0x40
 
#define KSZ8851_REG_WF1CRC1   0x42
 
#define KSZ8851_REG_WF1BM0   0x44
 
#define KSZ8851_REG_WF1BM1   0x46
 
#define KSZ8851_REG_WF1BM2   0x48
 
#define KSZ8851_REG_WF1BM3   0x4A
 
#define KSZ8851_REG_WF2CRC0   0x50
 
#define KSZ8851_REG_WF2CRC1   0x52
 
#define KSZ8851_REG_WF2BM0   0x54
 
#define KSZ8851_REG_WF2BM1   0x56
 
#define KSZ8851_REG_WF2BM2   0x58
 
#define KSZ8851_REG_WF2BM3   0x5A
 
#define KSZ8851_REG_WF3CRC0   0x60
 
#define KSZ8851_REG_WF3CRC1   0x62
 
#define KSZ8851_REG_WF3BM0   0x64
 
#define KSZ8851_REG_WF3BM1   0x66
 
#define KSZ8851_REG_WF3BM2   0x68
 
#define KSZ8851_REG_WF3BM3   0x6A
 
#define KSZ8851_REG_TXCR   0x70
 
#define KSZ8851_REG_TXSR   0x72
 
#define KSZ8851_REG_RXCR1   0x74
 
#define KSZ8851_REG_RXCR2   0x76
 
#define KSZ8851_REG_TXMIR   0x78
 
#define KSZ8851_REG_RXFHSR   0x7C
 
#define KSZ8851_REG_RXFHBCR   0x7E
 
#define KSZ8851_REG_TXQCR   0x80
 
#define KSZ8851_REG_RXQCR   0x82
 
#define KSZ8851_REG_TXFDPR   0x84
 
#define KSZ8851_REG_RXFDPR   0x86
 
#define KSZ8851_REG_RXDTTR   0x8C
 
#define KSZ8851_REG_RXDBCTR   0x8E
 
#define KSZ8851_REG_IER   0x90
 
#define KSZ8851_REG_ISR   0x92
 
#define KSZ8851_REG_RXFCTR   0x9C
 
#define KSZ8851_REG_TXNTFSR   0x9E
 
#define KSZ8851_REG_MAHTR0   0xA0
 
#define KSZ8851_REG_MAHTR1   0xA2
 
#define KSZ8851_REG_MAHTR2   0xA4
 
#define KSZ8851_REG_MAHTR3   0xA6
 
#define KSZ8851_REG_FCLWR   0xB0
 
#define KSZ8851_REG_FCHWR   0xB2
 
#define KSZ8851_REG_FCOWR   0xB4
 
#define KSZ8851_REG_CIDER   0xC0
 
#define KSZ8851_REG_CGCR   0xC6
 
#define KSZ8851_REG_IACR   0xC8
 
#define KSZ8851_REG_IADLR   0xD0
 
#define KSZ8851_REG_IADHR   0xD2
 
#define KSZ8851_REG_PMECR   0xD4
 
#define KSZ8851_REG_GSWUTR   0xD6
 
#define KSZ8851_REG_PHYRR   0xD8
 
#define KSZ8851_REG_P1MBCR   0xE4
 
#define KSZ8851_REG_P1MBSR   0xE6
 
#define KSZ8851_REG_PHY1ILR   0xE8
 
#define KSZ8851_REG_PHY1IHR   0xEA
 
#define KSZ8851_REG_P1ANAR   0xEC
 
#define KSZ8851_REG_P1ANLPR   0xEE
 
#define KSZ8851_REG_P1SCLMD   0xF4
 
#define KSZ8851_REG_P1CR   0xF6
 
#define KSZ8851_REG_P1SR   0xF8
 
#define CCR_BUS_ENDIAN_MODE   0x0400
 
#define CCR_EEPROM_PRESENCE   0x0200
 
#define CCR_SPI_MODE   0x0100
 
#define CCR_8_BIT_DATA_BUS   0x0080
 
#define CCR_16_BIT_DATA_BUS   0x0040
 
#define CCR_32_BIT_DATA_BUS   0x0020
 
#define CCR_BUS_SHARED_MODE   0x0010
 
#define CCR_128_PIN_PACKAGE   0x0008
 
#define CCR_48_PIN_PACKAGE   0x0002
 
#define CCR_32_PIN_PACKAGE   0x0001
 
#define OBCR_OUT_DRIVE_STRENGTH   0x0040
 
#define OBCR_SPI_SO_DELAY2   0x0020
 
#define OBCR_SPI_SO_DELAY1   0x0010
 
#define OBCR_SPI_SO_DELAY0   0x0008
 
#define OBCR_BUS_CLOCK_SEL   0x0004
 
#define OBCR_BUS_CLOCK_DIV1   0x0002
 
#define OBCR_BUS_CLOCK_DIV0   0x0001
 
#define EEPCR_EESA   0x0010
 
#define EEPCR_EESB   0x0008
 
#define EEPCR_EECB2   0x0004
 
#define EEPCR_EECB1   0x0002
 
#define EEPCR_EECB0   0x0001
 
#define MBIR_TXMBF   0x1000
 
#define MBIR_TXMBFA   0x0800
 
#define MBIR_TXMBFC2   0x0400
 
#define MBIR_TXMBFC1   0x0200
 
#define MBIR_TXMBFC0   0x0100
 
#define MBIR_RXMBF   0x0010
 
#define MBIR_RXMBFA   0x0008
 
#define MBIR_RXMBFC2   0x0004
 
#define MBIR_RXMBFC1   0x0002
 
#define MBIR_RXMBFC0   0x0001
 
#define GRR_QMU_MODULE_SOFT_RST   0x0002
 
#define GRR_GLOBAL_SOFT_RST   0x0001
 
#define WFCR_MPRXE   0x0080
 
#define WFCR_WF3E   0x0008
 
#define WFCR_WF2E   0x0004
 
#define WFCR_WF1E   0x0002
 
#define WFCR_WF0E   0x0001
 
#define TXCR_TCGICMP   0x0100
 
#define TXCR_TCGUDP   0x0080
 
#define TXCR_TCGTCP   0x0040
 
#define TXCR_TCGIP   0x0020
 
#define TXCR_FTXQ   0x0010
 
#define TXCR_TXFCE   0x0008
 
#define TXCR_TXPE   0x0004
 
#define TXCR_TXCE   0x0002
 
#define TXCR_TXE   0x0001
 
#define TXSR_TXLC   0x2000
 
#define TXSR_TXMC   0x1000
 
#define TXSR_TXFID5   0x0020
 
#define TXSR_TXFID4   0x0010
 
#define TXSR_TXFID3   0x0008
 
#define TXSR_TXFID2   0x0004
 
#define TXSR_TXFID1   0x0002
 
#define TXSR_TXFID0   0x0001
 
#define RXCR1_FRXQ   0x8000
 
#define RXCR1_RXUDPFCC   0x4000
 
#define RXCR1_RXTCPFCC   0x2000
 
#define RXCR1_RXIPFCC   0x1000
 
#define RXCR1_RXPAFMA   0x0800
 
#define RXCR1_RXFCE   0x0400
 
#define RXCR1_RXEFE   0x0200
 
#define RXCR1_RXMAFMA   0x0100
 
#define RXCR1_RXBE   0x0080
 
#define RXCR1_RXME   0x0040
 
#define RXCR1_RXUE   0x0020
 
#define RXCR1_RXAE   0x0010
 
#define RXCR1_RXINVF   0x0002
 
#define RXCR1_RXE   0x0001
 
#define RXCR2_SRDBL2   0x0080
 
#define RXCR2_SRDBL1   0x0040
 
#define RXCR2_SRDBL0   0x0020
 
#define RXCR2_IUFFP   0x0010
 
#define RXCR2_RXIUFCEZ   0x0008
 
#define RXCR2_UDPLFE   0x0004
 
#define RXCR2_RXICMPFCC   0x0002
 
#define RXCR2_RXSAF   0x0001
 
#define TXMIR_TXMA_MASK   0x1FFF
 
#define RXFHSR_RXFV   0x8000
 
#define RXFHSR_RXICMPFCS   0x2000
 
#define RXFHSR_RXIPFCS   0x1000
 
#define RXFHSR_RXTCPFCS   0x0800
 
#define RXFHSR_RXUDPFCS   0x0400
 
#define RXFHSR_RXBF   0x0080
 
#define RXFHSR_RXMF   0x0040
 
#define RXFHSR_RXUF   0x0020
 
#define RXFHSR_RXMR   0x0010
 
#define RXFHSR_RXFT   0x0008
 
#define RXFHSR_RXFTL   0x0004
 
#define RXFHSR_RXRF   0x0002
 
#define RXFHSR_RXCE   0x0001
 
#define RXFHBCR_RXBC_MASK   0x0FFF
 
#define TXQCR_AETFE   0x0004
 
#define TXQCR_TXQMAM   0x0002
 
#define TXQCR_METFE   0x0001
 
#define RXQCR_RXDTTS   0x1000
 
#define RXQCR_RXDBCTS   0x0800
 
#define RXQCR_RXFCTS   0x0400
 
#define RXQCR_RXIPHTOE   0x0200
 
#define RXQCR_RXDTTE   0x0080
 
#define RXQCR_RXDBCTE   0x0040
 
#define RXQCR_RXFCTE   0x0020
 
#define RXQCR_ADRFE   0x0010
 
#define RXQCR_SDA   0x0008
 
#define RXQCR_RRXEF   0x0001
 
#define TXFDPR_TXFPAI   0x4000
 
#define RXFDPR_RXFPAI   0x4000
 
#define IER_LCIE   0x8000
 
#define IER_TXIE   0x4000
 
#define IER_RXIE   0x2000
 
#define IER_RXOIE   0x0800
 
#define IER_TXPSIE   0x0200
 
#define IER_RXPSIE   0x0100
 
#define IER_TXSAIE   0x0040
 
#define IER_RXWFDIE   0x0020
 
#define IER_RXMPDIE   0x0010
 
#define IER_LDIE   0x0008
 
#define IER_EDIE   0x0004
 
#define IER_SPIBEIE   0x0002
 
#define IER_DEDIE   0x0001
 
#define ISR_LCIS   0x8000
 
#define ISR_TXIS   0x4000
 
#define ISR_RXIS   0x2000
 
#define ISR_RXOIS   0x0800
 
#define ISR_TXPSIS   0x0200
 
#define ISR_RXPSIS   0x0100
 
#define ISR_TXSAIS   0x0040
 
#define ISR_RXWFDIS   0x0020
 
#define ISR_RXMPDIS   0x0010
 
#define ISR_LDIS   0x0008
 
#define ISR_EDIS   0x0004
 
#define ISR_SPIBEIS   0x0002
 
#define CGCR_LEDSEL0   0x0200
 
#define IACR_READ_ENABLE   0x1000
 
#define IACR_TABLE_SELECT1   0x0800
 
#define IACR_TABLE_SELECT0   0x0400
 
#define PMECR_PME_DELAY_EN   0x4000
 
#define PMECR_PME_POLARITY   0x1000
 
#define PMECR_PME_WUP_FRAME_EN   0x0800
 
#define PMECR_PME_MAGIC_EN   0x0400
 
#define PMECR_PME_LINK_UP_EN   0x0200
 
#define PMECR_PME_ENERGY_EN   0x0100
 
#define PMECR_AUTO_WUP_EN   0x0080
 
#define PMECR_WUP_NORMAL_OP_MODE   0x0040
 
#define PMECR_WUP_FROM_WUP_FRAME   0x0020
 
#define PMECR_WUP_FROM_MAGIC   0x0010
 
#define PMECR_WUP_FROM_LINK_UP   0x0008
 
#define PMECR_WUP_FROM_ENERGY   0x0004
 
#define PMECR_PWR_MODE1   0x0002
 
#define PMECR_PWR_MODE0   0x0001
 
#define PHYRR_PHY_RESET   0x0001
 
#define P1MBCR_LOCAL_LOOPBACK   0x4000
 
#define P1MBCR_FORCE_100   0x2000
 
#define P1MBCR_AN_ENABLE   0x1000
 
#define P1MBCR_RESTART_AN   0x0200
 
#define P1MBCR_FORCE_FULL_DUPLEX   0x0100
 
#define P1MBCR_HP_MDIX   0x0020
 
#define P1MBCR_FORCE_MDIX   0x0010
 
#define P1MBCR_DISABLE_MDIX   0x0008
 
#define P1MBCR_DISABLE_TRANSMIT   0x0002
 
#define P1MBCR_DISABLE_LED   0x0001
 
#define P1MBSR_T4_CAPABLE   0x8000
 
#define P1MBSR_100_FD_CAPABLE   0x4000
 
#define P1MBSR_100_CAPABLE   0x2000
 
#define P1MBSR_10_FD_CAPABLE   0x1000
 
#define P1MBSR_10_CAPABLE   0x0800
 
#define P1MBSR_PREAMBLE_SUPPR   0x0040
 
#define P1MBSR_AN_COMPLETE   0x0020
 
#define P1MBSR_AN_CAPABLE   0x0008
 
#define P1MBSR_LINK_STATUS   0x0004
 
#define P1MBSR_JABBER_TEST   0x0002
 
#define P1MBSR_EXTENDED_CAPABLE   0x0001
 
#define P1ANAR_NEXT_PAGE   0x8000
 
#define P1ANAR_REMOTE_FAULT   0x2000
 
#define P1ANAR_ADV_PAUSE   0x0400
 
#define P1ANAR_ADV_100_FD   0x0100
 
#define P1ANAR_ADV_100   0x0080
 
#define P1ANAR_ADV_10_FD   0x0040
 
#define P1ANAR_ADV_10   0x0020
 
#define P1ANAR_SELECTOR_FIELD4   0x0010
 
#define P1ANAR_SELECTOR_FIELD3   0x0008
 
#define P1ANAR_SELECTOR_FIELD2   0x0004
 
#define P1ANAR_SELECTOR_FIELD1   0x0002
 
#define P1ANAR_SELECTOR_FIELD0   0x0001
 
#define P1ANLPR_NEXT_PAGE   0x8000
 
#define P1ANLPR_LP_ACK   0x4000
 
#define P1ANLPR_REMOTE_FAULT   0x2000
 
#define P1ANLPR_ADV_PAUSE   0x0400
 
#define P1ANLPR_ADV_100_FD   0x0100
 
#define P1ANLPR_ADV_100   0x0080
 
#define P1ANLPR_ADV_10_FD   0x0040
 
#define P1ANLPR_ADV_10   0x0020
 
#define P1SCLMD_VCT_RESULT1   0x4000
 
#define P1SCLMD_VCT_RESULT0   0x2000
 
#define P1SCLMD_VCT_EN   0x1000
 
#define P1SCLMD_FORCE_LNK   0x0800
 
#define P1SCLMD_REMOTE_LOOPBACK   0x0200
 
#define P1CR_LED_OFF   0x8000
 
#define P1CR_TX_DISABLE   0x4000
 
#define P1CR_RESTART_AN   0x2000
 
#define P1CR_DISABLE_AUTO_MDIX   0x0400
 
#define P1CR_FORCE_MDIX   0x0200
 
#define P1CR_AN_ENABLE   0x0080
 
#define P1CR_FORCE_SPEED   0x0040
 
#define P1CR_FORCE_DUPLEX   0x0020
 
#define P1CR_ADV_PAUSE   0x0010
 
#define P1CR_ADV_100_FD   0x0008
 
#define P1CR_ADV_100   0x0004
 
#define P1CR_ADV_10_FD   0x0002
 
#define P1CR_ADV_10   0x0001
 
#define P1SR_HP_MDIX   0x8000
 
#define P1SR_REVERSED_POLARITY   0x2000
 
#define P1SR_OPERATION_SPEED   0x0400
 
#define P1SR_OPERATION_DUPLEX   0x0200
 
#define P1SR_MDIX_STATUS   0x0080
 
#define P1SR_AN_DONE   0x0040
 
#define P1SR_LINK_GOOD   0x0020
 
#define P1SR_PARTNER_ADV_PAUSE   0x0010
 
#define P1SR_PARTNER_ADV_100_FD   0x0008
 
#define P1SR_PARTNER_ADV_100   0x0004
 
#define P1SR_PARTNER_ADV_10_FD   0x0002
 
#define P1SR_PARTNER_ADV_10   0x0001
 
#define TX_CTRL_TXIC   0x8000
 
#define TX_CTRL_TXFID   0x003F
 

Typedefs

struct {
   uint16_t   controlWord
 
   uint16_t   byteCount
 
Ksz8851TxHeader
 TX packet header. More...
 
struct {
   uint16_t   statusWord
 
   uint16_t   byteCount
 
Ksz8851RxHeader
 RX packet header. More...
 

Functions

error_t ksz8851Init (NetInterface *interface)
 KSZ8851 controller initialization. More...
 
void ksz8851Tick (NetInterface *interface)
 KSZ8851 timer handler. More...
 
void ksz8851EnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void ksz8851DisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
bool_t ksz8851IrqHandler (NetInterface *interface)
 KSZ8851 interrupt service routine. More...
 
void ksz8851EventHandler (NetInterface *interface)
 KSZ8851 event handler. More...
 
error_t ksz8851SendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset)
 Send a packet. More...
 
error_t ksz8851ReceivePacket (NetInterface *interface)
 Receive a packet. More...
 
error_t ksz8851UpdateMacAddrFilter (NetInterface *interface)
 Configure MAC address filtering. More...
 
void ksz8851WriteReg (NetInterface *interface, uint8_t address, uint16_t data)
 Write KSZ8851 register. More...
 
uint16_t ksz8851ReadReg (NetInterface *interface, uint8_t address)
 Read KSZ8851 register. More...
 
void ksz8851WriteFifo (NetInterface *interface, const uint8_t *data, size_t length)
 Write TX FIFO. More...
 
void ksz8851ReadFifo (NetInterface *interface, uint8_t *data, size_t length)
 Read RX FIFO. More...
 
void ksz8851SetBit (NetInterface *interface, uint8_t address, uint16_t mask)
 Set bit field. More...
 
void ksz8851ClearBit (NetInterface *interface, uint8_t address, uint16_t mask)
 Clear bit field. More...
 
uint32_t ksz8851CalcCrc (const void *data, size_t length)
 CRC calculation. More...
 
void ksz8851DumpReg (NetInterface *interface)
 Dump registers for debugging purpose. More...
 

Variables

const NicDriver ksz8851Driver
 KSZ8851 driver. More...
 

Detailed Description

KSZ8851 Ethernet controller.

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 ksz8851_driver.h.

Macro Definition Documentation

◆ CCR_128_PIN_PACKAGE

#define CCR_128_PIN_PACKAGE   0x0008

Definition at line 156 of file ksz8851_driver.h.

◆ CCR_16_BIT_DATA_BUS

#define CCR_16_BIT_DATA_BUS   0x0040

Definition at line 153 of file ksz8851_driver.h.

◆ CCR_32_BIT_DATA_BUS

#define CCR_32_BIT_DATA_BUS   0x0020

Definition at line 154 of file ksz8851_driver.h.

◆ CCR_32_PIN_PACKAGE

#define CCR_32_PIN_PACKAGE   0x0001

Definition at line 158 of file ksz8851_driver.h.

◆ CCR_48_PIN_PACKAGE

#define CCR_48_PIN_PACKAGE   0x0002

Definition at line 157 of file ksz8851_driver.h.

◆ CCR_8_BIT_DATA_BUS

#define CCR_8_BIT_DATA_BUS   0x0080

Definition at line 152 of file ksz8851_driver.h.

◆ CCR_BUS_ENDIAN_MODE

#define CCR_BUS_ENDIAN_MODE   0x0400

Definition at line 149 of file ksz8851_driver.h.

◆ CCR_BUS_SHARED_MODE

#define CCR_BUS_SHARED_MODE   0x0010

Definition at line 155 of file ksz8851_driver.h.

◆ CCR_EEPROM_PRESENCE

#define CCR_EEPROM_PRESENCE   0x0200

Definition at line 150 of file ksz8851_driver.h.

◆ CCR_SPI_MODE

#define CCR_SPI_MODE   0x0100

Definition at line 151 of file ksz8851_driver.h.

◆ CGCR_LEDSEL0

#define CGCR_LEDSEL0   0x0200

Definition at line 320 of file ksz8851_driver.h.

◆ EEPCR_EECB0

#define EEPCR_EECB0   0x0001

Definition at line 174 of file ksz8851_driver.h.

◆ EEPCR_EECB1

#define EEPCR_EECB1   0x0002

Definition at line 173 of file ksz8851_driver.h.

◆ EEPCR_EECB2

#define EEPCR_EECB2   0x0004

Definition at line 172 of file ksz8851_driver.h.

◆ EEPCR_EESA

#define EEPCR_EESA   0x0010

Definition at line 170 of file ksz8851_driver.h.

◆ EEPCR_EESB

#define EEPCR_EESB   0x0008

Definition at line 171 of file ksz8851_driver.h.

◆ GRR_GLOBAL_SOFT_RST

#define GRR_GLOBAL_SOFT_RST   0x0001

Definition at line 190 of file ksz8851_driver.h.

◆ GRR_QMU_MODULE_SOFT_RST

#define GRR_QMU_MODULE_SOFT_RST   0x0002

Definition at line 189 of file ksz8851_driver.h.

◆ IACR_READ_ENABLE

#define IACR_READ_ENABLE   0x1000

Definition at line 323 of file ksz8851_driver.h.

◆ IACR_TABLE_SELECT0

#define IACR_TABLE_SELECT0   0x0400

Definition at line 325 of file ksz8851_driver.h.

◆ IACR_TABLE_SELECT1

#define IACR_TABLE_SELECT1   0x0800

Definition at line 324 of file ksz8851_driver.h.

◆ IER_DEDIE

#define IER_DEDIE   0x0001

Definition at line 303 of file ksz8851_driver.h.

◆ IER_EDIE

#define IER_EDIE   0x0004

Definition at line 301 of file ksz8851_driver.h.

◆ IER_LCIE

#define IER_LCIE   0x8000

Definition at line 291 of file ksz8851_driver.h.

◆ IER_LDIE

#define IER_LDIE   0x0008

Definition at line 300 of file ksz8851_driver.h.

◆ IER_RXIE

#define IER_RXIE   0x2000

Definition at line 293 of file ksz8851_driver.h.

◆ IER_RXMPDIE

#define IER_RXMPDIE   0x0010

Definition at line 299 of file ksz8851_driver.h.

◆ IER_RXOIE

#define IER_RXOIE   0x0800

Definition at line 294 of file ksz8851_driver.h.

◆ IER_RXPSIE

#define IER_RXPSIE   0x0100

Definition at line 296 of file ksz8851_driver.h.

◆ IER_RXWFDIE

#define IER_RXWFDIE   0x0020

Definition at line 298 of file ksz8851_driver.h.

◆ IER_SPIBEIE

#define IER_SPIBEIE   0x0002

Definition at line 302 of file ksz8851_driver.h.

◆ IER_TXIE

#define IER_TXIE   0x4000

Definition at line 292 of file ksz8851_driver.h.

◆ IER_TXPSIE

#define IER_TXPSIE   0x0200

Definition at line 295 of file ksz8851_driver.h.

◆ IER_TXSAIE

#define IER_TXSAIE   0x0040

Definition at line 297 of file ksz8851_driver.h.

◆ ISR_EDIS

#define ISR_EDIS   0x0004

Definition at line 316 of file ksz8851_driver.h.

◆ ISR_LCIS

#define ISR_LCIS   0x8000

Definition at line 306 of file ksz8851_driver.h.

◆ ISR_LDIS

#define ISR_LDIS   0x0008

Definition at line 315 of file ksz8851_driver.h.

◆ ISR_RXIS

#define ISR_RXIS   0x2000

Definition at line 308 of file ksz8851_driver.h.

◆ ISR_RXMPDIS

#define ISR_RXMPDIS   0x0010

Definition at line 314 of file ksz8851_driver.h.

◆ ISR_RXOIS

#define ISR_RXOIS   0x0800

Definition at line 309 of file ksz8851_driver.h.

◆ ISR_RXPSIS

#define ISR_RXPSIS   0x0100

Definition at line 311 of file ksz8851_driver.h.

◆ ISR_RXWFDIS

#define ISR_RXWFDIS   0x0020

Definition at line 313 of file ksz8851_driver.h.

◆ ISR_SPIBEIS

#define ISR_SPIBEIS   0x0002

Definition at line 317 of file ksz8851_driver.h.

◆ ISR_TXIS

#define ISR_TXIS   0x4000

Definition at line 307 of file ksz8851_driver.h.

◆ ISR_TXPSIS

#define ISR_TXPSIS   0x0200

Definition at line 310 of file ksz8851_driver.h.

◆ ISR_TXSAIS

#define ISR_TXSAIS   0x0040

Definition at line 312 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B0

#define KSZ8851_CMD_B0   0x04

Definition at line 61 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B1

#define KSZ8851_CMD_B1   0x08

Definition at line 62 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B2

#define KSZ8851_CMD_B2   0x10

Definition at line 63 of file ksz8851_driver.h.

◆ KSZ8851_CMD_B3

#define KSZ8851_CMD_B3   0x20

Definition at line 64 of file ksz8851_driver.h.

◆ KSZ8851_CMD_RD_FIFO

#define KSZ8851_CMD_RD_FIFO   0x80

Definition at line 56 of file ksz8851_driver.h.

◆ KSZ8851_CMD_RD_REG

#define KSZ8851_CMD_RD_REG   0x00

Definition at line 54 of file ksz8851_driver.h.

◆ KSZ8851_CMD_REG

#define KSZ8851_CMD_REG   *((volatile uint16_t *) 0x60000004)

Definition at line 46 of file ksz8851_driver.h.

◆ KSZ8851_CMD_WR_FIFO

#define KSZ8851_CMD_WR_FIFO   0xC0

Definition at line 57 of file ksz8851_driver.h.

◆ KSZ8851_CMD_WR_REG

#define KSZ8851_CMD_WR_REG   0x40

Definition at line 55 of file ksz8851_driver.h.

◆ KSZ8851_DATA_REG

#define KSZ8851_DATA_REG   *((volatile uint16_t *) 0x60000000)

Definition at line 41 of file ksz8851_driver.h.

◆ KSZ8851_REG_CCR

#define KSZ8851_REG_CCR   0x08

Definition at line 73 of file ksz8851_driver.h.

◆ KSZ8851_REG_CGCR

#define KSZ8851_REG_CGCR   0xC6

Definition at line 131 of file ksz8851_driver.h.

◆ KSZ8851_REG_CIDER

#define KSZ8851_REG_CIDER   0xC0

Definition at line 130 of file ksz8851_driver.h.

◆ KSZ8851_REG_EEPCR

#define KSZ8851_REG_EEPCR   0x22

Definition at line 78 of file ksz8851_driver.h.

◆ KSZ8851_REG_FCHWR

#define KSZ8851_REG_FCHWR   0xB2

Definition at line 128 of file ksz8851_driver.h.

◆ KSZ8851_REG_FCLWR

#define KSZ8851_REG_FCLWR   0xB0

Definition at line 127 of file ksz8851_driver.h.

◆ KSZ8851_REG_FCOWR

#define KSZ8851_REG_FCOWR   0xB4

Definition at line 129 of file ksz8851_driver.h.

◆ KSZ8851_REG_GRR

#define KSZ8851_REG_GRR   0x26

Definition at line 80 of file ksz8851_driver.h.

◆ KSZ8851_REG_GSWUTR

#define KSZ8851_REG_GSWUTR   0xD6

Definition at line 136 of file ksz8851_driver.h.

◆ KSZ8851_REG_IACR

#define KSZ8851_REG_IACR   0xC8

Definition at line 132 of file ksz8851_driver.h.

◆ KSZ8851_REG_IADHR

#define KSZ8851_REG_IADHR   0xD2

Definition at line 134 of file ksz8851_driver.h.

◆ KSZ8851_REG_IADLR

#define KSZ8851_REG_IADLR   0xD0

Definition at line 133 of file ksz8851_driver.h.

◆ KSZ8851_REG_IER

#define KSZ8851_REG_IER   0x90

Definition at line 119 of file ksz8851_driver.h.

◆ KSZ8851_REG_ISR

#define KSZ8851_REG_ISR   0x92

Definition at line 120 of file ksz8851_driver.h.

◆ KSZ8851_REG_MAHTR0

#define KSZ8851_REG_MAHTR0   0xA0

Definition at line 123 of file ksz8851_driver.h.

◆ KSZ8851_REG_MAHTR1

#define KSZ8851_REG_MAHTR1   0xA2

Definition at line 124 of file ksz8851_driver.h.

◆ KSZ8851_REG_MAHTR2

#define KSZ8851_REG_MAHTR2   0xA4

Definition at line 125 of file ksz8851_driver.h.

◆ KSZ8851_REG_MAHTR3

#define KSZ8851_REG_MAHTR3   0xA6

Definition at line 126 of file ksz8851_driver.h.

◆ KSZ8851_REG_MARH

#define KSZ8851_REG_MARH   0x14

Definition at line 76 of file ksz8851_driver.h.

◆ KSZ8851_REG_MARL

#define KSZ8851_REG_MARL   0x10

Definition at line 74 of file ksz8851_driver.h.

◆ KSZ8851_REG_MARM

#define KSZ8851_REG_MARM   0x12

Definition at line 75 of file ksz8851_driver.h.

◆ KSZ8851_REG_MBIR

#define KSZ8851_REG_MBIR   0x24

Definition at line 79 of file ksz8851_driver.h.

◆ KSZ8851_REG_OBCR

#define KSZ8851_REG_OBCR   0x20

Definition at line 77 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1ANAR

#define KSZ8851_REG_P1ANAR   0xEC

Definition at line 142 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1ANLPR

#define KSZ8851_REG_P1ANLPR   0xEE

Definition at line 143 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1CR

#define KSZ8851_REG_P1CR   0xF6

Definition at line 145 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1MBCR

#define KSZ8851_REG_P1MBCR   0xE4

Definition at line 138 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1MBSR

#define KSZ8851_REG_P1MBSR   0xE6

Definition at line 139 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1SCLMD

#define KSZ8851_REG_P1SCLMD   0xF4

Definition at line 144 of file ksz8851_driver.h.

◆ KSZ8851_REG_P1SR

#define KSZ8851_REG_P1SR   0xF8

Definition at line 146 of file ksz8851_driver.h.

◆ KSZ8851_REG_PHY1IHR

#define KSZ8851_REG_PHY1IHR   0xEA

Definition at line 141 of file ksz8851_driver.h.

◆ KSZ8851_REG_PHY1ILR

#define KSZ8851_REG_PHY1ILR   0xE8

Definition at line 140 of file ksz8851_driver.h.

◆ KSZ8851_REG_PHYRR

#define KSZ8851_REG_PHYRR   0xD8

Definition at line 137 of file ksz8851_driver.h.

◆ KSZ8851_REG_PMECR

#define KSZ8851_REG_PMECR   0xD4

Definition at line 135 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXCR1

#define KSZ8851_REG_RXCR1   0x74

Definition at line 108 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXCR2

#define KSZ8851_REG_RXCR2   0x76

Definition at line 109 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXDBCTR

#define KSZ8851_REG_RXDBCTR   0x8E

Definition at line 118 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXDTTR

#define KSZ8851_REG_RXDTTR   0x8C

Definition at line 117 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXFCTR

#define KSZ8851_REG_RXFCTR   0x9C

Definition at line 121 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXFDPR

#define KSZ8851_REG_RXFDPR   0x86

Definition at line 116 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXFHBCR

#define KSZ8851_REG_RXFHBCR   0x7E

Definition at line 112 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXFHSR

#define KSZ8851_REG_RXFHSR   0x7C

Definition at line 111 of file ksz8851_driver.h.

◆ KSZ8851_REG_RXQCR

#define KSZ8851_REG_RXQCR   0x82

Definition at line 114 of file ksz8851_driver.h.

◆ KSZ8851_REG_TXCR

#define KSZ8851_REG_TXCR   0x70

Definition at line 106 of file ksz8851_driver.h.

◆ KSZ8851_REG_TXFDPR

#define KSZ8851_REG_TXFDPR   0x84

Definition at line 115 of file ksz8851_driver.h.

◆ KSZ8851_REG_TXMIR

#define KSZ8851_REG_TXMIR   0x78

Definition at line 110 of file ksz8851_driver.h.

◆ KSZ8851_REG_TXNTFSR

#define KSZ8851_REG_TXNTFSR   0x9E

Definition at line 122 of file ksz8851_driver.h.

◆ KSZ8851_REG_TXQCR

#define KSZ8851_REG_TXQCR   0x80

Definition at line 113 of file ksz8851_driver.h.

◆ KSZ8851_REG_TXSR

#define KSZ8851_REG_TXSR   0x72

Definition at line 107 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF0BM0

#define KSZ8851_REG_WF0BM0   0x34

Definition at line 84 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF0BM1

#define KSZ8851_REG_WF0BM1   0x36

Definition at line 85 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF0BM2

#define KSZ8851_REG_WF0BM2   0x38

Definition at line 86 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF0BM3

#define KSZ8851_REG_WF0BM3   0x3A

Definition at line 87 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF0CRC0

#define KSZ8851_REG_WF0CRC0   0x30

Definition at line 82 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF0CRC1

#define KSZ8851_REG_WF0CRC1   0x32

Definition at line 83 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF1BM0

#define KSZ8851_REG_WF1BM0   0x44

Definition at line 90 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF1BM1

#define KSZ8851_REG_WF1BM1   0x46

Definition at line 91 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF1BM2

#define KSZ8851_REG_WF1BM2   0x48

Definition at line 92 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF1BM3

#define KSZ8851_REG_WF1BM3   0x4A

Definition at line 93 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF1CRC0

#define KSZ8851_REG_WF1CRC0   0x40

Definition at line 88 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF1CRC1

#define KSZ8851_REG_WF1CRC1   0x42

Definition at line 89 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF2BM0

#define KSZ8851_REG_WF2BM0   0x54

Definition at line 96 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF2BM1

#define KSZ8851_REG_WF2BM1   0x56

Definition at line 97 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF2BM2

#define KSZ8851_REG_WF2BM2   0x58

Definition at line 98 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF2BM3

#define KSZ8851_REG_WF2BM3   0x5A

Definition at line 99 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF2CRC0

#define KSZ8851_REG_WF2CRC0   0x50

Definition at line 94 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF2CRC1

#define KSZ8851_REG_WF2CRC1   0x52

Definition at line 95 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF3BM0

#define KSZ8851_REG_WF3BM0   0x64

Definition at line 102 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF3BM1

#define KSZ8851_REG_WF3BM1   0x66

Definition at line 103 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF3BM2

#define KSZ8851_REG_WF3BM2   0x68

Definition at line 104 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF3BM3

#define KSZ8851_REG_WF3BM3   0x6A

Definition at line 105 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF3CRC0

#define KSZ8851_REG_WF3CRC0   0x60

Definition at line 100 of file ksz8851_driver.h.

◆ KSZ8851_REG_WF3CRC1

#define KSZ8851_REG_WF3CRC1   0x62

Definition at line 101 of file ksz8851_driver.h.

◆ KSZ8851_REG_WFCR

#define KSZ8851_REG_WFCR   0x2A

Definition at line 81 of file ksz8851_driver.h.

◆ KSZ8851_REV_A2_ID

#define KSZ8851_REV_A2_ID   0x8870

Definition at line 50 of file ksz8851_driver.h.

◆ KSZ8851_REV_A3_ID

#define KSZ8851_REV_A3_ID   0x8872

Definition at line 51 of file ksz8851_driver.h.

◆ KSZ8851_SPI_SUPPORT

#define KSZ8851_SPI_SUPPORT   ENABLED

Definition at line 34 of file ksz8851_driver.h.

◆ MBIR_RXMBF

#define MBIR_RXMBF   0x0010

Definition at line 182 of file ksz8851_driver.h.

◆ MBIR_RXMBFA

#define MBIR_RXMBFA   0x0008

Definition at line 183 of file ksz8851_driver.h.

◆ MBIR_RXMBFC0

#define MBIR_RXMBFC0   0x0001

Definition at line 186 of file ksz8851_driver.h.

◆ MBIR_RXMBFC1

#define MBIR_RXMBFC1   0x0002

Definition at line 185 of file ksz8851_driver.h.

◆ MBIR_RXMBFC2

#define MBIR_RXMBFC2   0x0004

Definition at line 184 of file ksz8851_driver.h.

◆ MBIR_TXMBF

#define MBIR_TXMBF   0x1000

Definition at line 177 of file ksz8851_driver.h.

◆ MBIR_TXMBFA

#define MBIR_TXMBFA   0x0800

Definition at line 178 of file ksz8851_driver.h.

◆ MBIR_TXMBFC0

#define MBIR_TXMBFC0   0x0100

Definition at line 181 of file ksz8851_driver.h.

◆ MBIR_TXMBFC1

#define MBIR_TXMBFC1   0x0200

Definition at line 180 of file ksz8851_driver.h.

◆ MBIR_TXMBFC2

#define MBIR_TXMBFC2   0x0400

Definition at line 179 of file ksz8851_driver.h.

◆ OBCR_BUS_CLOCK_DIV0

#define OBCR_BUS_CLOCK_DIV0   0x0001

Definition at line 167 of file ksz8851_driver.h.

◆ OBCR_BUS_CLOCK_DIV1

#define OBCR_BUS_CLOCK_DIV1   0x0002

Definition at line 166 of file ksz8851_driver.h.

◆ OBCR_BUS_CLOCK_SEL

#define OBCR_BUS_CLOCK_SEL   0x0004

Definition at line 165 of file ksz8851_driver.h.

◆ OBCR_OUT_DRIVE_STRENGTH

#define OBCR_OUT_DRIVE_STRENGTH   0x0040

Definition at line 161 of file ksz8851_driver.h.

◆ OBCR_SPI_SO_DELAY0

#define OBCR_SPI_SO_DELAY0   0x0008

Definition at line 164 of file ksz8851_driver.h.

◆ OBCR_SPI_SO_DELAY1

#define OBCR_SPI_SO_DELAY1   0x0010

Definition at line 163 of file ksz8851_driver.h.

◆ OBCR_SPI_SO_DELAY2

#define OBCR_SPI_SO_DELAY2   0x0020

Definition at line 162 of file ksz8851_driver.h.

◆ P1ANAR_ADV_10

#define P1ANAR_ADV_10   0x0020

Definition at line 378 of file ksz8851_driver.h.

◆ P1ANAR_ADV_100

#define P1ANAR_ADV_100   0x0080

Definition at line 376 of file ksz8851_driver.h.

◆ P1ANAR_ADV_100_FD

#define P1ANAR_ADV_100_FD   0x0100

Definition at line 375 of file ksz8851_driver.h.

◆ P1ANAR_ADV_10_FD

#define P1ANAR_ADV_10_FD   0x0040

Definition at line 377 of file ksz8851_driver.h.

◆ P1ANAR_ADV_PAUSE

#define P1ANAR_ADV_PAUSE   0x0400

Definition at line 374 of file ksz8851_driver.h.

◆ P1ANAR_NEXT_PAGE

#define P1ANAR_NEXT_PAGE   0x8000

Definition at line 372 of file ksz8851_driver.h.

◆ P1ANAR_REMOTE_FAULT

#define P1ANAR_REMOTE_FAULT   0x2000

Definition at line 373 of file ksz8851_driver.h.

◆ P1ANAR_SELECTOR_FIELD0

#define P1ANAR_SELECTOR_FIELD0   0x0001

Definition at line 383 of file ksz8851_driver.h.

◆ P1ANAR_SELECTOR_FIELD1

#define P1ANAR_SELECTOR_FIELD1   0x0002

Definition at line 382 of file ksz8851_driver.h.

◆ P1ANAR_SELECTOR_FIELD2

#define P1ANAR_SELECTOR_FIELD2   0x0004

Definition at line 381 of file ksz8851_driver.h.

◆ P1ANAR_SELECTOR_FIELD3

#define P1ANAR_SELECTOR_FIELD3   0x0008

Definition at line 380 of file ksz8851_driver.h.

◆ P1ANAR_SELECTOR_FIELD4

#define P1ANAR_SELECTOR_FIELD4   0x0010

Definition at line 379 of file ksz8851_driver.h.

◆ P1ANLPR_ADV_10

#define P1ANLPR_ADV_10   0x0020

Definition at line 393 of file ksz8851_driver.h.

◆ P1ANLPR_ADV_100

#define P1ANLPR_ADV_100   0x0080

Definition at line 391 of file ksz8851_driver.h.

◆ P1ANLPR_ADV_100_FD

#define P1ANLPR_ADV_100_FD   0x0100

Definition at line 390 of file ksz8851_driver.h.

◆ P1ANLPR_ADV_10_FD

#define P1ANLPR_ADV_10_FD   0x0040

Definition at line 392 of file ksz8851_driver.h.

◆ P1ANLPR_ADV_PAUSE

#define P1ANLPR_ADV_PAUSE   0x0400

Definition at line 389 of file ksz8851_driver.h.

◆ P1ANLPR_LP_ACK

#define P1ANLPR_LP_ACK   0x4000

Definition at line 387 of file ksz8851_driver.h.

◆ P1ANLPR_NEXT_PAGE

#define P1ANLPR_NEXT_PAGE   0x8000

Definition at line 386 of file ksz8851_driver.h.

◆ P1ANLPR_REMOTE_FAULT

#define P1ANLPR_REMOTE_FAULT   0x2000

Definition at line 388 of file ksz8851_driver.h.

◆ P1CR_ADV_10

#define P1CR_ADV_10   0x0001

Definition at line 415 of file ksz8851_driver.h.

◆ P1CR_ADV_100

#define P1CR_ADV_100   0x0004

Definition at line 413 of file ksz8851_driver.h.

◆ P1CR_ADV_100_FD

#define P1CR_ADV_100_FD   0x0008

Definition at line 412 of file ksz8851_driver.h.

◆ P1CR_ADV_10_FD

#define P1CR_ADV_10_FD   0x0002

Definition at line 414 of file ksz8851_driver.h.

◆ P1CR_ADV_PAUSE

#define P1CR_ADV_PAUSE   0x0010

Definition at line 411 of file ksz8851_driver.h.

◆ P1CR_AN_ENABLE

#define P1CR_AN_ENABLE   0x0080

Definition at line 408 of file ksz8851_driver.h.

◆ P1CR_DISABLE_AUTO_MDIX

#define P1CR_DISABLE_AUTO_MDIX   0x0400

Definition at line 406 of file ksz8851_driver.h.

◆ P1CR_FORCE_DUPLEX

#define P1CR_FORCE_DUPLEX   0x0020

Definition at line 410 of file ksz8851_driver.h.

◆ P1CR_FORCE_MDIX

#define P1CR_FORCE_MDIX   0x0200

Definition at line 407 of file ksz8851_driver.h.

◆ P1CR_FORCE_SPEED

#define P1CR_FORCE_SPEED   0x0040

Definition at line 409 of file ksz8851_driver.h.

◆ P1CR_LED_OFF

#define P1CR_LED_OFF   0x8000

Definition at line 403 of file ksz8851_driver.h.

◆ P1CR_RESTART_AN

#define P1CR_RESTART_AN   0x2000

Definition at line 405 of file ksz8851_driver.h.

◆ P1CR_TX_DISABLE

#define P1CR_TX_DISABLE   0x4000

Definition at line 404 of file ksz8851_driver.h.

◆ P1MBCR_AN_ENABLE

#define P1MBCR_AN_ENABLE   0x1000

Definition at line 349 of file ksz8851_driver.h.

◆ P1MBCR_DISABLE_LED

#define P1MBCR_DISABLE_LED   0x0001

Definition at line 356 of file ksz8851_driver.h.

◆ P1MBCR_DISABLE_MDIX

#define P1MBCR_DISABLE_MDIX   0x0008

Definition at line 354 of file ksz8851_driver.h.

◆ P1MBCR_DISABLE_TRANSMIT

#define P1MBCR_DISABLE_TRANSMIT   0x0002

Definition at line 355 of file ksz8851_driver.h.

◆ P1MBCR_FORCE_100

#define P1MBCR_FORCE_100   0x2000

Definition at line 348 of file ksz8851_driver.h.

◆ P1MBCR_FORCE_FULL_DUPLEX

#define P1MBCR_FORCE_FULL_DUPLEX   0x0100

Definition at line 351 of file ksz8851_driver.h.

◆ P1MBCR_FORCE_MDIX

#define P1MBCR_FORCE_MDIX   0x0010

Definition at line 353 of file ksz8851_driver.h.

◆ P1MBCR_HP_MDIX

#define P1MBCR_HP_MDIX   0x0020

Definition at line 352 of file ksz8851_driver.h.

◆ P1MBCR_LOCAL_LOOPBACK

#define P1MBCR_LOCAL_LOOPBACK   0x4000

Definition at line 347 of file ksz8851_driver.h.

◆ P1MBCR_RESTART_AN

#define P1MBCR_RESTART_AN   0x0200

Definition at line 350 of file ksz8851_driver.h.

◆ P1MBSR_100_CAPABLE

#define P1MBSR_100_CAPABLE   0x2000

Definition at line 361 of file ksz8851_driver.h.

◆ P1MBSR_100_FD_CAPABLE

#define P1MBSR_100_FD_CAPABLE   0x4000

Definition at line 360 of file ksz8851_driver.h.

◆ P1MBSR_10_CAPABLE

#define P1MBSR_10_CAPABLE   0x0800

Definition at line 363 of file ksz8851_driver.h.

◆ P1MBSR_10_FD_CAPABLE

#define P1MBSR_10_FD_CAPABLE   0x1000

Definition at line 362 of file ksz8851_driver.h.

◆ P1MBSR_AN_CAPABLE

#define P1MBSR_AN_CAPABLE   0x0008

Definition at line 366 of file ksz8851_driver.h.

◆ P1MBSR_AN_COMPLETE

#define P1MBSR_AN_COMPLETE   0x0020

Definition at line 365 of file ksz8851_driver.h.

◆ P1MBSR_EXTENDED_CAPABLE

#define P1MBSR_EXTENDED_CAPABLE   0x0001

Definition at line 369 of file ksz8851_driver.h.

◆ P1MBSR_JABBER_TEST

#define P1MBSR_JABBER_TEST   0x0002

Definition at line 368 of file ksz8851_driver.h.

◆ P1MBSR_LINK_STATUS

#define P1MBSR_LINK_STATUS   0x0004

Definition at line 367 of file ksz8851_driver.h.

◆ P1MBSR_PREAMBLE_SUPPR

#define P1MBSR_PREAMBLE_SUPPR   0x0040

Definition at line 364 of file ksz8851_driver.h.

◆ P1MBSR_T4_CAPABLE

#define P1MBSR_T4_CAPABLE   0x8000

Definition at line 359 of file ksz8851_driver.h.

◆ P1SCLMD_FORCE_LNK

#define P1SCLMD_FORCE_LNK   0x0800

Definition at line 399 of file ksz8851_driver.h.

◆ P1SCLMD_REMOTE_LOOPBACK

#define P1SCLMD_REMOTE_LOOPBACK   0x0200

Definition at line 400 of file ksz8851_driver.h.

◆ P1SCLMD_VCT_EN

#define P1SCLMD_VCT_EN   0x1000

Definition at line 398 of file ksz8851_driver.h.

◆ P1SCLMD_VCT_RESULT0

#define P1SCLMD_VCT_RESULT0   0x2000

Definition at line 397 of file ksz8851_driver.h.

◆ P1SCLMD_VCT_RESULT1

#define P1SCLMD_VCT_RESULT1   0x4000

Definition at line 396 of file ksz8851_driver.h.

◆ P1SR_AN_DONE

#define P1SR_AN_DONE   0x0040

Definition at line 423 of file ksz8851_driver.h.

◆ P1SR_HP_MDIX

#define P1SR_HP_MDIX   0x8000

Definition at line 418 of file ksz8851_driver.h.

◆ P1SR_LINK_GOOD

#define P1SR_LINK_GOOD   0x0020

Definition at line 424 of file ksz8851_driver.h.

◆ P1SR_MDIX_STATUS

#define P1SR_MDIX_STATUS   0x0080

Definition at line 422 of file ksz8851_driver.h.

◆ P1SR_OPERATION_DUPLEX

#define P1SR_OPERATION_DUPLEX   0x0200

Definition at line 421 of file ksz8851_driver.h.

◆ P1SR_OPERATION_SPEED

#define P1SR_OPERATION_SPEED   0x0400

Definition at line 420 of file ksz8851_driver.h.

◆ P1SR_PARTNER_ADV_10

#define P1SR_PARTNER_ADV_10   0x0001

Definition at line 429 of file ksz8851_driver.h.

◆ P1SR_PARTNER_ADV_100

#define P1SR_PARTNER_ADV_100   0x0004

Definition at line 427 of file ksz8851_driver.h.

◆ P1SR_PARTNER_ADV_100_FD

#define P1SR_PARTNER_ADV_100_FD   0x0008

Definition at line 426 of file ksz8851_driver.h.

◆ P1SR_PARTNER_ADV_10_FD

#define P1SR_PARTNER_ADV_10_FD   0x0002

Definition at line 428 of file ksz8851_driver.h.

◆ P1SR_PARTNER_ADV_PAUSE

#define P1SR_PARTNER_ADV_PAUSE   0x0010

Definition at line 425 of file ksz8851_driver.h.

◆ P1SR_REVERSED_POLARITY

#define P1SR_REVERSED_POLARITY   0x2000

Definition at line 419 of file ksz8851_driver.h.

◆ PHYRR_PHY_RESET

#define PHYRR_PHY_RESET   0x0001

Definition at line 344 of file ksz8851_driver.h.

◆ PMECR_AUTO_WUP_EN

#define PMECR_AUTO_WUP_EN   0x0080

Definition at line 334 of file ksz8851_driver.h.

◆ PMECR_PME_DELAY_EN

#define PMECR_PME_DELAY_EN   0x4000

Definition at line 328 of file ksz8851_driver.h.

◆ PMECR_PME_ENERGY_EN

#define PMECR_PME_ENERGY_EN   0x0100

Definition at line 333 of file ksz8851_driver.h.

◆ PMECR_PME_LINK_UP_EN

#define PMECR_PME_LINK_UP_EN   0x0200

Definition at line 332 of file ksz8851_driver.h.

◆ PMECR_PME_MAGIC_EN

#define PMECR_PME_MAGIC_EN   0x0400

Definition at line 331 of file ksz8851_driver.h.

◆ PMECR_PME_POLARITY

#define PMECR_PME_POLARITY   0x1000

Definition at line 329 of file ksz8851_driver.h.

◆ PMECR_PME_WUP_FRAME_EN

#define PMECR_PME_WUP_FRAME_EN   0x0800

Definition at line 330 of file ksz8851_driver.h.

◆ PMECR_PWR_MODE0

#define PMECR_PWR_MODE0   0x0001

Definition at line 341 of file ksz8851_driver.h.

◆ PMECR_PWR_MODE1

#define PMECR_PWR_MODE1   0x0002

Definition at line 340 of file ksz8851_driver.h.

◆ PMECR_WUP_FROM_ENERGY

#define PMECR_WUP_FROM_ENERGY   0x0004

Definition at line 339 of file ksz8851_driver.h.

◆ PMECR_WUP_FROM_LINK_UP

#define PMECR_WUP_FROM_LINK_UP   0x0008

Definition at line 338 of file ksz8851_driver.h.

◆ PMECR_WUP_FROM_MAGIC

#define PMECR_WUP_FROM_MAGIC   0x0010

Definition at line 337 of file ksz8851_driver.h.

◆ PMECR_WUP_FROM_WUP_FRAME

#define PMECR_WUP_FROM_WUP_FRAME   0x0020

Definition at line 336 of file ksz8851_driver.h.

◆ PMECR_WUP_NORMAL_OP_MODE

#define PMECR_WUP_NORMAL_OP_MODE   0x0040

Definition at line 335 of file ksz8851_driver.h.

◆ RXCR1_FRXQ

#define RXCR1_FRXQ   0x8000

Definition at line 221 of file ksz8851_driver.h.

◆ RXCR1_RXAE

#define RXCR1_RXAE   0x0010

Definition at line 232 of file ksz8851_driver.h.

◆ RXCR1_RXBE

#define RXCR1_RXBE   0x0080

Definition at line 229 of file ksz8851_driver.h.

◆ RXCR1_RXE

#define RXCR1_RXE   0x0001

Definition at line 234 of file ksz8851_driver.h.

◆ RXCR1_RXEFE

#define RXCR1_RXEFE   0x0200

Definition at line 227 of file ksz8851_driver.h.

◆ RXCR1_RXFCE

#define RXCR1_RXFCE   0x0400

Definition at line 226 of file ksz8851_driver.h.

◆ RXCR1_RXINVF

#define RXCR1_RXINVF   0x0002

Definition at line 233 of file ksz8851_driver.h.

◆ RXCR1_RXIPFCC

#define RXCR1_RXIPFCC   0x1000

Definition at line 224 of file ksz8851_driver.h.

◆ RXCR1_RXMAFMA

#define RXCR1_RXMAFMA   0x0100

Definition at line 228 of file ksz8851_driver.h.

◆ RXCR1_RXME

#define RXCR1_RXME   0x0040

Definition at line 230 of file ksz8851_driver.h.

◆ RXCR1_RXPAFMA

#define RXCR1_RXPAFMA   0x0800

Definition at line 225 of file ksz8851_driver.h.

◆ RXCR1_RXTCPFCC

#define RXCR1_RXTCPFCC   0x2000

Definition at line 223 of file ksz8851_driver.h.

◆ RXCR1_RXUDPFCC

#define RXCR1_RXUDPFCC   0x4000

Definition at line 222 of file ksz8851_driver.h.

◆ RXCR1_RXUE

#define RXCR1_RXUE   0x0020

Definition at line 231 of file ksz8851_driver.h.

◆ RXCR2_IUFFP

#define RXCR2_IUFFP   0x0010

Definition at line 240 of file ksz8851_driver.h.

◆ RXCR2_RXICMPFCC

#define RXCR2_RXICMPFCC   0x0002

Definition at line 243 of file ksz8851_driver.h.

◆ RXCR2_RXIUFCEZ

#define RXCR2_RXIUFCEZ   0x0008

Definition at line 241 of file ksz8851_driver.h.

◆ RXCR2_RXSAF

#define RXCR2_RXSAF   0x0001

Definition at line 244 of file ksz8851_driver.h.

◆ RXCR2_SRDBL0

#define RXCR2_SRDBL0   0x0020

Definition at line 239 of file ksz8851_driver.h.

◆ RXCR2_SRDBL1

#define RXCR2_SRDBL1   0x0040

Definition at line 238 of file ksz8851_driver.h.

◆ RXCR2_SRDBL2

#define RXCR2_SRDBL2   0x0080

Definition at line 237 of file ksz8851_driver.h.

◆ RXCR2_UDPLFE

#define RXCR2_UDPLFE   0x0004

Definition at line 242 of file ksz8851_driver.h.

◆ RXFDPR_RXFPAI

#define RXFDPR_RXFPAI   0x4000

Definition at line 288 of file ksz8851_driver.h.

◆ RXFHBCR_RXBC_MASK

#define RXFHBCR_RXBC_MASK   0x0FFF

Definition at line 265 of file ksz8851_driver.h.

◆ RXFHSR_RXBF

#define RXFHSR_RXBF   0x0080

Definition at line 255 of file ksz8851_driver.h.

◆ RXFHSR_RXCE

#define RXFHSR_RXCE   0x0001

Definition at line 262 of file ksz8851_driver.h.

◆ RXFHSR_RXFT

#define RXFHSR_RXFT   0x0008

Definition at line 259 of file ksz8851_driver.h.

◆ RXFHSR_RXFTL

#define RXFHSR_RXFTL   0x0004

Definition at line 260 of file ksz8851_driver.h.

◆ RXFHSR_RXFV

#define RXFHSR_RXFV   0x8000

Definition at line 250 of file ksz8851_driver.h.

◆ RXFHSR_RXICMPFCS

#define RXFHSR_RXICMPFCS   0x2000

Definition at line 251 of file ksz8851_driver.h.

◆ RXFHSR_RXIPFCS

#define RXFHSR_RXIPFCS   0x1000

Definition at line 252 of file ksz8851_driver.h.

◆ RXFHSR_RXMF

#define RXFHSR_RXMF   0x0040

Definition at line 256 of file ksz8851_driver.h.

◆ RXFHSR_RXMR

#define RXFHSR_RXMR   0x0010

Definition at line 258 of file ksz8851_driver.h.

◆ RXFHSR_RXRF

#define RXFHSR_RXRF   0x0002

Definition at line 261 of file ksz8851_driver.h.

◆ RXFHSR_RXTCPFCS

#define RXFHSR_RXTCPFCS   0x0800

Definition at line 253 of file ksz8851_driver.h.

◆ RXFHSR_RXUDPFCS

#define RXFHSR_RXUDPFCS   0x0400

Definition at line 254 of file ksz8851_driver.h.

◆ RXFHSR_RXUF

#define RXFHSR_RXUF   0x0020

Definition at line 257 of file ksz8851_driver.h.

◆ RXQCR_ADRFE

#define RXQCR_ADRFE   0x0010

Definition at line 280 of file ksz8851_driver.h.

◆ RXQCR_RRXEF

#define RXQCR_RRXEF   0x0001

Definition at line 282 of file ksz8851_driver.h.

◆ RXQCR_RXDBCTE

#define RXQCR_RXDBCTE   0x0040

Definition at line 278 of file ksz8851_driver.h.

◆ RXQCR_RXDBCTS

#define RXQCR_RXDBCTS   0x0800

Definition at line 274 of file ksz8851_driver.h.

◆ RXQCR_RXDTTE

#define RXQCR_RXDTTE   0x0080

Definition at line 277 of file ksz8851_driver.h.

◆ RXQCR_RXDTTS

#define RXQCR_RXDTTS   0x1000

Definition at line 273 of file ksz8851_driver.h.

◆ RXQCR_RXFCTE

#define RXQCR_RXFCTE   0x0020

Definition at line 279 of file ksz8851_driver.h.

◆ RXQCR_RXFCTS

#define RXQCR_RXFCTS   0x0400

Definition at line 275 of file ksz8851_driver.h.

◆ RXQCR_RXIPHTOE

#define RXQCR_RXIPHTOE   0x0200

Definition at line 276 of file ksz8851_driver.h.

◆ RXQCR_SDA

#define RXQCR_SDA   0x0008

Definition at line 281 of file ksz8851_driver.h.

◆ TX_CTRL_TXFID

#define TX_CTRL_TXFID   0x003F

Definition at line 433 of file ksz8851_driver.h.

◆ TX_CTRL_TXIC

#define TX_CTRL_TXIC   0x8000

Definition at line 432 of file ksz8851_driver.h.

◆ TXCR_FTXQ

#define TXCR_FTXQ   0x0010

Definition at line 204 of file ksz8851_driver.h.

◆ TXCR_TCGICMP

#define TXCR_TCGICMP   0x0100

Definition at line 200 of file ksz8851_driver.h.

◆ TXCR_TCGIP

#define TXCR_TCGIP   0x0020

Definition at line 203 of file ksz8851_driver.h.

◆ TXCR_TCGTCP

#define TXCR_TCGTCP   0x0040

Definition at line 202 of file ksz8851_driver.h.

◆ TXCR_TCGUDP

#define TXCR_TCGUDP   0x0080

Definition at line 201 of file ksz8851_driver.h.

◆ TXCR_TXCE

#define TXCR_TXCE   0x0002

Definition at line 207 of file ksz8851_driver.h.

◆ TXCR_TXE

#define TXCR_TXE   0x0001

Definition at line 208 of file ksz8851_driver.h.

◆ TXCR_TXFCE

#define TXCR_TXFCE   0x0008

Definition at line 205 of file ksz8851_driver.h.

◆ TXCR_TXPE

#define TXCR_TXPE   0x0004

Definition at line 206 of file ksz8851_driver.h.

◆ TXFDPR_TXFPAI

#define TXFDPR_TXFPAI   0x4000

Definition at line 285 of file ksz8851_driver.h.

◆ TXMIR_TXMA_MASK

#define TXMIR_TXMA_MASK   0x1FFF

Definition at line 247 of file ksz8851_driver.h.

◆ TXQCR_AETFE

#define TXQCR_AETFE   0x0004

Definition at line 268 of file ksz8851_driver.h.

◆ TXQCR_METFE

#define TXQCR_METFE   0x0001

Definition at line 270 of file ksz8851_driver.h.

◆ TXQCR_TXQMAM

#define TXQCR_TXQMAM   0x0002

Definition at line 269 of file ksz8851_driver.h.

◆ TXSR_TXFID0

#define TXSR_TXFID0   0x0001

Definition at line 218 of file ksz8851_driver.h.

◆ TXSR_TXFID1

#define TXSR_TXFID1   0x0002

Definition at line 217 of file ksz8851_driver.h.

◆ TXSR_TXFID2

#define TXSR_TXFID2   0x0004

Definition at line 216 of file ksz8851_driver.h.

◆ TXSR_TXFID3

#define TXSR_TXFID3   0x0008

Definition at line 215 of file ksz8851_driver.h.

◆ TXSR_TXFID4

#define TXSR_TXFID4   0x0010

Definition at line 214 of file ksz8851_driver.h.

◆ TXSR_TXFID5

#define TXSR_TXFID5   0x0020

Definition at line 213 of file ksz8851_driver.h.

◆ TXSR_TXLC

#define TXSR_TXLC   0x2000

Definition at line 211 of file ksz8851_driver.h.

◆ TXSR_TXMC

#define TXSR_TXMC   0x1000

Definition at line 212 of file ksz8851_driver.h.

◆ WFCR_MPRXE

#define WFCR_MPRXE   0x0080

Definition at line 193 of file ksz8851_driver.h.

◆ WFCR_WF0E

#define WFCR_WF0E   0x0001

Definition at line 197 of file ksz8851_driver.h.

◆ WFCR_WF1E

#define WFCR_WF1E   0x0002

Definition at line 196 of file ksz8851_driver.h.

◆ WFCR_WF2E

#define WFCR_WF2E   0x0004

Definition at line 195 of file ksz8851_driver.h.

◆ WFCR_WF3E

#define WFCR_WF3E   0x0008

Definition at line 194 of file ksz8851_driver.h.

Typedef Documentation

◆ Ksz8851RxHeader

typedef { ... } Ksz8851RxHeader

RX packet header.

◆ Ksz8851TxHeader

typedef { ... } Ksz8851TxHeader

TX packet header.

Function Documentation

◆ ksz8851CalcCrc()

uint32_t ksz8851CalcCrc ( const void *  data,
size_t  length 
)

CRC calculation.

Parameters
[in]dataPointer to the data over which to calculate the CRC
[in]lengthNumber of bytes to process
Returns
Resulting CRC value

Definition at line 773 of file ksz8851_driver.c.

◆ ksz8851ClearBit()

void ksz8851ClearBit ( NetInterface interface,
uint8_t  address,
uint16_t  mask 
)

Clear bit field.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]maskBits to clear in the target register

Definition at line 755 of file ksz8851_driver.c.

◆ ksz8851DisableIrq()

void ksz8851DisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 198 of file ksz8851_driver.c.

◆ ksz8851DumpReg()

void ksz8851DumpReg ( NetInterface interface)

Dump registers for debugging purpose.

Parameters
[in]interfaceUnderlying network interface

Definition at line 807 of file ksz8851_driver.c.

◆ ksz8851EnableIrq()

void ksz8851EnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 186 of file ksz8851_driver.c.

◆ ksz8851EventHandler()

void ksz8851EventHandler ( NetInterface interface)

KSZ8851 event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 283 of file ksz8851_driver.c.

◆ ksz8851Init()

error_t ksz8851Init ( NetInterface interface)

KSZ8851 controller initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 69 of file ksz8851_driver.c.

◆ ksz8851IrqHandler()

bool_t ksz8851IrqHandler ( NetInterface interface)

KSZ8851 interrupt service routine.

Parameters
[in]interfaceUnderlying network interface
Returns
TRUE if a higher priority task must be woken. Else FALSE is returned

Definition at line 211 of file ksz8851_driver.c.

◆ ksz8851ReadFifo()

void ksz8851ReadFifo ( NetInterface interface,
uint8_t *  data,
size_t  length 
)

Read RX FIFO.

Parameters
[in]interfaceUnderlying network interface
[in]dataBuffer where to store the incoming data
[in]lengthNumber of data to read

Definition at line 675 of file ksz8851_driver.c.

◆ ksz8851ReadReg()

uint16_t ksz8851ReadReg ( NetInterface interface,
uint8_t  address 
)

Read KSZ8851 register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
Returns
Register value

Definition at line 584 of file ksz8851_driver.c.

◆ ksz8851ReceivePacket()

error_t ksz8851ReceivePacket ( NetInterface interface)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 429 of file ksz8851_driver.c.

◆ ksz8851SendPacket()

error_t ksz8851SendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
Returns
Error code

Definition at line 358 of file ksz8851_driver.c.

◆ ksz8851SetBit()

void ksz8851SetBit ( NetInterface interface,
uint8_t  address,
uint16_t  mask 
)

Set bit field.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]maskBits to set in the target register

Definition at line 737 of file ksz8851_driver.c.

◆ ksz8851Tick()

void ksz8851Tick ( NetInterface interface)

KSZ8851 timer handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 176 of file ksz8851_driver.c.

◆ ksz8851UpdateMacAddrFilter()

error_t ksz8851UpdateMacAddrFilter ( NetInterface interface)

Configure MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 483 of file ksz8851_driver.c.

◆ ksz8851WriteFifo()

void ksz8851WriteFifo ( NetInterface interface,
const uint8_t *  data,
size_t  length 
)

Write TX FIFO.

Parameters
[in]interfaceUnderlying network interface
[in]dataPointer to the data being written
[in]lengthNumber of data to write

Definition at line 633 of file ksz8851_driver.c.

◆ ksz8851WriteReg()

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

Write KSZ8851 register.

Parameters
[in]interfaceUnderlying network interface
[in]addressRegister address
[in]dataRegister value

Definition at line 540 of file ksz8851_driver.c.

Variable Documentation

◆ byteCount

uint16_t byteCount

Definition at line 448 of file ksz8851_driver.h.

◆ controlWord

uint16_t controlWord

Definition at line 447 of file ksz8851_driver.h.

◆ ksz8851Driver

const NicDriver ksz8851Driver

KSZ8851 driver.

Definition at line 42 of file ksz8851_driver.c.

◆ statusWord

uint16_t statusWord

Definition at line 458 of file ksz8851_driver.h.