HPM SDK
HPMicro Software Development Kit
hpm_rtl8211.h
Go to the documentation of this file.
1 
8 /*
9  * Copyright (c) 2024-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_tsw_phy.h"
23 #include "hpm_common.h"
24 #include "hpm_tsw_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;
56  bool auto_negotiation;
57  uint8_t duplex;
59 
60 #if defined(__cplusplus)
61 extern "C" {
62 #endif /* __cplusplus */
63 /*---------------------------------------------------------------------
64  * Exported Functions
65  *---------------------------------------------------------------------
66  */
72 void rtl8211_reset(TSW_Type *ptr, uint8_t port);
73 
85 
98 bool rtl8211_basic_mode_init(TSW_Type *ptr, uint8_t port, rtl8211_config_t *config);
99 
110 void rtl8211_get_phy_status(TSW_Type *ptr, uint8_t port, tsw_phy_status_t *status);
111 
112 #if defined(__cplusplus)
113 }
114 #endif /* __cplusplus */
115 #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_tsw_regs.h:12
RTL8211 PHY configuration structure.
Definition: hpm_rtl8211.h:53
Definition: hpm_tsw_phy.h:34