AM64x MCU+ SDK  08.02.00
networking/enet/core/include/mod/mdio.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 
63 #ifndef MDIO_H_
64 #define MDIO_H_
65 
66 /* ========================================================================== */
67 /* Include Files */
68 /* ========================================================================== */
69 
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 {
94 
97 
100 } Mdio_OpMode;
101 
107 typedef struct Mdio_Cfg_s
108 {
111 
113  uint32_t mdioBusFreqHz;
114 
117 
122  uint32_t pollEnMask;
123 
126  uint32_t c45EnMask;
127 
134  bool isMaster;
135 } Mdio_Cfg;
136 
137 /* ========================================================================== */
138 /* Global Variables Declarations */
139 /* ========================================================================== */
140 
141 /* None */
142 
143 /* ========================================================================== */
144 /* Function Declarations */
145 /* ========================================================================== */
146 
152 void Mdio_initCfg(Mdio_Cfg *mdioCfg);
153 
154 /* ========================================================================== */
155 /* Deprecated Function Declarations */
156 /* ========================================================================== */
157 
158 /* None */
159 
160 /* ========================================================================== */
161 /* Static Function Definitions */
162 /* ========================================================================== */
163 
164 /* None */
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* MDIO_H_ */
171 
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::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