flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
Loading...
Searching...
No Matches
ptp_core.h File Reference

Core of the PTP implementation. Defines functions for message processing, clock tuning, storing and loading configurations and managing event callbacks. More...

#include <stdint.h>
#include <stdbool.h>
#include "event.h"
#include "ptp_types.h"
#include <flexptp_options.h>

Go to the source code of this file.

Functions

void ptp_init (void)
 
void ptp_deinit ()
 
void ptp_reset ()
 
void ptp_process_packet (RawPtpMessage *pRawMsg)
 
void ptp_process_event (const PtpCoreEvent *event)
 
uint32_t ptp_get_tick ()
 
void ptp_set_sync_callback (PtpSyncCallback syncCb)
 
void ptp_set_user_event_callback (PtpUserEventCallback userEventCb)
 

Detailed Description

Core of the PTP implementation. Defines functions for message processing, clock tuning, storing and loading configurations and managing event callbacks.

Definition in file ptp_core.h.

Function Documentation

◆ ptp_deinit()

void ptp_deinit ( )

Deinitialize flexPTP module.

Definition at line 101 of file ptp_core.c.

◆ ptp_get_tick()

uint32_t ptp_get_tick ( )

Get current PTP tick.

Returns
current flexPTP tick

Definition at line 230 of file ptp_core.c.

◆ ptp_init()

void ptp_init ( void  )

Initialize flexPTP module.

Definition at line 71 of file ptp_core.c.

◆ ptp_process_event()

void ptp_process_event ( const PtpCoreEvent event)

Process a core event.

Parameters
eventpointer to an event object

Definition at line 198 of file ptp_core.c.

◆ ptp_process_packet()

void ptp_process_packet ( RawPtpMessage pRawMsg)

Process a PTP packet.

Parameters
pRawMsgpointer to raw PTP message

Definition at line 157 of file ptp_core.c.

◆ ptp_reset()

void ptp_reset ( )

Reset PTP subsystem.

Definition at line 234 of file ptp_core.c.

◆ ptp_set_sync_callback()

void ptp_set_sync_callback ( PtpSyncCallback  syncCb)

Set callback invoked each synchronization cycle.

Parameters
syncCBcallback function pointer

Definition at line 241 of file ptp_core.c.

◆ ptp_set_user_event_callback()

void ptp_set_user_event_callback ( PtpUserEventCallback  userEventCb)

Set user event callback.

Parameters
userEventCbcallback function pointer

Definition at line 245 of file ptp_core.c.