/* * Copyright (c) 2021-2023 HPMicro * * SPDX-License-Identifier: BSD-3-Clause * */ #ifndef HPM_DP83848_H #define HPM_DP83848_H /*--------------------------------------------------------------------- * Includes *--------------------------------------------------------------------- */ #include "hpm_enet_phy.h" #include "hpm_common.h" #include "hpm_enet_regs.h" /*--------------------------------------------------------------------- * Macro Const Definitions *--------------------------------------------------------------------- */ #ifndef DP83848_ADDR #define DP83848_ADDR (1U) #endif #define DP83848_ID1 (0x2000U) #define DP83848_ID2 (0x17U) /*--------------------------------------------------------------------- * Typedef Struct Declarations *--------------------------------------------------------------------- */ typedef struct { bool loopback; uint8_t speed; bool auto_negotiation; uint8_t duplex; } dp83848_config_t; #if defined(__cplusplus) extern "C" { #endif /* __cplusplus */ /*--------------------------------------------------------------------- * Exported Functions *--------------------------------------------------------------------- */ void dp83848_reset(ENET_Type *ptr); void dp83848_basic_mode_default_config(ENET_Type *ptr, dp83848_config_t *config); bool dp83848_basic_mode_init(ENET_Type *ptr, dp83848_config_t *config); void dp83848_get_phy_status(ENET_Type *ptr, enet_phy_status_t *status); #if defined(__cplusplus) } #endif /* __cplusplus */ #endif /* HPM_DP83848_H */