PDK API Guide for AM65xx
enet_trace_priv.h File Reference

Introduction

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

Go to the source code of this file.

Macros

#define ENETTRACE_trace(globalLevel, level, fmt, ...)
 Trace prefix type. More...
 
#define ENETTRACE_ERR(fmt, ...)
 Helper macro to add trace message with ENET_TRACE_ERROR level. More...
 
#define ENETTRACE_ERR_IF(cond, ...)   ((cond) ? ENETTRACE_ERR(__VA_ARGS__) : 0U)
 Helper macro to add trace message with ENET_TRACE_ERROR level if a condition is met. More...
 
#define ENETTRACE_WARN(fmt, ...)
 Helper macro to add trace message with ENET_TRACE_WARN level. More...
 
#define ENETTRACE_WARN_IF(cond, ...)   ((cond) ? ENETTRACE_WARN(__VA_ARGS__) : 0U)
 Helper macro to add trace message with ENET_TRACE_WARN level if a condition is met. More...
 
#define ENETTRACE_INFO(fmt, ...)
 Helper macro to add trace message with ENET_TRACE_INFO level. More...
 
#define ENETTRACE_INFO_IF(cond, ...)   ((cond) ? ENETTRACE_INFO(__VA_ARGS__) : 0U)
 Helper macro to add trace message with ENET_TRACE_INFO level if a condition is met. More...
 
#define ENETTRACE_DBG(fmt, ...)
 Helper macro to add trace message with ENET_TRACE_DEBUG level. More...
 
#define ENETTRACE_DBG_IF(cond, ...)   ((cond) ? ENETTRACE_DBG(__VA_ARGS__) : 0U)
 Helper macro to add trace message with ENET_TRACE_DEBUG level if a condition is met. More...
 
#define ENETTRACE_VERBOSE(fmt, ...)
 Helper macro to add trace message with ENET_TRACE_VERBOSE level. More...
 
#define ENETTRACE_VERBOSE_IF(cond, ...)   ((cond) ? ENETTRACE_VERBOSE(__VA_ARGS__) : 0U)
 Helper macro to add trace message with ENET_TRACE_VERBOSE level if a condition is met. More...
 
#define ENETTRACE_VAR(var)   ((var) = (var))
 Variable declaration helper macro to avoid unused variable error (-Werror=unused-variable) when variable is used in TRACE and when corresponding trace level is not enabled. More...
 

Functions

void EnetTrace_trace (EnetTrace_TraceLevel globalLevel, EnetTrace_TraceLevel level, const char *fmt,...)
 Log a trace message if log level is enabled. More...
 
EnetTrace_TraceLevel EnetTrace_setLevel (EnetTrace_TraceLevel level)
 Set runtime trace level. More...
 
EnetTrace_TraceLevel EnetTrace_getLevel (void)
 Get runtime trace level. More...
 

Variables

EnetTrace_TraceLevel gEnetTrace_runtimeLevel
 Enabled runtime trace level. More...
 

Macro Definition Documentation

◆ ENETTRACE_trace

#define ENETTRACE_trace (   globalLevel,
  level,
  fmt,
  ... 
)

Trace prefix type.

◆ ENETTRACE_ERR

#define ENETTRACE_ERR (   fmt,
  ... 
)
Value:
fmt, \
## __VA_ARGS__)
EnetTrace_TraceLevel gEnetTrace_runtimeLevel
Enabled runtime trace level.
Definition: enet_trace.h:114
#define ENETTRACE_trace(globalLevel, level, fmt,...)
Trace prefix type.
Definition: enet_trace_priv.h:96

Helper macro to add trace message with ENET_TRACE_ERROR level.

◆ ENETTRACE_ERR_IF

#define ENETTRACE_ERR_IF (   cond,
  ... 
)    ((cond) ? ENETTRACE_ERR(__VA_ARGS__) : 0U)

Helper macro to add trace message with ENET_TRACE_ERROR level if a condition is met.

◆ ENETTRACE_WARN

#define ENETTRACE_WARN (   fmt,
  ... 
)
Value:
fmt, \
## __VA_ARGS__)
Definition: enet_trace.h:117
EnetTrace_TraceLevel gEnetTrace_runtimeLevel
Enabled runtime trace level.
#define ENETTRACE_trace(globalLevel, level, fmt,...)
Trace prefix type.
Definition: enet_trace_priv.h:96

Helper macro to add trace message with ENET_TRACE_WARN level.

◆ ENETTRACE_WARN_IF

#define ENETTRACE_WARN_IF (   cond,
  ... 
)    ((cond) ? ENETTRACE_WARN(__VA_ARGS__) : 0U)

Helper macro to add trace message with ENET_TRACE_WARN level if a condition is met.

◆ ENETTRACE_INFO

#define ENETTRACE_INFO (   fmt,
  ... 
)
Value:
fmt, \
## __VA_ARGS__)
Definition: enet_trace.h:124
EnetTrace_TraceLevel gEnetTrace_runtimeLevel
Enabled runtime trace level.
#define ENETTRACE_trace(globalLevel, level, fmt,...)
Trace prefix type.
Definition: enet_trace_priv.h:96

Helper macro to add trace message with ENET_TRACE_INFO level.

Traces with this level should give only important informational messages to the user, which typically they don't occur very often (i.e. "NIMU is ready", "PHY n link is up"). This trace level may be enabled by default.

◆ ENETTRACE_INFO_IF

#define ENETTRACE_INFO_IF (   cond,
  ... 
)    ((cond) ? ENETTRACE_INFO(__VA_ARGS__) : 0U)

Helper macro to add trace message with ENET_TRACE_INFO level if a condition is met.

◆ ENETTRACE_DBG

#define ENETTRACE_DBG (   fmt,
  ... 
)
Value:
fmt, \
## __VA_ARGS__)
Definition: enet_trace.h:135
EnetTrace_TraceLevel gEnetTrace_runtimeLevel
Enabled runtime trace level.
#define ENETTRACE_trace(globalLevel, level, fmt,...)
Trace prefix type.
Definition: enet_trace_priv.h:96

Helper macro to add trace message with ENET_TRACE_DEBUG level.

Traces with this level will provide the user further information about operations taking place (i.e. "MDIO module is open", "PHY n has started auto-negotiation, etc). This trace level is likely not enabled by default, so most of driver's traces will follow in this category.

◆ ENETTRACE_DBG_IF

#define ENETTRACE_DBG_IF (   cond,
  ... 
)    ((cond) ? ENETTRACE_DBG(__VA_ARGS__) : 0U)

Helper macro to add trace message with ENET_TRACE_DEBUG level if a condition is met.

◆ ENETTRACE_VERBOSE

#define ENETTRACE_VERBOSE (   fmt,
  ... 
)
Value:
fmt, \
## __VA_ARGS__)
EnetTrace_TraceLevel gEnetTrace_runtimeLevel
Enabled runtime trace level.
Definition: enet_trace.h:146
#define ENETTRACE_trace(globalLevel, level, fmt,...)
Trace prefix type.
Definition: enet_trace_priv.h:96

Helper macro to add trace message with ENET_TRACE_VERBOSE level.

Traces with this level will provide even more information and much more often than the DEBUG level (i.e. "PHY n: NWAY_WAIT state", "DMA transfer is complete"). Enabling this trace level is likely going to flood with messages, so developers must ensure that their debug messages that occur often enough are set with VERBOSE level.

◆ ENETTRACE_VERBOSE_IF

#define ENETTRACE_VERBOSE_IF (   cond,
  ... 
)    ((cond) ? ENETTRACE_VERBOSE(__VA_ARGS__) : 0U)

Helper macro to add trace message with ENET_TRACE_VERBOSE level if a condition is met.

◆ ENETTRACE_VAR

#define ENETTRACE_VAR (   var)    ((var) = (var))

Variable declaration helper macro to avoid unused variable error (-Werror=unused-variable) when variable is used in TRACE and when corresponding trace level is not enabled.

Function Documentation

◆ EnetTrace_trace()

void EnetTrace_trace ( EnetTrace_TraceLevel  globalLevel,
EnetTrace_TraceLevel  level,
const char *  fmt,
  ... 
)

Log a trace message if log level is enabled.

Log trace messages for log levels that are enabled at runtime.

Parameters
globalLevelTrace module global level
levelTrace level intended to be logged
fmtPrint string

◆ EnetTrace_setLevel()

EnetTrace_TraceLevel EnetTrace_setLevel ( EnetTrace_TraceLevel  level)

Set runtime trace level.

Set the driver's runtime travel level.

Parameters
levelTrace level to be enabled
Returns
Previous trace level

◆ EnetTrace_getLevel()

EnetTrace_TraceLevel EnetTrace_getLevel ( void  )

Get runtime trace level.

Get the driver's runtime travel level.

Returns
Current trace level

Variable Documentation

◆ gEnetTrace_runtimeLevel

EnetTrace_TraceLevel gEnetTrace_runtimeLevel

Enabled runtime trace level.