AM64x MCU+ SDK  08.02.00
enet.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 
62 #ifndef ENET_H_
63 #define ENET_H_
64 
65 /* ========================================================================== */
66 /* Include Files */
67 /* ========================================================================== */
68 
69 #include <stdint.h>
70 #include <stdbool.h>
71 #include <enet_cfg.h>
73 #include <include/core/enet_base.h>
74 #include <include/core/enet_osal.h>
79 #include <include/core/enet_soc.h>
85 #include <include/core/enet_dma.h>
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 
91 /* ========================================================================== */
92 /* Macros */
93 /* ========================================================================== */
94 
95 /* None */
96 
97 /* ========================================================================== */
98 /* Structures and Enums */
99 /* ========================================================================== */
100 
101 /* ========================================================================== */
102 /* Global Variables Declarations */
103 /* ========================================================================== */
104 
105 /* None */
106 
107 /* ========================================================================== */
108 /* Function Declarations */
109 /* ========================================================================== */
110 
119 uint32_t Enet_getCoreId(void);
120 
135 
144 
158 
173 
193 void Enet_init(const EnetOsal_Cfg *osalCfg,
194  const EnetUtils_Cfg *utilsCfg);
195 
205 void Enet_deinit(void);
206 
220  uint32_t instId);
221 
233 uint32_t Enet_getMacPortMax(Enet_Type enetType,
234  uint32_t instId);
235 
251 void Enet_initCfg(Enet_Type enetType,
252  uint32_t instId,
253  void *cfg,
254  uint32_t cfgSize);
255 
276  uint32_t instId,
277  const void *cfg,
278  uint32_t cfgSize);
279 
293  uint32_t instId);
294 
309 
329 int32_t Enet_ioctl(Enet_Handle hEnet,
330  uint32_t coreId,
331  uint32_t cmd,
332  Enet_IoctlPrms *prms);
333 
348  Enet_Event evt,
349  uint32_t evtNum,
350  Enet_EventCallback evtCb,
351  void *evtCbArgs);
352 
363  Enet_Event evt,
364  uint32_t evtNum);
365 
383  Enet_Event evt,
384  const void *arg,
385  uint32_t argSize);
386 
395 
408 
417 
418 /* ========================================================================== */
419 /* Deprecated Function Declarations */
420 /* ========================================================================== */
421 
422 /* None */
423 
424 #ifdef __cplusplus
425 }
426 #endif
427 
428 #endif /* ENET_H_ */
429 
Enet_setTraceLevel
EnetTrace_TraceLevel Enet_setTraceLevel(EnetTrace_TraceLevel level)
Set global trace level.
Enet_getCoreId
uint32_t Enet_getCoreId(void)
enet_dma.h
This file contains the type definitions and helper macros for the Enet Data Path (DMA) interface.
enet_soc.h
This file contains the type definitions and helper macros for the Enet SoC interface.
enet_trace.h
This file contains the type definitions and helper macros for the Enet Trace interface.
Enet_open
Enet_Handle Enet_open(Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
Open and initializes the Enet driver for a peripheral.
Enet_getMacPortMax
uint32_t Enet_getMacPortMax(Enet_Type enetType, uint32_t instId)
Get number of MAC ports available in the Ethernet peripheral.
EnetTrace_TraceLevel
EnetTrace_TraceLevel
Enumerates the types of trace level.
Definition: enet_trace.h:109
enet_mod_port.h
This file contains the type definitions and helper macros that are common for host and MAC ports.
enet_osal.h
This file contains the OSAL API of the Enet driver.
enet_types.h
This file contains the basic types using across the Enet driver.
Enet_poll
void Enet_poll(Enet_Handle hEnet, Enet_Event evt, const void *arg, uint32_t argSize)
Poll for Ethernet events.
Enet_Event
Enet_Event
Ethernet events.
Definition: enet_types.h:262
Enet_getHandle
Enet_Handle Enet_getHandle(Enet_Type enetType, uint32_t instId)
Get the Enet handle of a peripheral.
enet_ioctl.h
This file contains the type definitions and helper macros for the Enet IOCTL interface.
Enet_registerEventCb
void Enet_registerEventCb(Enet_Handle hEnet, Enet_Event evt, uint32_t evtNum, Enet_EventCallback evtCb, void *evtCbArgs)
Register a callback for an event.
enet_mod_phy.h
This file contains the type definitions and helper macros for the Ethernet PHY interface.
enet_queue.h
This file contains the type definitions and helper macros for the Enet software queue.
Enet_getTraceLevel
EnetTrace_TraceLevel Enet_getTraceLevel(void)
Get current trace level.
Enet_unregisterEventCb
void Enet_unregisterEventCb(Enet_Handle hEnet, Enet_Event evt, uint32_t evtNum)
Unregister callback for an event.
Enet_close
void Enet_close(Enet_Handle hEnet)
Close the Enet peripheral.
Enet_initUtilsCfg
void Enet_initUtilsCfg(EnetUtils_Cfg *utilsCfg)
Initialize utils configuration.
Enet_IoctlPrms
Enet IOCTL param.
Definition: enet_ioctl.h:233
EnetUtils_Cfg
Enet utils parameters.
Definition: enet_utils.h:197
Enet_periodicTick
void Enet_periodicTick(Enet_Handle hEnet)
Run periodic tick on the Ethernet peripheral.
enet_mod_fdb.h
This file contains the type definitions and helper macros for the Enet Forwarding Database (FDB) modu...
EnetOsal_Cfg
Enet OSAL configuration paramters.
Definition: enet_osal.h:223
Enet_getDmaHandle
EnetDma_Handle Enet_getDmaHandle(Enet_Handle hEnet)
Get the handle to the DMA used for packet transmit/receive.
enet_mod_tas.h
This file contains the type definitions and helper macros for the Enet Time Aware Shaper (TAS) module...
Enet_initCfg
void Enet_initCfg(Enet_Type enetType, uint32_t instId, void *cfg, uint32_t cfgSize)
Initialize the peripheral configuration parameters.
Enet_init
void Enet_init(const EnetOsal_Cfg *osalCfg, const EnetUtils_Cfg *utilsCfg)
Initialize Enet LLD.
Enet_Type
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:196
enet_mod_timesync.h
This file contains the type definitions and helper macros for the Enet Time Synchronization module in...
Enet_deinit
void Enet_deinit(void)
De-initialize Enet LLD.
enet_base.h
This file contains the type definitions and helper macros for the Enet Peripheral interface.
Enet_EventCallback
void(* Enet_EventCallback)(Enet_Event evt, uint32_t evtNum, void *evtCbArgs, void *arg1, void *arg2)
Event callback.
Definition: enet_types.h:448
Enet_initOsalCfg
void Enet_initOsalCfg(EnetOsal_Cfg *osalCfg)
Initialize OSAL configuration.
Enet_ioctl
int32_t Enet_ioctl(Enet_Handle hEnet, uint32_t coreId, uint32_t cmd, Enet_IoctlPrms *prms)
Issue an operation on the Enet Peripheral.
Enet_getMacPortCnt
uint32_t Enet_getMacPortCnt(Enet_Handle hEnet)
Get number of MAC ports available in the Ethernet peripheral.
enet_cfg.h
This file contains the Enet configuration parameters.
Enet_rejoin
Enet_Handle Enet_rejoin(Enet_Type enetType, uint32_t instId)
Rejoin a running Ethernet peripheral.
Enet_Handle
struct Enet_Obj_s * Enet_Handle
Ethernet driver handle.
Definition: enet_base.h:105
EnetDma_Handle
struct EnetUdma_DrvObj_s * EnetDma_Handle
Opaque handle for Enet UDMA driver object.
Definition: enet_udma_types.h:86
enet_utils.h
This file contains the type definitions and function prototypes of the Enet Utils functionality.