/* (C) AndrĂ¡s Wiesner, 2020 */ #ifndef PTP_H #define PTP_H #ifdef __cplusplus extern "C" { #endif #include #include #include #include #ifndef SIMULATION #include "FreeRTOS.h" #include "task.h" #include "timers.h" #endif #include "timeutils.h" #include "ptp_types.h" #include "stats.h" #include "settings_interface.h" // ------------------------------------------- // ----- FLEXPTP_OPTIONS.H INCLUDE AREA ------ // ------------------------------------------- #include // ------------------------------------------- // (End of customizable area) // ------------------------------------------- // ------------------------------------------- void ptp_init(); // initialize PTP subsystem void ptp_deinit(); // deinitialize PTP subsystem void ptp_reset(); // reset PTP subsystem void ptp_process_packet(RawPtpMessage * pRawMsg); // process PTP packet typedef void (*SyncCallback)(int64_t time_error, const PtpSyncCycleData * pSCD, uint32_t freqCodeWord); void ptp_set_sync_callback(SyncCallback syncCB); #define PTP_IS_LOCKED(th) (ptp_get_stats()->filtTimeErr < (th) && !(ptp_get_current_master_clock_identity() != 0)) // is ptp locked considering threshold passed? extern PtpCoreState gPtpCoreState; void ptp_store_config(PtpConfig * pConfig); // store PTP-engine configuration (param: output) void ptp_load_config(const PtpConfig * pConfig); // load PTP-engine configuration void ptp_load_config_from_dump(const void *pDump); // load PTP-engine configuration from binary dump (i.e. from unaligned address) #ifdef __cplusplus } #endif #endif /* PTP */