Data Structures | Macros | Typedefs | Functions
enet_mod.h File Reference

This file contains the type definitions and helper macros for the Enet Module interface. More...

#include <stdint.h>
#include <ti/drv/enet/include/core/enet_types.h>
#include <ti/drv/enet/include/core/enet_ioctl.h>

Data Structures

struct  EnetMod_Obj_s
 Ethernet Module object. More...
 

Macros

#define ENET_MOD_CFG_MAGIC   (0xBBBBBBBBU)
 Enet Module configuration magic vlaue.
 
#define ENET_MOD(mod)   ((EnetMod_Handle)mod)
 Convert module specific handle to EnetMod generic handle.
 

Typedefs

typedef struct EnetMod_Obj_sEnetMod_Handle
 Ethernet Module handle. More...
 
typedef void(* EnetMod_InitCfg )(EnetMod_Handle hMod, Enet_Type enetType, void *cfg)
 Initialize module's configuration parameters. More...
 
typedef int32_t(* EnetMod_Open )(EnetMod_Handle hMod, Enet_Type enetType, const void *cfg)
 Open and initialize the Enet Module. More...
 
typedef int32_t(* EnetMod_Rejoin )(EnetMod_Handle hMod, Enet_Type enetType)
 Rejoin the Enet Module. More...
 
typedef int32_t(* EnetMod_Ioctl )(EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Issue an operation on the Enet Module. More...
 
typedef void(* EnetMod_Close )(EnetMod_Handle hMod)
 Close the Enet Module. More...
 
typedef struct EnetMod_Obj_s EnetMod_Obj
 Ethernet Module object.
 

Functions

static void EnetMod_initCfg (EnetMod_Handle hMod, Enet_Type enetType, void *cfg)
 Wrapper to initialize module's configuration parameters. More...
 
static int32_t EnetMod_open (EnetMod_Handle hMod, Enet_Type enetType, const void *cfg)
 Wrapper to open and initialize an Enet Module. More...
 
static int32_t EnetMod_rejoin (EnetMod_Handle hMod, Enet_Type enetType)
 Wrapper to rejoin an Enet Module. More...
 
static int32_t EnetMod_ioctl (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Wrapper function to issue an operation on an Enet Module. More...
 
static void EnetMod_close (EnetMod_Handle hMod)
 Wrapper function to close an Enet Module. More...
 

Detailed Description

This file contains the type definitions and helper macros for the Enet Module interface.

Typedef Documentation

typedef void(* EnetMod_Close)(EnetMod_Handle hMod)

Close the Enet Module.

Closes the Enet Module.

Parameters
hEnetEnet Module opaque handle
typedef struct EnetMod_Obj_s* EnetMod_Handle

Ethernet Module handle.

Ethernet Module handle used to call any EnetMod related APIs.

typedef void(* EnetMod_InitCfg)(EnetMod_Handle hMod, Enet_Type enetType, void *cfg)

Initialize module's configuration parameters.

Initializes the configuration parameter of the Enet module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
cfgConfiguration parameters to be initialized
typedef int32_t(* EnetMod_Ioctl)(EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)

Issue an operation on the Enet Module.

Issues a control operation on the Enet Module.

Parameters
hEnetEnet Module opaque handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes
typedef int32_t(* EnetMod_Open)(EnetMod_Handle hMod, Enet_Type enetType, const void *cfg)

Open and initialize the Enet Module.

Opens and initializes the Enet Module with the configuration parameters provided by the caller.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
cfgConfiguration parameters
Returns
Enet_ErrorCodes
typedef int32_t(* EnetMod_Rejoin)(EnetMod_Handle hMod, Enet_Type enetType)

Rejoin the Enet Module.

Reopens the Enet Module, but doesn't perform any hardware initialization. This function is expected to be called to attach to a running module.

Parameters
hModEnet Module opaque handle
enetTypeEnet Peripheral type
Returns
Enet_ErrorCodes

Function Documentation

static void EnetMod_close ( EnetMod_Handle  hMod)
inlinestatic

Wrapper function to close an Enet Module.

Parameters
hModEnet Module handle
static void EnetMod_initCfg ( EnetMod_Handle  hMod,
Enet_Type  enetType,
void *  cfg 
)
inlinestatic

Wrapper to initialize module's configuration parameters.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
cfgConfiguration parameters to be initialized
static int32_t EnetMod_ioctl ( EnetMod_Handle  hMod,
uint32_t  cmd,
Enet_IoctlPrms prms 
)
inlinestatic

Wrapper function to issue an operation on an Enet Module.

Parameters
hModEnet Module handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes
static int32_t EnetMod_open ( EnetMod_Handle  hMod,
Enet_Type  enetType,
const void *  cfg 
)
inlinestatic

Wrapper to open and initialize an Enet Module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
cfgConfiguration parameters
Returns
Enet_ErrorCodes
static int32_t EnetMod_rejoin ( EnetMod_Handle  hMod,
Enet_Type  enetType 
)
inlinestatic

Wrapper to rejoin an Enet Module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
Returns
Enet_ErrorCodes

Copyright 2020, Texas Instruments Incorporated