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 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:
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);
#define TTE_STAT_BOOTSTRAP ((uint32_t)4) |
#define TTE_STAT_CONFIGURED ((uint32_t)2) |
#define TTE_STAT_ERROR ((uint32_t)16) |
#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().
#define TTE_STAT_SYNCHRONIZED ((uint32_t)8) |
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);
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.
enum tte_buf_var_id_t |
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.
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.
|
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.
|
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.
|
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
|
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).
|
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;
enum tte_direction_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.
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;
enum tte_traffic_type_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.
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;
enum tte_var_id_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.
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
|
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.
|
TTE_VAR_CTRL_COUNT |
The number of available TTEthernet controllers.
|
TTE_VAR_CHANNEL_COUNT |
The number of available Ethernet channels/ports.
|
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.
|
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:
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.
|
TTE_VAR_THREAD_SAFE |
Controls whether the API will protect shared resources against concurrent access by locking the critical sections. A value of
|
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).
|
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;