AM64x MCU+ SDK  11.01.00
icss_timeSync_utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef ICSS_TIMESYNC_UTILS_H_
34 #define ICSS_TIMESYNC_UTILS_H_
35 
36 /* ========================================================================== */
37 /* Include Files */
38 /* ========================================================================== */
39 #include <stdint.h>
40 #include "icss_timeSyncApi.h"
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /* ========================================================================== */
47 /* Macros & Typedefs */
48 /* ========================================================================== */
49 
50 
51 
52 /* ========================================================================== */
53 /* Function Declarations */
54 /* ========================================================================== */
55 
66 void TimeSync_addWord(uint8_t *src, uint32_t word);
67 
73 void TimeSync_addHalfWord(volatile uint8_t *src, uint16_t halfWord);
74 
81 uint32_t TimeSync_calcChecksum(uint8_t *packet, uint16_t len);
82 
87 void TimeSync_calcIPChecksum(uint8_t *packet);
88 
100 void TimeSync_convEndianess(volatile void *src, volatile void *dst, uint8_t numBytes);
101 
111 void TimeSync_convEnd6to8(volatile void *src, void *dst);
112 
119 
127 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* #ifndef ICSS_TIMESYNC_UTILS_H_ */
compensationType
compensationType
Compensation Type Required - depending on PTP timeTransmitter or timeReceiver.
Definition: icss_timeSyncApi.h:244
TimeSync_addHalfWord
void TimeSync_addHalfWord(volatile uint8_t *src, uint16_t halfWord)
Add a half word to the packet stream.
TimeSync_prepareIEPCfgCommand
uint32_t TimeSync_prepareIEPCfgCommand(TimeSync_ParamsHandle_t timeSyncHandle, compensationType compType)
Returns a prepared command for the IEP Global CFG Register.
TimeSync_convEndianess
void TimeSync_convEndianess(volatile void *src, volatile void *dst, uint8_t numBytes)
Convert specified number of bytes in source from big endian bytes to little endian and vice versa....
TimeSync_addWord
void TimeSync_addWord(uint8_t *src, uint32_t word)
Add a word to the packet stream.
TimeSync_convEnd6to8
void TimeSync_convEnd6to8(volatile void *src, void *dst)
Takes in a 6 byte reverse byte endian source and puts it in an 64 bit double word with correct endian...
TimeSync_calcIPChecksum
void TimeSync_calcIPChecksum(uint8_t *packet)
Compute checksum for IP Header and modify in place.
TimeSync_calcChecksum
uint32_t TimeSync_calcChecksum(uint8_t *packet, uint16_t len)
Compute checksum used in IP/UDP packets for a given stream.
TimeSync_getIEPCountValue
uint32_t TimeSync_getIEPCountValue(TimeSync_ParamsHandle_t timeSyncHandle)
Returns the IEP Count value based on the IEP Clock Frequency.
icss_timeSyncApi.h
TimeSync_ParamsHandle_t
struct TimeSync_ParamsHandle_s * TimeSync_ParamsHandle_t
Definition: icss_timeSyncApi.h:985