HPM SDK
HPMicro Software Development Kit
hpm_rtl8211.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef HPM_RTL8211_H
9 #define HPM_RTL8211_H
10 
11 /*---------------------------------------------------------------------
12  * Includes
13  *---------------------------------------------------------------------
14  */
15 #include "hpm_tsw_phy.h"
16 #include "hpm_common.h"
17 #include "hpm_tsw_regs.h"
18 /*---------------------------------------------------------------------
19  *
20  * Macro Const Definitions
21  *---------------------------------------------------------------------
22  */
23 #ifndef RTL8211_ADDR
24 #define RTL8211_ADDR (2U)
25 #endif
26 
27 #define RTL8211_ID1 (0x001CU)
28 #define RTL8211_ID2 (0x32U)
29 
30 /*---------------------------------------------------------------------
31  * Typedef Struct Declarations
32  *---------------------------------------------------------------------
33  */
34 typedef struct {
35  bool loopback;
36  uint8_t speed;
37  bool auto_negotiation;
38  uint8_t duplex;
40 
41 #if defined(__cplusplus)
42 extern "C" {
43 #endif /* __cplusplus */
44 /*---------------------------------------------------------------------
45  * Exported Functions
46  *---------------------------------------------------------------------
47  */
48 void rtl8211_reset(TSW_Type *ptr, uint8_t port);
50 bool rtl8211_basic_mode_init(TSW_Type *ptr, uint8_t port, rtl8211_config_t *config);
51 void rtl8211_get_phy_status(TSW_Type *ptr, uint8_t port, tsw_phy_status_t *status);
52 
53 #if defined(__cplusplus)
54 }
55 #endif /* __cplusplus */
56 #endif /* HPM_RTL8211_H */
bool rtl8211_basic_mode_init(ENET_Type *ptr, rtl8211_config_t *config)
Definition: hpm_rtl8211.c:65
void rtl8211_reset(ENET_Type *ptr)
Definition: hpm_rtl8211.c:38
void rtl8211_get_phy_status(ENET_Type *ptr, enet_phy_status_t *status)
Definition: hpm_rtl8211.c:93
void rtl8211_basic_mode_default_config(ENET_Type *ptr, rtl8211_config_t *config)
Definition: hpm_rtl8211.c:51
Definition: hpm_tsw_regs.h:12
Definition: hpm_rtl8211.h:34
Definition: hpm_tsw_phy.h:34