SZSPTP ez430-RF2480 1.0

ZigBee Sensor Network with synchronized time and time-stamped measurements.
ptp.h
Go to the documentation of this file.
1 /*
2  * ptp.h
3  *
4  * Date: 19/06/2014
5  * Author: Fernando Biazi Nascimento
6  * Copyright © 2014 Fernando Biazi Nascimento. All rights reserved.
7  *
8  * License of use and copy on file license.txt
9  *
10  */
11 
21 #ifndef PTP_H
22 #define PTP_H
23 
24 /*
25  * ======== Includes ========
26  */
27 
28 #include <xdc/std.h>
29 #include "ptp_types.h"
30 #include "ptp_clock.h"
31 
32 /*
33  * ======== Doxygen ========
34  */
41 /*
42  * ======== Constants ========
43  */
44 
45 /*
46  * ======== Macros ========
47  */
48 
49 /*
50  * ======== Types ========
51  */
52 
53 /*
54  * ======== Global Variables ========
55  */
56 
57 extern ptp_clock ptpClock;
58 extern ptp_uinteger64 ptp_meanPathDelay[PTP_NUMBERPORTS];
59 extern PTP_foreignMasterDS ptp_foreignMaster[PTP_NUMBERPORTS][1];
60 
61 extern ptp_integer64 ptp_lastAdjust;
62 extern ptp_uinteger64 ptp_meanDelayAtLastAdjust;
63 extern PTP_TimeStamp ptp_lastAdjustTime;
64 
65 /*
66  * ======== Global Functions ========
67  */
68 
69 void ptp_init();
70 void ptp_initEnd();
71 UInt16 ptp_process();
72 UInt16 ptp_processPDelayReq();
73 
74 void ptp_rcvmessage(ptp_octet *pBuf, ptp_uinteger8 portNumber,
75  ptp_uinteger16 size);
76 
77 void ptp_setNetTime(PTP_TimeStamp *time, ptp_uinteger8 clockClass,
78  ptp_clockAccuracy clockAccuracy, ptp_timeSource timeSource);
79 void ptp_setTickTime(ptp_uinteger32 *newTickSize);
80 void ptp_adjNetTime(ptp_integer64 *timeAdjust);
81 
86 #endif /* PTP_H */
PTP clock structure.
Definition: ptp_clock.h:65
UInt16 ptp_process()
PTP process.
Definition: ptp.c:145
unsigned long long ptp_uinteger64
Definition: ptp_types.h:125
void ptp_init()
PTP initialization.
Definition: ptp.c:95
void ptp_initEnd()
PTP initialization completion.
Definition: ptp.c:128
long long ptp_integer64
Definition: ptp_types.h:120
unsigned long ptp_uinteger32
Definition: ptp_types.h:110
ptp_timeSource
Definition: ptp_types.h:244
UInt16 ptp_processPDelayReq()
Process PDelayReq.
Definition: ptp.c:241
#define PTP_NUMBERPORTS
Definition: ptp_cfg.h:100
unsigned char ptp_uinteger8
Definition: ptp_types.h:90
ptp_clockAccuracy
Definition: ptp_types.h:170
void ptp_adjNetTime(ptp_integer64 *timeAdjust)
Adjust net time.
Definition: ptp.c:363
void ptp_setNetTime(PTP_TimeStamp *time, ptp_uinteger8 clockClass, ptp_clockAccuracy clockAccuracy, ptp_timeSource timeSource)
Set net time.
Definition: ptp.c:328
char ptp_octet
Definition: ptp_types.h:137
void ptp_rcvmessage(ptp_octet *pBuf, ptp_uinteger8 portNumber, ptp_uinteger16 size)
Receive message.
Definition: ptp.c:257
void ptp_setTickTime(ptp_uinteger32 *newTickSize)
Set tick time.
Definition: ptp.c:349
PTP data types specifications.
PTP clock object for synchronization.
unsigned short ptp_uinteger16
Definition: ptp_types.h:100