AM243x MCU+ SDK  09.02.00
enet_mod.h File Reference

Introduction

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

Go to the source code of this file.

Data Structures

struct  EnetMod_Obj
 Ethernet Module object. More...
 

Macros

#define ENET_MOD(mod)   ((EnetMod_Handle)mod)
 Convert module specific handle to EnetMod generic handle. More...
 

Typedefs

typedef struct EnetMod_Obj_s * EnetMod_Handle
 Ethernet Module handle. More...
 
typedef int32_t(*const EnetMod_Open) (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Open and initialize the Enet Module. More...
 
typedef int32_t(*const EnetMod_Rejoin) (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
 Rejoin the Enet Module. More...
 
typedef int32_t(*const EnetMod_Ioctl) (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Issue an operation on the Enet Module. More...
 
typedef void(*const EnetMod_Close) (EnetMod_Handle hMod)
 Close the Enet Module. More...
 
typedef void(*const EnetMod_SaveCtxt) (EnetMod_Handle hMod)
 Saves and closes the Enet Module context before resetting. More...
 
typedef int32_t(*const EnetMod_RestoreCtxt) (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Restores and opens the Enet Module after reset. More...
 

Functions

int32_t EnetMod_open (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Wrapper to open and initialize an Enet Module. More...
 
int32_t EnetMod_rejoin (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
 Wrapper to rejoin an Enet Module. More...
 
int32_t EnetMod_ioctl (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Wrapper function to issue an operation on an Enet Module. More...
 
int32_t EnetMod_registerMacportIoctlHandler (EnetMod_Handle hMod, uint32_t cmdBase, uint32_t cmd, Enet_IoctlPrms *prms)
 Wrapper function to register IOCTL for Macport Module. This function is defined for the cases when ONLY second macport module is opened without opening the first Macport module. More...
 
int32_t EnetMod_ioctlFromIsr (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Wrapper function to issue an operation on an Enet Module from ISR context. More...
 
void EnetMod_close (EnetMod_Handle hMod)
 Wrapper function to close an Enet Module. More...
 
void EnetMod_saveCtxt (EnetMod_Handle hMod)
 Wrapper function to save and close Enet Module. More...
 
int32_t EnetMod_restoreCtxt (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Wrapper to retore and open Enet Module. More...
 
static bool EnetMod_isOpen (EnetMod_Handle hMod)
 Check if Enet Module is open or not. More...
 

Macro Definition Documentation

◆ ENET_MOD

#define ENET_MOD (   mod)    ((EnetMod_Handle)mod)

Convert module specific handle to EnetMod generic handle.

Typedef Documentation

◆ EnetMod_Handle

typedef struct EnetMod_Obj_s* EnetMod_Handle

Ethernet Module handle.

Ethernet Module handle used to call any EnetMod related APIs.

◆ EnetMod_Open

typedef int32_t(*const EnetMod_Open) (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)

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
instIdEnet Peripheral instance id
cfgConfiguration parameters
cfgSizeSize of the configuration parameters
Returns
Enet_ErrorCodes

◆ EnetMod_Rejoin

typedef int32_t(* const EnetMod_Rejoin) (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)

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
instIdEnet Peripheral instance id
Returns
Enet_ErrorCodes

◆ EnetMod_Ioctl

typedef int32_t(* const 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
hModEnet Module opaque handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ EnetMod_Close

typedef void(* const EnetMod_Close) (EnetMod_Handle hMod)

Close the Enet Module.

Closes the Enet Module.

Parameters
hModEnet Module opaque handle

◆ EnetMod_SaveCtxt

typedef void(* const EnetMod_SaveCtxt) (EnetMod_Handle hMod)

Saves and closes the Enet Module context before resetting.

Saves the Enet Module.

Parameters
hModEnet Module opaque handle

◆ EnetMod_RestoreCtxt

typedef int32_t(* const EnetMod_RestoreCtxt) (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)

Restores and opens the Enet Module after reset.

Restores and opens the Enet Module with the configuration parameters provided by the caller.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters
cfgSizeSize of the configuration parameters
Returns
Enet_ErrorCodes

Function Documentation

◆ EnetMod_open()

int32_t EnetMod_open ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId,
const void *  cfg,
uint32_t  cfgSize 
)

Wrapper to open and initialize an Enet Module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters
cfgSizeSize of the configuration parameters
Returns
Enet_ErrorCodes

◆ EnetMod_rejoin()

int32_t EnetMod_rejoin ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId 
)

Wrapper to rejoin an Enet Module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
Returns
Enet_ErrorCodes

◆ EnetMod_ioctl()

int32_t EnetMod_ioctl ( EnetMod_Handle  hMod,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Wrapper function to issue an operation on an Enet Module.

Parameters
hModEnet Module handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ EnetMod_registerMacportIoctlHandler()

int32_t EnetMod_registerMacportIoctlHandler ( EnetMod_Handle  hMod,
uint32_t  cmdBase,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Wrapper function to register IOCTL for Macport Module. This function is defined for the cases when ONLY second macport module is opened without opening the first Macport module.

Parameters
hModEnet Module handle
cmdBaseIOCTL command Base
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ EnetMod_ioctlFromIsr()

int32_t EnetMod_ioctlFromIsr ( EnetMod_Handle  hMod,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Wrapper function to issue an operation on an Enet Module from ISR context.

Parameters
hModEnet Module handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ EnetMod_close()

void EnetMod_close ( EnetMod_Handle  hMod)

Wrapper function to close an Enet Module.

Parameters
hModEnet Module handle

◆ EnetMod_saveCtxt()

void EnetMod_saveCtxt ( EnetMod_Handle  hMod)

Wrapper function to save and close Enet Module.

Parameters
hModEnet Module handle

◆ EnetMod_restoreCtxt()

int32_t EnetMod_restoreCtxt ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId,
const void *  cfg,
uint32_t  cfgSize 
)

Wrapper to retore and open Enet Module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters
cfgSizeSize of the configuration parameters
Returns
Enet_ErrorCodes

◆ EnetMod_isOpen()

static bool EnetMod_isOpen ( EnetMod_Handle  hMod)
inlinestatic

Check if Enet Module is open or not.

Parameters
hModEnet Module handle
Returns
Module's open status.