TI-RTOS for TivaC  2.14.04.31
Data Structures | Macros | Typedefs | Functions
EMAC.h File Reference

Detailed Description

EMAC driver interface.

============================================================================

The EMAC header file should be included in an application as follows:

Implementation

The EMAC driver interface module is joined (at link time) to a NULL-terminated array of EMAC_Config data structures named EMAC_config. EMAC_config is implemented in the application with each entry being an instance of a EMAC peripheral. Each entry in EMAC_config contains a:

Currently the following EMAC peripheral implementations are supported:

Instrumentation

The EMAC driver interface produces log statements if instrumentation is enabled.

Diagnostics Mask Log details
Diags_USER1 basic operations
Diags_USER2 detailed operations

#include <stdint.h>
#include <stdbool.h>
Include dependency graph for EMAC.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  EMAC_FxnTable
 EMAC Function table structure. More...
 
struct  EMAC_Config
 EMAC Global configuration. More...
 

Macros

#define EMAC_CMD_RESERVED   32
 
#define EMAC_STATUS_RESERVED   -32
 
#define EMAC_STATUS_SUCCESS   0
 Successful status code returned by EMAC_control(). More...
 
#define EMAC_STATUS_ERROR   -1
 Generic error status code returned by EMAC_control(). More...
 
#define EMAC_STATUS_UNDEFINEDCMD   -2
 An error status code returned by EMAC_control() for undefined command codes. More...
 

Typedefs

typedef void(* EMAC_InitFxn) (uint32_t)
 
typedef bool(* EMAC_isLinkUpFxn) (uint32_t)
 
typedef struct EMAC_FxnTable EMAC_FxnTable
 EMAC Function table structure. More...
 
typedef struct EMAC_Config EMAC_Config
 EMAC Global configuration. More...
 

Functions

void EMAC_init (void)
 This function initializes the EMAC driver. More...
 
bool EMAC_isLinkUp (unsigned int index)
 This function returns if the link is up. More...
 

Macro Definition Documentation

#define EMAC_CMD_RESERVED   32

Common EMAC_control command code reservation offset. EMAC driver implementations should offset command codes with EMAC_CMD_RESERVED growing positively

Example implementation specific command codes:

1 #define EMACXYZ_CMD_COMMAND0 EMAC_CMD_RESERVED + 0
2 #define EMACXYZ_CMD_COMMAND1 EMAC_CMD_RESERVED + 1
#define EMAC_STATUS_RESERVED   -32

Common EMAC_control status code reservation offset. EMAC driver implementations should offset status codes with EMAC_STATUS_RESERVED growing negatively.

Example implementation specific status codes:

1 #define EMACXYZ_STATUS_ERROR0 EMAC_STATUS_RESERVED - 0
2 #define EMACXYZ_STATUS_ERROR1 EMAC_STATUS_RESERVED - 1
3 #define EMACXYZ_STATUS_ERROR2 EMAC_STATUS_RESERVED - 2
#define EMAC_STATUS_SUCCESS   0

Successful status code returned by EMAC_control().

EMAC_control() returns EMAC_STATUS_SUCCESS if the control code was executed successfully.

#define EMAC_STATUS_ERROR   -1

Generic error status code returned by EMAC_control().

EMAC_control() returns EMAC_STATUS_ERROR if the control code was not executed successfully.

#define EMAC_STATUS_UNDEFINEDCMD   -2

An error status code returned by EMAC_control() for undefined command codes.

EMAC_control() returns EMAC_STATUS_UNDEFINEDCMD if the control code is not recognized by the driver implementation.

Typedef Documentation

typedef void(* EMAC_InitFxn) (uint32_t)
typedef bool(* EMAC_isLinkUpFxn) (uint32_t)
typedef struct EMAC_FxnTable EMAC_FxnTable

EMAC Function table structure.

typedef struct EMAC_Config EMAC_Config

EMAC Global configuration.

The EMAC_Config structure contains a set of pointers used to characterize the EMAC driver implementation.

This structure needs to be defined before calling EMAC_init() and it must not be changed thereafter.

See also
EMAC_init()

Function Documentation

void EMAC_init ( void  )

This function initializes the EMAC driver.

This function must be called by the application before the NDK stack thread is started.

Precondition
The EMAC_config structure must exist and be persistent before this function can be called. This function must also be called before any other EMAC driver APIs. This function call does not modify any peripheral registers.
bool EMAC_isLinkUp ( unsigned int  index)

This function returns if the link is up.

Returns
true is the link is up. false if it is down.
Copyright 2015, Texas Instruments Incorporated