HPM SDK
HPMicro Software Development Kit
hpm_dp83867.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_DP83867_H
16 #define HPM_DP83867_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 DP83867_ADDR
33 #define DP83867_ADDR (0U)
34 #endif
35 
39 #define DP83867_ID1 (0x2000U)
43 #define DP83867_ID2 (0x28U)
44 
45 /*---------------------------------------------------------------------
46  * Typedef Struct Declarations
47  *---------------------------------------------------------------------
48  */
52 typedef struct {
53  bool loopback;
54  uint8_t speed;
56  uint8_t duplex;
58 
63 typedef enum {
81 
82 #if defined(__cplusplus)
83 extern "C" {
84 #endif /* __cplusplus */
85 /*---------------------------------------------------------------------
86  * Exported Functions
87  *---------------------------------------------------------------------
88  */
96 bool dp83867_reset(ENET_Type *ptr, uint32_t phy_addr);
97 
109 
122 bool dp83867_basic_mode_init(ENET_Type *ptr, uint32_t phy_addr, dp83867_config_t *config);
123 
134 void dp83867_get_phy_status(ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status);
135 
144 void dp83867_set_mdi_crossover_mode(ENET_Type *ptr, uint32_t phy_addr, enet_phy_crossover_mode_t mode);
145 
146 #if defined(__cplusplus)
147 }
148 #endif /* __cplusplus */
149 #endif /* HPM_DP83867_H */
bool dp83867_reset(ENET_Type *ptr, uint32_t phy_addr)
Reset DP83867 PHY chip.
Definition: hpm_dp83867.c:67
void dp83867_basic_mode_default_config(ENET_Type *ptr, dp83867_config_t *config)
Set default configuration for DP83867 PHY basic mode.
Definition: hpm_dp83867.c:83
dp83867_rgmii_rx_delay_t
DP83867 RGMII RX delay configuration.
Definition: hpm_dp83867.h:63
@ DP83867_RX_DELAY_2P50_NS
Definition: hpm_dp83867.h:73
@ DP83867_RX_DELAY_2P25_NS
Definition: hpm_dp83867.h:72
@ DP83867_RX_DELAY_3P50_NS
Definition: hpm_dp83867.h:77
@ DP83867_RX_DELAY_1P25_NS
Definition: hpm_dp83867.h:68
@ DP83867_RX_DELAY_1P50_NS
Definition: hpm_dp83867.h:69
@ DP83867_RX_DELAY_2P00_NS
Definition: hpm_dp83867.h:71
@ DP83867_RX_DELAY_3P00_NS
Definition: hpm_dp83867.h:75
@ DP83867_RX_DELAY_1P75_NS
Definition: hpm_dp83867.h:70
@ DP83867_RX_DELAY_0P25_NS
Definition: hpm_dp83867.h:64
@ DP83867_RX_DELAY_3P25_NS
Definition: hpm_dp83867.h:76
@ DP83867_RX_DELAY_0P75_NS
Definition: hpm_dp83867.h:66
@ DP83867_RX_DELAY_4P00_NS
Definition: hpm_dp83867.h:79
@ DP83867_RX_DELAY_1P00_NS
Definition: hpm_dp83867.h:67
@ DP83867_RX_DELAY_2P75_NS
Definition: hpm_dp83867.h:74
@ DP83867_RX_DELAY_3P75_NS
Definition: hpm_dp83867.h:78
@ DP83867_RX_DELAY_0P50_NS
Definition: hpm_dp83867.h:65
void dp83867_get_phy_status(ENET_Type *ptr, uint32_t phy_addr, enet_phy_status_t *status)
Get DP83867 PHY status.
Definition: hpm_dp83867.c:125
void dp83867_set_mdi_crossover_mode(ENET_Type *ptr, uint32_t phy_addr, enet_phy_crossover_mode_t mode)
Set MDI crossover mode for DP83867 PHY.
Definition: hpm_dp83867.c:135
bool dp83867_basic_mode_init(ENET_Type *ptr, uint32_t phy_addr, dp83867_config_t *config)
Initialize DP83867 PHY chip in basic mode.
Definition: hpm_dp83867.c:97
enet_phy_crossover_mode_t
Definition: hpm_enet_phy.h:32
Definition: hpm_enet_regs.h:12
DP83867 PHY configuration structure.
Definition: hpm_dp83867.h:52
bool loopback
Definition: hpm_dp83867.h:53
uint8_t speed
Definition: hpm_dp83867.h:54
uint8_t duplex
Definition: hpm_dp83867.h:56
bool auto_negotiation
Definition: hpm_dp83867.h:55
Definition: hpm_enet_phy.h:43