LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
lpc_phy_dp83848.c File Reference
#include "chip.h"
#include "lpc_phy.h"

Go to the source code of this file.

Macros

#define DP8_BMCR_REG   0x0
 DP83848 PHY register offsets.
 
#define DP8_BMSR_REG   0x1
 
#define DP8_ANADV_REG   0x4
 
#define DP8_ANLPA_REG   0x5
 
#define DP8_ANEEXP_REG   0x6
 
#define DP8_PHY_STAT_REG   0x10
 
#define DP8_PHY_INT_CTL_REG   0x11
 
#define DP8_PHY_RBR_REG   0x17
 
#define DP8_PHY_STS_REG   0x19
 
#define DP8_RESET   (1 << 15)
 
#define DP8_LOOPBACK   (1 << 14)
 
#define DP8_SPEED_SELECT   (1 << 13)
 
#define DP8_AUTONEG   (1 << 12)
 
#define DP8_POWER_DOWN   (1 << 11)
 
#define DP8_ISOLATE   (1 << 10)
 
#define DP8_RESTART_AUTONEG   (1 << 9)
 
#define DP8_DUPLEX_MODE   (1 << 8)
 
#define DP8_COLLISION_TEST   (1 << 7)
 
#define DP8_100BASE_T4   (1 << 15)
 
#define DP8_100BASE_TX_FD   (1 << 14)
 
#define DP8_100BASE_TX_HD   (1 << 13)
 
#define DP8_10BASE_T_FD   (1 << 12)
 
#define DP8_10BASE_T_HD   (1 << 11)
 
#define DP8_MF_PREAMB_SUPPR   (1 << 6)
 
#define DP8_AUTONEG_COMP   (1 << 5)
 
#define DP8_RMT_FAULT   (1 << 4)
 
#define DP8_AUTONEG_ABILITY   (1 << 3)
 
#define DP8_LINK_STATUS   (1 << 2)
 
#define DP8_JABBER_DETECT   (1 << 1)
 
#define DP8_EXTEND_CAPAB   (1 << 0)
 
#define DP8_RBR_RMII_MODE   (1 << 5)
 
#define DP8_REMOTEFAULT   (1 << 6)
 
#define DP8_FULLDUPLEX   (1 << 2)
 
#define DP8_SPEED10MBPS   (1 << 1)
 
#define DP8_VALID_LINK   (1 << 0)
 
#define DP8_PHYID1_OUI   0x2000
 
#define DP8_PHYID2_OUI   0x5c90
 

Functions

static Status lpc_mii_write (uint8_t reg, uint16_t data)
 
static Status lpc_mii_read (uint8_t reg, uint16_t *data)
 
static void lpc_update_phy_sts (uint16_t linksts)
 
uint32_t lpc_phy_init (bool rmii, p_msDelay_func_t pDelayMsFunc)
 Initialize the PHY.
 
uint32_t lpcPHYStsPoll (void)
 Phy status update state machine.
 

Variables

static uint32_t physts
 
static uint32_t olddphysts
 
static int32_t phyustate
 
static p_msDelay_func_t pDelayMs