tte_core.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef TTE_CORE_H_
00020 #define TTE_CORE_H_
00021
00022 #include "tte_config.h"
00023 #include "tte_common.h"
00024 #include "tte_api.h"
00025 #include "tte_clock_sync.h"
00026
00027
00028 #define TTE_STAT_FREEZE (0)
00029 #define TTE_STAT_SYNC (1)
00030
00031
00032 typedef void (* tte_error_callback_t)(int32_t err_code);
00033
00034
00035 extern int32_t tte_get_sync_master(void);
00036
00037
00038 #ifdef TTE_INTERNAL
00039
00040
00041 typedef struct {
00042 uint32_t state;
00043 uint32_t slot;
00044 uint8_t integration_cycle;
00045 uint64_t rounds;
00046 uint32_t lost_cs_frames;
00047 int32_t rate;
00048 tte_task_conf_t tte_app_cb;
00049 uint32_t init_done;
00050 uint32_t started;
00051 int64_t last_slot_time;
00052 hwtime_t round_start_time;
00053 hwtime_t next_slot_time;
00054 tte_buffer_t pcf_buf;
00055 uint8_t pcf_frame[60];
00056 eth_mac_addr_t mac_addr;
00057 } tte_prot_t;
00058
00059
00060
00061 extern const tte_swes_conf_t *tt_conf;
00062 extern tte_prot_t tte_prot_dev;
00063
00064 extern int32_t tte_get_init_state(void);
00065
00066 extern void tte_integrate(hwtime_t ts, uint64_t tc_ns, uint8_t ic);
00067
00068 extern void tte_register_multicast_addresses(void);
00069
00070 extern int32_t tte_core_check_configure(const tte_swes_conf_t * config);
00071
00072 extern int32_t tte_core_eth_err_callback(uint8_t ctrl, int32_t err_code);
00073
00074 extern void tte_core_timer_callback(const uint8_t ctrl);
00075
00076 extern int32_t tte_core_configure_bg(const uint8_t ctrl);
00077
00078 extern int32_t tte_core_configure_tt(void);
00079
00080 extern void tte_free_tt_buffers(void);
00081
00082 extern void tte_core_init_prot_dev(tte_prot_t * my_tte_prot_dev);
00083
00084 extern void tte_core_switch_state(uint8_t state);
00085
00086 extern void tte_core_master_startup(void);
00087
00088 extern void tte_flush_tt(const uint8_t ctrl_id);
00089
00090 #endif
00091
00092 #endif