|
我在设计一三网合一系统,CPU用STM32F10VCt6,用RMII方式,PHY用IP175C,如附件为IP175C的资料,设置PHY地址如下:
#define PHY_BCR 0 /*!< Tranceiver Basic Control Register */
#define PHY_BSR 1 /*!< Tranceiver Basic Status Register */
/**
* @}
*/
/** @defgroup PHY_basic_Control_register
* @{
*/
#define PHY_Reset ((u16)0x8000) /*!< PHY Reset */
#define PHY_Loopback ((u16)0x4000) /*!< Select loop-back mode */
#define PHY_FULLDUPLEX_100M ((u16)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
#define PHY_HALFDUPLEX_100M ((u16)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
#define PHY_FULLDUPLEX_10M ((u16)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
#define PHY_HALFDUPLEX_10M ((u16)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
#define PHY_AutoNegotiation ((u16)0x1000) /*!< Enable auto-negotiation function */
#define PHY_Restart_AutoNegotiation ((u16)0x0200) /*!< Restart auto-negotiation function */
#define PHY_Powerdown ((u16)0x0800) /*!< Select the power down mode */
//#define PHY_Isolate ((u16)0x0400) /*!< Isolate PHY from MII,lcs deleated */
/**
* @}
*/
/** @defgroup PHY_basic_status_register
* @{
*/
#define PHY_AutoNego_Complete ((u16)0x0020) /*!< Auto-Negotioation process completed */
#define PHY_Linked_Status ((u16)0x0004) /*!< Valid link established */
#define PHY_Jabber_detection ((u16)0x0002) /*!< Jabber condition detected */
/**
* @}
*/
/** @defgroup PHY_status_register
* @{
*/
/* The PHY status register value change from a PHY to another so the user have
to update this value depending on the used external PHY */
/**
* @brief For LAN8700
*/
//#define PHY_SR 31 /*!< Tranceiver Status Register */
/**
* @brief For DP83848
*/
//#define PHY_SR 16 /*!< Tranceiver Status Register */
// @brief For IP175C
#define PHY_SR 18
/* The Speed and Duplex mask values change from a PHY to another so the user have to update
this value depending on the used external PHY */
/**
* @brief For LAN8700
*/
//#define PHY_Speed_Status ((u16)0x0004) /*!< Configured information of Speed: 10Mbps */
//#define PHY_Duplex_Status ((u16)0x0010) /*!< Configured information of Duplex: Full-duplex */
/**
* @brief For DP83848
*/
//#define PHY_Speed_Status ((u16)0x0002) /*!< Configured information of Speed: 10Mbps */
//#define PHY_Duplex_Status ((u16)0x0004) /*!< Configured information of Duplex: Full-duplex */
// @brief For IP175C
#define PHY_Speed_Status ((u16)0x0800) /*!< Configured information of Speed: 10Mbps lcs modified from ((u16)0x0800) to */
#define PHY_Duplex_Status ((u16)0x0400) /*!< Configured information of Duplex: Full-duplex */
#define IS_ETH_PHY_ADDRESS(ADDRESS) ((ADDRESS) <= 0x20)
#define IS_ETH_PHY_REG(REG) (((REG) == PHY_BCR) || \
((REG) == PHY_BSR) || \
((REG) == PHY_SR))
PHY的以太网口灯闪啦,但ping不通,请哪位帮忙看看地址设得对不对?
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
一只鸟敢站在脆弱的枝条上歇脚,它依仗的不是枝条不会断,而是自己有翅膀,会飞。
|