TTEthernet API Common Data Types

Classes

struct  __attribute__
struct  tte_buf_status_t
struct  tte_buffer_t
struct  tte_frame_t
struct  tte_conf_t

Defines

#define TTE_API_HDR_VER   ( (int32_t) (0x02<<16 | 0x0000) )
#define TTE_STAT_RUNNING   ((uint32_t)1)
#define TTE_STAT_CONFIGURED   ((uint32_t)2)
#define TTE_STAT_BOOTSTRAP   ((uint32_t)4)
#define TTE_STAT_SYNCHRONIZED   ((uint32_t)8)
#define TTE_STAT_ERROR   ((uint32_t)16)

Typedefs

typedef uint64_t tte_time_t
typedef uint32_t tte_ctrl_status_t

Enumerations

enum  tte_direction_t { TTE_DIR_INPUT = 1, TTE_DIR_OUTPUT = 2, TTE_DIR_INOUT = 3 }
enum  tte_traffic_type_t { TTE_TT_TRAFFIC = 0, TTE_BG_TRAFFIC = 2, TTE_CT_TRAFFIC = 3 }
enum  tte_var_id_t {
  TTE_VAR_LINK_STATUS = 4096, TTE_VAR_CTRL_STATUS, TTE_VAR_CTRL_COUNT, TTE_VAR_CHANNEL_COUNT,
  TTE_VAR_TIME_RESOLUTION, TTE_VAR_API_VERSION, TTE_VAR_THREAD_SAFE, TTE_VAR_MAC_ADDRESS
}
enum  tte_buf_var_id_t {
  TTE_BUFVAR_RECEIVE_CB = 8192, TTE_BUFVAR_TRANSMIT_CB, TTE_BUFVAR_CB_ARG, TTE_BUFVAR_DMA_OUTPUT,
  TTE_BUFVAR_DMA_INPUT
}

Define Documentation

#define TTE_API_HDR_VER   ( (int32_t) (0x02<<16 | 0x0000) )

Version number of the TTEthernet API header file.

The number is 32 bits wide and structured into several parts:

  • bits 15-0: minor version number,
  • bits 23-16: major version number,
  • bits 31-24: reserved.

A change in the minor version number will not break interface compatibility and is intedended for bug fixes and interface extensions. A change in the major version number involves a significant modification of existing interfaces and will require an update of existing applications.

Each implementation of the TTEthernet API contains the version number of the implemented interface. This version can be obtained at runtime with the following function call:

   tte_get_var(ctrl_id, TTE_VAR_API_VERSION, sizeof(ver), &ver);

Definition at line 61 of file tte_api.h.

#define TTE_STAT_BOOTSTRAP   ((uint32_t)4)

Controller status bit that is active when a default (bootstrap) configuration is loaded. A bootrap configuration usually supports only background message transmission and reception.

Definition at line 231 of file tte_api.h.

#define TTE_STAT_CONFIGURED   ((uint32_t)2)

Controller status bit that is active when the controller contains a valid configuration. The configuration might be a default bootstrap mode which allows only restricted operation; see :TTE_STAT_BOOTSTRAP.

Definition at line 226 of file tte_api.h.

#define TTE_STAT_ERROR   ((uint32_t)16)

Controller status bit that becomes active when controller detects a fatal error. The controller must be restarted when it is in the error state.

Definition at line 240 of file tte_api.h.

#define TTE_STAT_RUNNING   ((uint32_t)1)

Controller status bit that is activated after the controller has been started with tte_start() and remains active until the controller has been stopped with tte_stop().

Definition at line 220 of file tte_api.h.

#define TTE_STAT_SYNCHRONIZED   ((uint32_t)8)

Controller status bit that is active while the controller is running in sync with the rest of the TTEthernet cluster.

Definition at line 235 of file tte_api.h.


Typedef Documentation

typedef uint32_t tte_ctrl_status_t

Controller status vector.

The status can be a combination of TTE_STAT_CONFIGURED, TTE_STAT_BOOTSTRAP, TTE_STAT_SYNCHRONIZED, TTE_STAT_ERROR, TTE_STAT_RUNNING. You can get the status vector with the following function call:

   tte_get_var(ctrl_id, TTE_VAR_CTRL_STATUS, sizeof(stat), &stat);

Definition at line 214 of file tte_api.h.

typedef uint64_t tte_time_t

Time value in nanoseconds.

All functions of the TTEthernet API use the same time format, however, the internal representation of time might be different in various TTEthernet controllers. You can get the resulution of the internal clock with the following function call:

   tte_get_var(ctrl_id, TTE_VAR_TIME_RESOLUTION, sizeof(time), &time);

This type is always an unsigned integer.

Definition at line 75 of file tte_api.h.


Enumeration Type Documentation

Numerical identifiers of supported message buffer variables.

The values of the variables can be obtained via tte_get_buf_var() and changed via tte_set_buf_var(). Some of the variables are supported only on selected implementations of TTEthernet or are available only in read-only mode. When a particular variable is not supported, the function call will return ETT_NOTSUPPORTED. Each variable description explicitly mentions whether it is mandatory or optional and which type is used to store its contents.

Note:
A buffer variable is not thread-safe. If you set the same variable of one message buffer from different threads (or just using different buffer handles), the second access will overwrite the value stored during the first access.
Enumerator:
TTE_BUFVAR_RECEIVE_CB 

A callback executed when a new message is stored inside an input buffer. You can specify the argument for the callback with the TTE_BUFVAR_CB_ARG buffer variable.

Note:
Type: void (*fn)(void *).
Optional read support.
Optional write support.
TTE_BUFVAR_TRANSMIT_CB 

A callback executed when a message is deleted from an output buffer (usable only for queue buffers). A message is deleted from an output buffer when the controller finishes its transmission. You can specify the argument for the callback with the TTE_BUFVAR_CB_ARG buffer variable.

Note:
Type: void (*fn)(void *).
Optional read support.
Optional write support.
TTE_BUFVAR_CB_ARG 

The argument passed to a receive or transmit callback. If you do not set the argument explicitly, the buffer address is used.

Note:
Type: void *.
Optional read support.
Optional write support.
TTE_BUFVAR_DMA_OUTPUT 

Control flag that determines whether messages from this buffer are transferred via DMA or via direct access by the CPU. If the value is set to 1, DMA transfer is used. The default setting is to disable DMA transfers (this is also valid for implementations that do no support this buffer variable).

Note:
Type: uint8_t.
Optional read support.
Optional write support. You need to set the flag to `1' before you write the message. If you switch this flag off, you should wait until all pending DMA transfers for this message buffer are finished before you start writing new messages into the same buffer.
TTE_BUFVAR_DMA_INPUT 

Control flag that determines whether messages from this buffer are received via DMA or via direct access by the CPU. Setting this variable to `1' will schedule a single DMA read transfer from the controller. The variable will remain set to `1' until the DMA transfer is finished, and then reset to `0'.

The received message can be read using the usual functions (tte_open_input_buf(), tte_read_input_buf(), etc).

Note:
Type: uint8_t.
No read support.
Optional write support: Writing non-zero value will schedule a DMA read. Writing `0' will disable DMA access for this buffer. It is not possible to disable the DMA access if a transfer is pending.

Definition at line 356 of file tte_api.h.

00356              {
00357 
00365     TTE_BUFVAR_RECEIVE_CB = 8192,
00366 
00376     TTE_BUFVAR_TRANSMIT_CB,
00377 
00384     TTE_BUFVAR_CB_ARG,
00385 
00399     TTE_BUFVAR_DMA_OUTPUT,
00400 
00416     TTE_BUFVAR_DMA_INPUT,
00417 } tte_buf_var_id_t;

Message input/output classification.

The values are used to form a bit mask: note that the TTE_DIR_INPUT and TTE_DIR_OUTPUT values produce the TTE_DIR_INOUT value when combined.

Enumerator:
TTE_DIR_INPUT 

Receive buffer

TTE_DIR_OUTPUT 

Transmit buffer

TTE_DIR_INOUT 

Bidirectional buffer

Definition at line 83 of file tte_api.h.

00083              {
00084     TTE_DIR_INPUT  = 1,   
00085     TTE_DIR_OUTPUT = 2,   
00086     TTE_DIR_INOUT  = 3,   
00087 } tte_direction_t;

Message traffic type. TTEthernet recognizes three traffic classes: time-triggered, rate-constrained, and non-critical (background/best-effort). Each message belongs to exacly one traffic class.

Enumerator:
TTE_TT_TRAFFIC 

time-triggered

TTE_BG_TRAFFIC 

non-critical

TTE_CT_TRAFFIC 

critical, i.e TT

Definition at line 94 of file tte_api.h.

00094              {
00095     TTE_TT_TRAFFIC = 0,   
00096     TTE_BG_TRAFFIC = 2,   
00097     TTE_CT_TRAFFIC = 3    
00098 } tte_traffic_type_t;

Numerical identifiers of supported TTEthernet API variables.

The values of the variables can be obtained via tte_get_var() and changed via tte_set_var(). Some of the variables are supported only on selected implementations of TTEthernet or are available only in read-only mode. When a particular variable is not supported, the function call will return ETT_NOTSUPPORTED. Each variable description explicitly mentions whether it is mandatory or optional and which type is used to store its contents.

Enumerator:
TTE_VAR_LINK_STATUS 

A bit vector that contains the current physical link status of each Ethernet port. The least significant bit will be set to 1 if the link on the first Ethernet port is active. The second Ethernet port is assigned to the next bit and so on.

Note:
Type: uint8_t.
Mandatory read support
Optional write support (enables/disables the Ethernet channel).
TTE_VAR_CTRL_STATUS 

Controller status flags.

The value is a combination of bits identified by the following constants: TTE_STAT_RUNNING, TTE_STAT_CONFIGURED, TTE_STAT_BOOTSTRAP, TTE_STAT_SYNCHRONIZED, TTE_STAT_ERROR.

Note:
Type: tte_ctrl_status_t.
Mandatory read support.
No write support.
TTE_VAR_CTRL_COUNT 

The number of available TTEthernet controllers.

Note:
Type: uint8_t.
Mandatory read support.
Optional write support.
TTE_VAR_CHANNEL_COUNT 

The number of available Ethernet channels/ports.

Note:
Type: uint8_t.
Mandatory read support.
Optional write support.
TTE_VAR_TIME_RESOLUTION 

The resolution of the internal clock in nanoseconds. The internal resolution might be coarser than the resolution of the tte_time_t type, which is always one nanosecond.

Note:
Type: tte_time_t.
Mandatory read support.
Optional write support.
TTE_VAR_API_VERSION 

Version of the TTEthernet library implementation.

The number has the same structure as TTE_API_HDR_VER. It is 32 bits wide and structured into several parts:

  • bits 15-0: minor version number,
  • bits 23-16: major version number,
  • bits 31-24: reserved.

A change in the minor version number will not break interface compatibility and is intedended for bug fixes and interface extensions. A change in the major version number involves a significant modification of existing interfaces and will require an update of existing applications.

Note:
Type: uint32_t.
Mandatory read support.
Optional write support.
TTE_VAR_THREAD_SAFE 

Controls whether the API will protect shared resources against concurrent access by locking the critical sections. A value of 1 means that the API is thread-safe.

Note:
Type: uint8_t.
Mandatory read support.
Optional write support.
TTE_VAR_MAC_ADDRESS 

The controller's own MAC address. This address is usually used as a filter for received messages, and as a source address for transmitted background messages. The exact meaning of the variable depends on the controller implementation (some controllers might support more than one MAC address, for example).

Note:
Type: uint8_t[6].
Mandatory read support.
Optional write support.

Definition at line 252 of file tte_api.h.

00252              {
00253 
00263     TTE_VAR_LINK_STATUS = 4096,
00264 
00275     TTE_VAR_CTRL_STATUS,
00276 
00282     TTE_VAR_CTRL_COUNT,
00283 
00289     TTE_VAR_CHANNEL_COUNT,
00290 
00298     TTE_VAR_TIME_RESOLUTION,
00299 
00318     TTE_VAR_API_VERSION,
00319 
00327     TTE_VAR_THREAD_SAFE,
00328 
00338     TTE_VAR_MAC_ADDRESS,
00339 } tte_var_id_t;

Generated on Tue Nov 29 14:09:19 2011 for TTEthernet Model for INET Framework by  doxygen 1.6.3