![]() |
![]() |
This file contains the type definitions and function prototypes of the Enet Utils functionality. More...
#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>
#include <ti/drv/enet/enet_cfg.h>
#include <ti/drv/enet/include/core/enet_types.h>
#include <ti/drv/enet/priv/core/enet_trace_priv.h>
Data Structures | |
struct | EnetUtils_Cfg_s |
Enet utils parameters. More... | |
Macros | |
#define | container_of(ptr, type, member) |
Macro to get container structure from one of its members' addresses. More... | |
#define | ENET_ARRAYSIZE(x) (sizeof(x) / sizeof(x[0])) |
Macro to get the size of an array. | |
#define | Enet_assert(cond, fmt,...) (void)(cond) |
Assertion. | |
#define | Enet_devAssert(cond, fmt,...) (void)(cond) |
Development-time assertion. | |
Typedefs | |
typedef void(* | Enet_Print )(const char *fmt,...) |
Info/debug print function prototype. More... | |
typedef uint64_t(* | Enet_VirtToPhys )(const void *virtAddr, void *appData) |
Virtual-to-physical address translation callback function. More... | |
typedef void *(* | Enet_PhysToVirt )(uint64_t phyAddr, void *appData) |
Physical-to-virtual address translation callback function. More... | |
typedef struct EnetUtils_Cfg_s | EnetUtils_Cfg |
Enet utils parameters. | |
Functions | |
void | EnetUtils_init (const EnetUtils_Cfg *cfg) |
Initialize utils module. More... | |
void | EnetUtils_deinit (void) |
De-initialize utils module. | |
void | EnetUtils_printf (const char *fmt,...) |
Print function. More... | |
void | EnetUtils_vprintf (const char *fmt, va_list args) |
Print function for va_list. More... | |
uint32_t | EnetUtils_min (uint32_t num1, uint32_t num2) |
Returns minimum of two numbers. More... | |
uint32_t | EnetUtils_max (uint32_t num1, uint32_t num2) |
Returns minimum of two numbers. More... | |
void | EnetUtils_delay (uint32_t delayVal) |
Busy loop for a given amount of cycles. More... | |
uint64_t | EnetUtils_virtToPhys (const void *virtAddr, void *appData) |
Convert a virtual address to physical address. More... | |
void * | EnetUtils_physToVirt (uint64_t physAddr, void *appData) |
Convert a physical address to virtual address. More... | |
This file contains the type definitions and function prototypes of the Enet Utils functionality.
#define container_of | ( | ptr, | |
type, | |||
member | |||
) |
Macro to get container structure from one of its members' addresses.
typedef void*(* Enet_PhysToVirt)(uint64_t phyAddr, void *appData) |
Physical-to-virtual address translation callback function.
This function is used by the driver to convert physical address to virtual address.
phyAddr | Physical address |
appData | Callback pointer passed during translation |
typedef void(* Enet_Print)(const char *fmt,...) |
Info/debug print function prototype.
This function is used by the driver to print info/debug messages.
fmt | Formatted string followed by variable arguments |
typedef uint64_t(* Enet_VirtToPhys)(const void *virtAddr, void *appData) |
Virtual-to-physical address translation callback function.
This function is used by the driver to convert virtual address to physical address.
virtAddr | Virtual address |
appData | Callback pointer passed during translation |
void EnetUtils_delay | ( | uint32_t | delayVal | ) |
Busy loop for a given amount of cycles.
delayVal | Delay time |
void EnetUtils_init | ( | const EnetUtils_Cfg * | cfg | ) |
Initialize utils module.
Utils module initialization function. Should be only called from the Enet top-level module.
cfg | Pointer to the initialization parameters |
uint32_t EnetUtils_max | ( | uint32_t | num1, |
uint32_t | num2 | ||
) |
Returns minimum of two numbers.
num1 | First number |
num2 | Second number |
uint32_t EnetUtils_min | ( | uint32_t | num1, |
uint32_t | num2 | ||
) |
Returns minimum of two numbers.
num1 | First number |
num2 | Second number |
void* EnetUtils_physToVirt | ( | uint64_t | physAddr, |
void * | appData | ||
) |
Convert a physical address to virtual address.
physAddr | Physical address |
appData | Auxiliary data |
void EnetUtils_printf | ( | const char * | fmt, |
... | |||
) |
Print function.
Prints the provided formatted string.
fmt | Formatted string followed by variable arguments |
uint64_t EnetUtils_virtToPhys | ( | const void * | virtAddr, |
void * | appData | ||
) |
Convert a virtual address to physical address.
virtAddr | Virtual address |
appData | Auxiliary data |
void EnetUtils_vprintf | ( | const char * | fmt, |
va_list | args | ||
) |
Print function for va_list.
Prints the provided formatted string.
fmt | Formatted string |
args | Arg list pointing to the arguments in the format string |