AM261x MCU+ SDK: mdio.h Source File

| AM261x MCU+ SDK 26.00.00 |

networking/enet/core/include/mod/mdio.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) Texas Instruments Incorporated 2022
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
63 #ifndef MDIO_ENET_H_
64 #define MDIO_ENET_H_
65
66 /* ========================================================================== */
67 /* Include Files */
68 /* ========================================================================== */
69
70 #include <include/core/enet_mod_mdio.h>
71
72 #ifdef __cplusplus
73 extern "C" {
74 #endif
75
76 /* ========================================================================== */
77 /* Macros */
78 /* ========================================================================== */
79
81 #define MDIO_MAX_PHY_CNT (31U)
82
83 /* ========================================================================== */
84 /* Structures and Enums */
85 /* ========================================================================== */
86
90 typedef enum Mdio_OpMode_e
91 {
93 MDIO_MODE_NORMAL = 0U,
94
96 MDIO_MODE_STATE_CHANGE_MON,
97
99 MDIO_MODE_MANUAL,
100 } Mdio_OpMode;
101
107 typedef struct Mdio_Cfg_s
108 {
110 Mdio_OpMode mode;
111
113 uint32_t mdioBusFreqHz;
114
116 uint32_t phyStatePollFreqHz;
117
122 uint32_t pollEnMask;
123
126 uint32_t c45EnMask;
127
134 bool isMaster;
135
146 bool disableStateMachineOnInit;
147
148 } Mdio_Cfg;
149
150 /* ========================================================================== */
151 /* Global Variables Declarations */
152 /* ========================================================================== */
153
154 /* None */
155
156 /* ========================================================================== */
157 /* Function Declarations */
158 /* ========================================================================== */
159
165 void Mdio_initCfg(Mdio_Cfg *mdioCfg);
166
167 /* ========================================================================== */
168 /* Deprecated Function Declarations */
169 /* ========================================================================== */
170
171 /* None */
172
173 /* ========================================================================== */
174 /* Static Function Definitions */
175 /* ========================================================================== */
176
177 /* None */
178
179 #ifdef __cplusplus
180 }
181 #endif
182
183 #endif /* MDIO_ENET_H_ */
184
Mdio_Cfg::c45EnMask
uint32_t c45EnMask
Definition: networking/enet/core/include/mod/mdio.h:126
Mdio_Cfg::mode
Mdio_OpMode mode
Definition: networking/enet/core/include/mod/mdio.h:110
enet_mod_mdio.h
This file contains the type definitions and helper macros for the Enet MDIO module.
Mdio_OpMode
Mdio_OpMode
MDIO operating mode.
Definition: networking/enet/core/include/mod/mdio.h:91
Mdio_Cfg::phyStatePollFreqHz
uint32_t phyStatePollFreqHz
Definition: networking/enet/core/include/mod/mdio.h:116
Mdio_initCfg
void Mdio_initCfg(Mdio_Cfg *mdioCfg)
Initialize MDIO configuration parameters.
MDIO_MODE_MANUAL
@ MDIO_MODE_MANUAL
Definition: networking/enet/core/include/mod/mdio.h:99
MDIO_MODE_NORMAL
@ MDIO_MODE_NORMAL
Definition: networking/enet/core/include/mod/mdio.h:93
Mdio_Cfg
MDIO module configuration.
Definition: networking/enet/core/include/mod/mdio.h:108
Mdio_Cfg::disableStateMachineOnInit
bool disableStateMachineOnInit
Definition: networking/enet/core/include/mod/mdio.h:146
Mdio_Cfg::mdioBusFreqHz
uint32_t mdioBusFreqHz
Definition: networking/enet/core/include/mod/mdio.h:113
Mdio_Cfg::isMaster
bool isMaster
Definition: networking/enet/core/include/mod/mdio.h:134
Mdio_Cfg::pollEnMask
uint32_t pollEnMask
Definition: networking/enet/core/include/mod/mdio.h:122
MDIO_MODE_STATE_CHANGE_MON
@ MDIO_MODE_STATE_CHANGE_MON
Definition: networking/enet/core/include/mod/mdio.h:96