SAMV71 Xplained Ultra Software Package 1.5

gmacb_phy.h File Reference

#include "board.h"

Go to the source code of this file.

Data Structures

struct  GMacb

Defines

#define GMACB_RESET_LENGTH   0xD

Functions

void GMACB_SetupTimeout (GMacb *pMacb, uint32_t toMax)
 Setup the maximum timeout count of the driver.
void GMACB_Init (GMacb *pMacb, sGmacd *pGmacd, uint8_t phyAddress)
 Initialize the MACB instance.
uint8_t GMACB_InitPhy (GMacb *pMacb, uint32_t mck, const Pin *pResetPins, uint32_t nbResetPins, const Pin *pEmacPins, uint32_t nbEmacPins)
 Do a HW initialize to the PHY (via RSTC) and set up clocks & PIOs This should be called only once to initialize the PHY pre-settings. The PHY address is reset status of CRS,RXD[3:0] (the emacPins' pullups). The COL pin is used to select MII mode on reset (pulled up for Reduced MII) The RXDV pin is used to select test mode on reset (pulled up for test mode) The above pins should be predefined for corresponding settings in resetPins The GMAC peripheral pins are configured after the reset done.
uint8_t GMACB_AutoNegotiate (GMacb *pMacb)
 Issue a Auto Negotiation of the PHY.
uint8_t GMACB_GetLinkSpeed (GMacb *pMacb, uint8_t applySettings)
uint8_t GMACB_Send (GMacb *pMacb, void *pBuffer, uint32_t size)
uint32_t GMACB_Poll (GMacb *pMacb, uint8_t *pBuffer, uint32_t size)
void GMACB_DumpRegisters (GMacb *pMacb)
 Dump all the useful registers.
uint8_t GMACB_ResetPhy (GMacb *pMacb)
 Issue a SW reset to reset all registers of the PHY.

Detailed Description

Definition in file gmacb_phy.h.


Define Documentation

#define GMACB_RESET_LENGTH   0xD

The reset length setting for external reset configuration

Definition at line 69 of file gmacb_phy.h.


Function Documentation

uint8_t GMACB_AutoNegotiate ( GMacb pMacb  ) 

Issue a Auto Negotiation of the PHY.

Parameters:
pMacb Pointer to the MACB instance
Returns:
1 if successfully, 0 if timeout.

Set the Auto_negotiation Advertisement Register, MII advertising for Next page 100BaseTxFD and HD, 10BaseTFD and HD, IEEE 802.3

Definition at line 386 of file gmacb_phy.c.

Here is the call graph for this function:

void GMACB_DumpRegisters ( GMacb pMacb  ) 

Dump all the useful registers.

Parameters:
pMacb Pointer to the MACB instance

Definition at line 203 of file gmacb_phy.c.

Here is the call graph for this function:

void GMACB_Init ( GMacb pMacb,
sGmacd pGmacd,
uint8_t  phyAddress 
)

Initialize the MACB instance.

Parameters:
pMacb Pointer to the MACB instance
phyAddress The PHY address used to access the PHY

Definition at line 265 of file gmacb_phy.c.

uint8_t GMACB_InitPhy ( GMacb pMacb,
uint32_t  mck,
const Pin pResetPins,
uint32_t  nbResetPins,
const Pin pGmacPins,
uint32_t  nbGmacPins 
)

Do a HW initialize to the PHY (via RSTC) and set up clocks & PIOs This should be called only once to initialize the PHY pre-settings. The PHY address is reset status of CRS,RXD[3:0] (the emacPins' pullups). The COL pin is used to select MII mode on reset (pulled up for Reduced MII) The RXDV pin is used to select test mode on reset (pulled up for test mode) The above pins should be predefined for corresponding settings in resetPins The GMAC peripheral pins are configured after the reset done.

Parameters:
pMacb Pointer to the MACB instance
mck Main clock setting to initialize clock
resetPins Pointer to list of PIOs to configure before HW RESET (for PHY power on reset configuration latch)
nbResetPins Number of PIO items that should be configured
emacPins Pointer to list of PIOs for the EMAC interface
nbEmacPins Number of PIO items that should be configured
Returns:
1 if RESET OK, 0 if timeout.

Definition at line 328 of file gmacb_phy.c.

Here is the call graph for this function:

uint8_t GMACB_ResetPhy ( GMacb pMacb  ) 

Issue a SW reset to reset all registers of the PHY.

Parameters:
pMacb Pointer to the MACB instance
Returns:
1 if successfully, 0 if timeout.

Definition at line 279 of file gmacb_phy.c.

Here is the call graph for this function:

void GMACB_SetupTimeout ( GMacb pMacb,
uint32_t  toMax 
)

Setup the maximum timeout count of the driver.

Parameters:
pMacb Pointer to the MACB instance
toMax Timeout maximum count.

Definition at line 255 of file gmacb_phy.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines