HPM SDK
HPMicro Software Development Kit
hpm_dp83848.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_DP83848_H
16 #define HPM_DP83848_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  * Macro Const Definitions
27  *---------------------------------------------------------------------
28  */
29 #ifndef DP83848_ADDR
33 #define DP83848_ADDR (1U)
34 #endif
35 
39 #define DP83848_ID1 (0x2000U)
43 #define DP83848_ID2 (0x17U)
44 
45 /*---------------------------------------------------------------------
46  * Typedef Enum Declarations
47  *---------------------------------------------------------------------
48  */
52 typedef enum {
55 
56 /*---------------------------------------------------------------------
57  * Typedef Struct Declarations
58  *---------------------------------------------------------------------
59  */
63 typedef struct {
64  bool loopback;
65  uint8_t speed;
67  uint8_t duplex;
69 
70 #if defined(__cplusplus)
71 extern "C" {
72 #endif /* __cplusplus */
73 /*---------------------------------------------------------------------
74  * Exported Functions
75  *---------------------------------------------------------------------
76  */
84 bool dp83848_reset(ENET_Type *ptr, uint32_t phy_addr);
85 
97 
110 bool dp83848_basic_mode_init(ENET_Type *ptr, uint32_t phy_addr, dp83848_config_t *config);
111 
122 void dp83848_get_phy_status(ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status);
123 
124 #if defined(__cplusplus)
125 }
126 #endif /* __cplusplus */
127 #endif /* HPM_DP83848_H */
void dp83848_get_phy_status(ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status)
Get DP83848 PHY status.
Definition: hpm_dp83848.c:95
bool dp83848_basic_mode_init(ENET_Type *ptr, uint32_t phy_addr, dp83848_config_t *config)
Initialize DP83848 PHY chip in basic mode.
Definition: hpm_dp83848.c:68
dp83848_config_refclk_direction_t
DP83848 reference clock direction configuration.
Definition: hpm_dp83848.h:52
@ dp83848_config_refclk_input
Definition: hpm_dp83848.h:53
void dp83848_basic_mode_default_config(ENET_Type *ptr, dp83848_config_t *config)
Set default configuration for DP83848 PHY basic mode.
Definition: hpm_dp83848.c:54
bool dp83848_reset(ENET_Type *ptr, uint32_t phy_addr)
Reset DP83848 PHY chip.
Definition: hpm_dp83848.c:38
Definition: hpm_enet_regs.h:12
DP83848 PHY configuration structure.
Definition: hpm_dp83848.h:63
bool auto_negotiation
Definition: hpm_dp83848.h:66
bool loopback
Definition: hpm_dp83848.h:64
uint8_t speed
Definition: hpm_dp83848.h:65
uint8_t duplex
Definition: hpm_dp83848.h:67
Definition: hpm_enet_phy.h:43