AM263Px MCU+ SDK: dp83tg720.h Source File

| AM263Px MCU+ SDK 26.00.00 |

dp83tg720.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) Texas Instruments Incorporated 2020
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
49 #ifndef DP83TG720_H_
50 #define DP83TG720_H_
51
52 /* ========================================================================== */
53 /* Include Files */
54 /* ========================================================================== */
55
56 #include <stdint.h>
57
58 #include "phy_common.h"
59 #include "port.h"
60
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 /* ========================================================================== */
66 /* Macros */
67 /* ========================================================================== */
68
69 /* None */
70
71 /* ========================================================================== */
72 /* Structures and Enums */
73 /* ========================================================================== */
74
78 typedef enum Dp83tg720_MasterSlaveMode_e
79 {
81 DP83TG720_MASTER_SLAVE_STRAP = 0x0U,
82
84 DP83TG720_MASTER_MODE = 0x1U,
85
87 DP83TG720_SLAVE_MODE = 0x2U,
88 } Dp83tg720_MasterSlaveMode;
89
93 typedef struct Dp83tg720_Cfg_s
94 {
96 bool txClkShiftEn;
97
99 bool rxClkShiftEn;
100
102 bool interruptEn;
103
105 bool sgmiiAutoNegEn;
106
108 Dp83tg720_MasterSlaveMode MasterSlaveMode;
109 } Dp83tg720_Cfg;
110
111 /* ========================================================================== */
112 /* Global Variables Declarations */
113 /* ========================================================================== */
114
115 /* None */
116
117 /* ========================================================================== */
118 /* Function Declarations */
119 /* ========================================================================== */
120
128 void Dp83tg720_initCfg(Dp83tg720_Cfg *cfg);
129
130 void Dp83tg720_bind(EthPhyDrv_Handle* hPhy,
131 uint8_t phyAddr,
132 Phy_RegAccessCb_t* pRegAccessCb);
133
134 bool Dp83tg720_isPhyDevSupported(EthPhyDrv_Handle hPhy,
135 const void *pversion);
136
137 bool Dp83tg720_isMacModeSupported(EthPhyDrv_Handle hPhy,
138 Phy_Mii mii);
139
140 int32_t Dp83tg720_config(EthPhyDrv_Handle hPhy,
141 const void *pExtCfg,
142 const uint32_t extCfgSize,
143 Phy_Mii mii,
144 bool loopbackEn);
145
146 void Dp83tg720_reset(EthPhyDrv_Handle hPhy);
147
148 bool Dp83tg720_isResetComplete(EthPhyDrv_Handle hPhy);
149
150 void Dp83tg720_printRegs(EthPhyDrv_Handle hPhy);
151 /* ========================================================================== */
152 /* Deprecated Function Declarations */
153 /* ========================================================================== */
154
155 /* None */
156
157 /* ========================================================================== */
158 /* Static Function Definitions */
159 /* ========================================================================== */
160
161 /* None */
162
163 #ifdef __cplusplus
164 }
165 #endif
166
167 #endif /* DP83TG720_H_ */
168
Dp83tg720_Cfg::interruptEn
bool interruptEn
Definition: dp83tg720.h:102
Dp83tg720_config
int32_t Dp83tg720_config(EthPhyDrv_Handle hPhy, const void *pExtCfg, const uint32_t extCfgSize, Phy_Mii mii, bool loopbackEn)
Dp83tg720_Cfg::sgmiiAutoNegEn
bool sgmiiAutoNegEn
Definition: dp83tg720.h:105
Dp83tg720_Cfg::rxClkShiftEn
bool rxClkShiftEn
Definition: dp83tg720.h:99
Dp83tg720_bind
void Dp83tg720_bind(EthPhyDrv_Handle *hPhy, uint8_t phyAddr, Phy_RegAccessCb_t *pRegAccessCb)
Phy_RegAccessCb_t
Definition: phy_common.h:283
Dp83tg720_Cfg::MasterSlaveMode
Dp83tg720_MasterSlaveMode MasterSlaveMode
Definition: dp83tg720.h:108
EthPhyDrv_Handle
uint8_t EthPhyDrv_Handle[ETHPHYDRV_MAX_OBJ_SIZE]
Definition: phy_common.h:302
Dp83tg720_isResetComplete
bool Dp83tg720_isResetComplete(EthPhyDrv_Handle hPhy)
Phy_Mii
Phy_Mii
Definition: phy_common.h:220
Dp83tg720_isMacModeSupported
bool Dp83tg720_isMacModeSupported(EthPhyDrv_Handle hPhy, Phy_Mii mii)
Dp83tg720_reset
void Dp83tg720_reset(EthPhyDrv_Handle hPhy)
Dp83tg720_printRegs
void Dp83tg720_printRegs(EthPhyDrv_Handle hPhy)
Dp83tg720_isPhyDevSupported
bool Dp83tg720_isPhyDevSupported(EthPhyDrv_Handle hPhy, const void *pversion)
Dp83tg720_Cfg
DP83TG720 PHY configuration parameters.
Definition: dp83tg720.h:94
phy_common.h
DP83TG720_MASTER_MODE
@ DP83TG720_MASTER_MODE
Definition: dp83tg720.h:84
Dp83tg720_Cfg::txClkShiftEn
bool txClkShiftEn
Definition: dp83tg720.h:96
Dp83tg720_MasterSlaveMode
Dp83tg720_MasterSlaveMode
DP83TG720 Master/Slave modes.
Definition: dp83tg720.h:79
DP83TG720_SLAVE_MODE
@ DP83TG720_SLAVE_MODE
Definition: dp83tg720.h:87
DP83TG720_MASTER_SLAVE_STRAP
@ DP83TG720_MASTER_SLAVE_STRAP
Definition: dp83tg720.h:81
Dp83tg720_initCfg
void Dp83tg720_initCfg(Dp83tg720_Cfg *cfg)
Initialize DP83TG720 PHY specific config params.