Skip to content

Commit

Permalink
[bsp][stm32]eth driver support phy YT8512C
Browse files Browse the repository at this point in the history
  • Loading branch information
yangpengya authored Dec 26, 2023
1 parent ff1bd38 commit 76acc41
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions bsp/stm32/libraries/HAL_Drivers/drivers/drv_eth.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@
/* The PHY auto-negotiate advertise register */
#define PHY_AUTONEG_ADVERTISE_REG 0x04U

Check failure on line 34 in bsp/stm32/libraries/HAL_Drivers/drivers/drv_eth.h

View workflow job for this annotation

GitHub Actions / Check Spelling

`AUTONEG` is not a recognized word. (unrecognized-spelling)


#ifdef PHY_USING_LAN8720A
#if defined(PHY_USING_LAN8720A) || defined(PHY_USING_LAN8742A)
/* The PHY interrupt source flag register. */
#define PHY_INTERRUPT_FLAG_REG 0x1DU
/* The PHY interrupt mask register. */
#define PHY_INTERRUPT_MASK_REG 0x1EU
#define PHY_LINK_DOWN_MASK (1<<4)
#define PHY_AUTO_NEGO_COMPLETE_MASK (1<<6)

Check failure on line 42 in bsp/stm32/libraries/HAL_Drivers/drivers/drv_eth.h

View workflow job for this annotation

GitHub Actions / Check Spelling

`NEGO` is not a recognized word. (unrecognized-spelling)

/* The PHY status register. */
#define PHY_Status_REG 0x1FU
#define PHY_10M_MASK (1<<2)
Expand Down Expand Up @@ -83,24 +81,21 @@
/* The PHY interrupt mask register. */
#define PHY_INTERRUPT_MASK_REG 0x12U
#define PHY_INT_MASK (1<<5)
#endif

#ifdef PHY_USING_LAN8742A
#elif defined(PHY_USING_YT8512C)
/* The PHY interrupt source flag register. */
#define PHY_INTERRUPT_FLAG_REG 0x1DU
#define PHY_INTERRUPT_FLAG_REG 0x13U
/* The PHY interrupt mask register. */
#define PHY_INTERRUPT_MASK_REG 0x1EU
#define PHY_LINK_DOWN_MASK (1<<4)
#define PHY_AUTO_NEGO_COMPLETE_MASK (1<<6)

#define PHY_INTERRUPT_MASK_REG 0x12U
/* The PHY auto nego and link change mask. */

Check failure on line 90 in bsp/stm32/libraries/HAL_Drivers/drivers/drv_eth.h

View workflow job for this annotation

GitHub Actions / Check Spelling

`nego` is not a recognized word. (unrecognized-spelling)
#define PHY_INT_MASK (1<<15)|(3<<10)
/* The PHY status register. */
#define PHY_Status_REG 0x1FU
#define PHY_10M_MASK (1<<2)
#define PHY_100M_MASK (1<<3)
#define PHY_FULL_DUPLEX_MASK (1<<4)
#define PHY_Status_SPEED_10M(sr) ((sr) & PHY_10M_MASK)
#define PHY_Status_REG 0x11U
#define PHY_100M_MASK (1<<14)
#define PHY_FULL_DUPLEX_MASK (1<<13)
#define PHY_Status_SPEED_10M(sr) (!PHY_Status_SPEED_100M(sr))
#define PHY_Status_SPEED_100M(sr) ((sr) & PHY_100M_MASK)
#define PHY_Status_FULL_DUPLEX(sr) ((sr) & PHY_FULL_DUPLEX_MASK)
#endif /* PHY_USING_LAN8742A */
#endif /* defined(PHY_USING_LAN8720A) || defined(PHY_USING_LAN8742A) */

#endif /* __DRV_ETH_H__ */

0 comments on commit 76acc41

Please sign in to comment.