HPM SDK
HPMicro Software Development Kit
hpm_rtl8211.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright (c) 2021-2025 HPMicro
10  *
11  * SPDX-License-Identifier: BSD-3-Clause
12  *
13  */
14 
15 #ifndef HPM_RTL8211_H
16 #define HPM_RTL8211_H
17 
18 /*---------------------------------------------------------------------
19  * Includes
20  *---------------------------------------------------------------------
21  */
22 #include "hpm_enet_phy.h"
23 #include "hpm_common.h"
24 #include "hpm_enet_regs.h"
25 /*---------------------------------------------------------------------
26  *
27  * Macro Const Definitions
28  *---------------------------------------------------------------------
29  */
30 #ifndef RTL8211_ADDR
34 #define RTL8211_ADDR (2U)
35 #endif
36 
40 #define RTL8211_ID1 (0x001CU)
44 #define RTL8211_ID2 (0x32U)
45 
46 /*---------------------------------------------------------------------
47  * Typedef Struct Declarations
48  *---------------------------------------------------------------------
49  */
53 typedef struct {
54  bool loopback;
55  uint8_t speed;
57  uint8_t duplex;
59 
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif /* __cplusplus */
63 /*---------------------------------------------------------------------
64  * Exported Functions
65  *---------------------------------------------------------------------
66  */
74 bool rtl8211_reset(ENET_Type *ptr, uint32_t phy_addr);
75 
87 
100 bool rtl8211_basic_mode_init(ENET_Type *ptr, uint32_t phy_addr, rtl8211_config_t *config);
101 
112 void rtl8211_get_phy_status(ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status);
113 
114 #if defined(__cplusplus)
115 }
116 #endif /* __cplusplus */
117 #endif /* HPM_RTL8211_H */
void rtl8211_get_phy_status(ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status)
Get RTL8211 PHY status.
Definition: hpm_rtl8211.c:96
bool rtl8211_basic_mode_init(ENET_Type *ptr, uint32_t phy_addr, rtl8211_config_t *config)
Initialize RTL8211 PHY chip in basic mode.
Definition: hpm_rtl8211.c:68
bool rtl8211_reset(ENET_Type *ptr, uint32_t phy_addr)
Reset RTL8211 PHY chip.
Definition: hpm_rtl8211.c:38
void rtl8211_basic_mode_default_config(ENET_Type *ptr, rtl8211_config_t *config)
Set default configuration for RTL8211 PHY basic mode.
Definition: hpm_rtl8211.c:54
Definition: hpm_enet_regs.h:12
Definition: hpm_enet_phy.h:43
RTL8211 PHY configuration structure.
Definition: hpm_rtl8211.h:53
uint8_t duplex
Definition: hpm_rtl8211.h:57
uint8_t speed
Definition: hpm_rtl8211.h:55
bool loopback
Definition: hpm_rtl8211.h:54
bool auto_negotiation
Definition: hpm_rtl8211.h:56