• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2023 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_enet_phy.h"
16 #include "hpm_common.h"
17 #include "hpm_enet_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;
39 } rtl8211_config_t;
40 
41 #if defined(__cplusplus)
42 extern "C" {
43 #endif /* __cplusplus */
44 /*---------------------------------------------------------------------
45  * Exported Functions
46  *---------------------------------------------------------------------
47  */
48 void rtl8211_reset(ENET_Type *ptr);
49 void rtl8211_basic_mode_default_config(ENET_Type *ptr, rtl8211_config_t *config);
50 bool rtl8211_basic_mode_init(ENET_Type *ptr, rtl8211_config_t *config);
51 void rtl8211_get_phy_status(ENET_Type *ptr, enet_phy_status_t *status);
52 
53 #if defined(__cplusplus)
54 }
55 #endif /* __cplusplus */
56 #endif /* HPM_RTL8211_H */
57