![]() |
![]() |
This file contains the type definitions and helper macros for the Enet Peripheral interface. More...
#include <stdint.h>
#include <ti/drv/enet/include/core/enet_types.h>
#include <ti/drv/enet/include/core/enet_ioctl.h>
#include <ti/drv/enet/include/core/enet_mod_macport.h>
Data Structures | |
struct | EnetPer_PortLinkCfg_s |
Input args for ENET_PER_IOCTL_OPEN_PORT_LINK command. More... | |
struct | EnetPer_AttachCoreOutArgs_s |
Output args for ENET_PER_IOCTL_ATTACH_CORE command. More... | |
struct | EnetPer_Obj_s |
Ethernet Peripheral object. More... | |
Macros | |
#define | ENET_PER_CFG_MAGIC (0xAAAAAAAAU) |
Enet Peripheral configuration magic vlaue. | |
#define | ENET_TO_PER(per) ((EnetPer_Handle)per) |
Convert peripheral specific handle to EnetMod generic handle. | |
#define | ENET_PER_PUBLIC_IOCTL(x) (ENET_IOCTL_PER_BASE | ENET_IOCTL_MIN(x)) |
Helper macro to create IOCTL commands for peripherals. | |
Typedefs | |
typedef struct EnetPer_PortLinkCfg_s | EnetPer_PortLinkCfg |
Input args for ENET_PER_IOCTL_OPEN_PORT_LINK command. | |
typedef struct EnetPer_AttachCoreOutArgs_s | EnetPer_AttachCoreOutArgs |
Output args for ENET_PER_IOCTL_ATTACH_CORE command. | |
typedef struct EnetPer_Obj_s * | EnetPer_Handle |
Ethernet Peripheral handle. More... | |
typedef void(* | EnetPer_InitCfg )(EnetPer_Handle hPer, Enet_Type enetType, void *cfg) |
Initialize peripheral's configuration parameters. More... | |
typedef int32_t(* | EnetPer_Open )(EnetPer_Handle hPer, Enet_Type enetType, const void *cfg) |
Open and initialize the Enet Peripheral. More... | |
typedef int32_t(* | EnetPer_Rejoin )(EnetPer_Handle hPer, Enet_Type enetType) |
Rejoin a running Enet Peripheral. More... | |
typedef int32_t(* | EnetPer_Ioctl )(EnetPer_Handle hPer, uint32_t cmd, Enet_IoctlPrms *prms) |
Issue an operation on the Enet Peripheral. More... | |
typedef void(* | EnetPer_Poll )(EnetPer_Handle hPer, uint32_t evtMask) |
Poll for Ethernet events. More... | |
typedef void(* | EnetPer_PeriodicTick )(EnetPer_Handle hPer) |
Run periodic tick on the Ethernet peripheral. More... | |
typedef void(* | EnetPer_Close )(EnetPer_Handle hPer) |
Close the Enet Peripheral. More... | |
typedef struct EnetPer_Obj_s | EnetPer_Obj |
Ethernet Peripheral object. | |
Enumerations | |
enum | EnetPer_Ioctl_e { ENET_PER_IOCTL_GET_VERSION = ENET_PER_PUBLIC_IOCTL(0U), ENET_PER_IOCTL_PRINT_REGS = ENET_PER_PUBLIC_IOCTL(1U), ENET_PER_IOCTL_OPEN_PORT_LINK = ENET_PER_PUBLIC_IOCTL(2U), ENET_PER_IOCTL_CLOSE_PORT_LINK = ENET_PER_PUBLIC_IOCTL(3U), ENET_PER_IOCTL_IS_PORT_LINK_UP = ENET_PER_PUBLIC_IOCTL(4U), ENET_PER_IOCTL_GET_PORT_LINK_CFG = ENET_PER_PUBLIC_IOCTL(5U), ENET_PER_IOCTL_ATTACH_CORE = ENET_PER_PUBLIC_IOCTL(6U), ENET_PER_IOCTL_DETACH_CORE = ENET_PER_PUBLIC_IOCTL(7U) } |
Ethernet peripheral IOCTL commands. More... | |
This file contains the type definitions and helper macros for the Enet Peripheral interface.
typedef void(* EnetPer_Close)(EnetPer_Handle hPer) |
Close the Enet Peripheral.
Closes the Enet Peripheral.
hPer | Enet Peripheral handle |
typedef struct EnetPer_Obj_s* EnetPer_Handle |
Ethernet Peripheral handle.
Ethernet Peripheral handle used to call any EnetPer related APIs.
typedef void(* EnetPer_InitCfg)(EnetPer_Handle hPer, Enet_Type enetType, void *cfg) |
Initialize peripheral's configuration parameters.
Initializes the configuration parameter of the Enet Peripheral.
hPer | Enet Peripheral handle |
enetType | Enet Peripheral type |
cfg | Configuration parameters to be initialized |
typedef int32_t(* EnetPer_Ioctl)(EnetPer_Handle hPer, uint32_t cmd, Enet_IoctlPrms *prms) |
Issue an operation on the Enet Peripheral.
Issues a control operation on the Enet Peripheral.
hPer | Enet Peripheral handle |
cmd | IOCTL command Id |
prms | IOCTL parameters |
typedef int32_t(* EnetPer_Open)(EnetPer_Handle hPer, Enet_Type enetType, const void *cfg) |
Open and initialize the Enet Peripheral.
Opens and initializes the Enet Peripheral with the configuration parameters provided by the caller.
hPer | Enet Peripheral handle |
enetType | Enet Peripheral type |
cfg | Configuration parameters |
typedef void(* EnetPer_PeriodicTick)(EnetPer_Handle hPer) |
Run periodic tick on the Ethernet peripheral.
Run PHY periodic tick on the Ethernet peripheral.
hPer | Enet Peripheral handle |
typedef void(* EnetPer_Poll)(EnetPer_Handle hPer, uint32_t evtMask) |
Poll for Ethernet events.
Unblocking poll for the events specified in evtMask
.
This is an optional function and could be set to NULL if the peripheral doesn't implement it.
hPer | Enet Peripheral handle |
evtMask | Event bit mask |
typedef int32_t(* EnetPer_Rejoin)(EnetPer_Handle hPer, Enet_Type enetType) |
Rejoin a running Enet Peripheral.
Reopens the Enet Peripheral, but doesn't perform any hardware initialization. This function is expected to be called to attach to a running peripheral.
This is an optional function and could be set to NULL if the peripheral doesn't implement it.
hPer | Enet Peripheral handle |
enetType | Enet Peripheral type |
enum EnetPer_Ioctl_e |
Ethernet peripheral IOCTL commands.
Enumerator | |
---|---|
ENET_PER_IOCTL_GET_VERSION |
Get the hardware version of the peripheral. IOCTL parameters:
|
ENET_PER_IOCTL_PRINT_REGS |
Print registers of the peripheral and all its modules. IOCTL parameters:
|
ENET_PER_IOCTL_OPEN_PORT_LINK |
Open port link (MAC port and PHY). IOCTL parameters:
|
ENET_PER_IOCTL_CLOSE_PORT_LINK |
Close port link (MAC port and PHY). IOCTL parameters:
|
ENET_PER_IOCTL_IS_PORT_LINK_UP |
Check if port link is up. IOCTL parameters:
|
ENET_PER_IOCTL_GET_PORT_LINK_CFG |
Get port link configuration (speed and duplexity). IOCTL parameters:
|
ENET_PER_IOCTL_ATTACH_CORE |
Attach core to Ethernet peripheral. IOCTL parameters:
|
ENET_PER_IOCTL_DETACH_CORE |
Detach core from Ethernet peripheral using its core key. IOCTL parameters:
|