Functions
enet_soc.h File Reference

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

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

Functions

int32_t EnetSoc_init (void)
 Initialize SoC layer. More...
 
Enet_Handle EnetSoc_getEnetHandleByIdx (uint32_t idx)
 Get handle of the Enet driver by its index. More...
 
Enet_Handle EnetSoc_getEnetHandle (Enet_Type enetType, uint32_t instId)
 Get handle of the Enet driver for a given Ethernet peripheral. More...
 
uint32_t EnetSoc_getCoreId (void)
 Get core id of caller. More...
 
uint32_t EnetSoc_getCoreKey (uint32_t coreId)
 Get core key for the given core id. More...
 
bool EnetSoc_isCoreAllowed (Enet_Type enetType, uint32_t instId, uint32_t coreId)
 Check if core is enable to use an Ethernet peripheral. More...
 
uint32_t EnetSoc_getEnetNum (void)
 Get number of present Ethernet peripherals. More...
 
uint32_t EnetSoc_getMacPortMax (Enet_Type enetType, uint32_t instId)
 Get number of MAC ports in a peripheral. More...
 
uint32_t EnetSoc_getClkFreq (uint32_t clkId)
 Get SoC clock frequency. More...
 
int32_t EnetSoc_getEFusedMacAddrs (uint8_t *macAddrs, uint32_t *num)
 Get EFused MAC addresses. More...
 

Detailed Description

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

Function Documentation

uint32_t EnetSoc_getClkFreq ( uint32_t  clkId)

Get SoC clock frequency.

Gets the frequency (in Hz) of an SoC clock identified by clkId.

Parameters
clkIdClock id
Returns
Clock frequency in Hz
uint32_t EnetSoc_getCoreId ( void  )

Get core id of caller.

Gets id of the core where this function is called from.

Returns
Core Id
uint32_t EnetSoc_getCoreKey ( uint32_t  coreId)

Get core key for the given core id.

Gets the core key corresponding to the passed core id.

Parameters
coreIdCore id
Returns
Core key
int32_t EnetSoc_getEFusedMacAddrs ( uint8_t *  macAddrs,
uint32_t *  num 
)

Get EFused MAC addresses.

Get a list of EFused MAC addresses.

Parameters
macAddrsMAC address array pointer
numMax number of addresses to populate in macAddrs array. It's updated with actual number of addresses filled.
Returns
Enet_ErrorCodes
Enet_Handle EnetSoc_getEnetHandle ( Enet_Type  enetType,
uint32_t  instId 
)

Get handle of the Enet driver for a given Ethernet peripheral.

Gets the handle to the Enet driver corresponding to the Ethernet peripheral identified by its type and instance id.

Parameters
enetTypeEnet Peripheral type
instIdInstance Id
Returns
Eth driver handle. NULL if no driver was found.
Enet_Handle EnetSoc_getEnetHandleByIdx ( uint32_t  idx)

Get handle of the Enet driver by its index.

Gets the handle to the Enet driver by its index. The index definition itself it SoC specific and not meaningful outside SoC internal implementation.

This function is mainly used by the Enet top-layer to iterate over all peripherals supported by the SoC. It's used along with EnetSoc_getEnetNum() to query the number of available peripherals.

Parameters
idxEthernet peripheral index
Returns
Eth driver handle. NULL if index is greater than the number of peripherals present in the SoC.
uint32_t EnetSoc_getEnetNum ( void  )

Get number of present Ethernet peripherals.

Gets the number of Ethernet peripheral present in this SoC.

Returns
Number of peripherals
uint32_t EnetSoc_getMacPortMax ( Enet_Type  enetType,
uint32_t  instId 
)

Get number of MAC ports in a peripheral.

Gets the number of MAC ports in a peripheral identified by its type and instance id.

Returns
Number of MAC ports
int32_t EnetSoc_init ( void  )

Initialize SoC layer.

Initializes the Enet SoC layer.

Returns
Enet_ErrorCodes
bool EnetSoc_isCoreAllowed ( Enet_Type  enetType,
uint32_t  instId,
uint32_t  coreId 
)

Check if core is enable to use an Ethernet peripheral.

Checks if a given core is allowed to use the Ethernet peripheral identified by its type and instance id.

Parameters
enetTypeEnet Peripheral type
instIdInstance Id
coreIdCore id
Returns
Wheter core is allowed to use the peripheral or not

Copyright 2020, Texas Instruments Incorporated