PDK API Guide for J721E
icssg_timesync_priv.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2021
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 
40 #ifndef ICSSG_TIMESYNC_PRIV_H_
41 #define ICSSG_TIMESYNC_PRIV_H_
42 
43 /* ========================================================================== */
44 /* Include Files */
45 /* ========================================================================== */
46 
47 #include <stdint.h>
48 #include <stdbool.h>
49 
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /* ========================================================================== */
57 /* Macros */
58 /* ========================================================================== */
59 
60 /* None */
61 
62 /* ========================================================================== */
63 /* Structures and Enums */
64 /* ========================================================================== */
65 
69 typedef struct IcssgTimeSync_Obj_s
70 {
73 
75  void* hIcssg;
76 
78  int32_t drift;
79 
81  uint32_t syncInterval;
82 
84  volatile bool setClockOngoing;
85 
89 
93 typedef struct IcssgTimeSync_Obj_s *IcssgTimeSync_Handle;
94 
95 /* ========================================================================== */
96 /* Global Variables Declarations */
97 /* ========================================================================== */
98 
99 /* None */
100 
101 /* ========================================================================== */
102 /* Function Declarations */
103 /* ========================================================================== */
104 
110 void IcssgTimeSync_initCfg(IcssgTimeSync_Cfg *timeSyncCfg);
111 
128  Enet_Type enetType,
129  uint32_t instId,
130  const void *cfg,
131  uint32_t cfgSize);
132 
145  Enet_Type enetType,
146  uint32_t instId);
147 
160  uint32_t cmd,
161  Enet_IoctlPrms *prms);
162 
169 
170 /* ========================================================================== */
171 /* Deprecated Function Declarations */
172 /* ========================================================================== */
173 
174 /* None */
175 
176 /* ========================================================================== */
177 /* Static Function Definitions */
178 /* ========================================================================== */
179 
180 /* None */
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 #endif /* ICSSG_TIMESYNC_PRIV_H_ */
Enet_Type
Ethernet peripheral type.
Definition: enet_types.h:195
TimeSync configuration parameters.
Definition: icssg_timesync.h:92
IcssgTimeSync_ClkType
ICSSG TimeSync clock types.
Definition: icssg_timesync.h:77
uint32_t syncInterval
Definition: icssg_timesync_priv.h:81
Ethernet Module object.
Definition: enet_mod.h:136
struct IcssgTimeSync_Obj_s * IcssgTimeSync_Handle
ICSSG TimeSync handle.
Definition: icssg_timesync_priv.h:93
IcssgTimeSync_ClkType clkType
Definition: icssg_timesync_priv.h:87
void IcssgTimeSync_initCfg(IcssgTimeSync_Cfg *timeSyncCfg)
Initialize TimeSync configuration parameters.
int32_t drift
Definition: icssg_timesync_priv.h:78
int32_t IcssgTimeSync_rejoin(EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
Rejoin a running TimeSync module.
void IcssgTimeSync_close(EnetMod_Handle hMod)
Close ICSSG TimeSync module.
Enet IOCTL param.
Definition: enet_ioctl.h:232
int32_t IcssgTimeSync_open(EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
Open and initialize TimeSync module.
ICSSG TimeSync object.
Definition: icssg_timesync_priv.h:69
volatile bool setClockOngoing
Definition: icssg_timesync_priv.h:84
struct EnetMod_Obj_s * EnetMod_Handle
Ethernet Module handle.
Definition: enet_mod.h:71
This file contains the type definitions and helper macros for ICSSG TimeSync.
int32_t IcssgTimeSync_ioctl(EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
Run an IOCTL operation on the TimeSync module.
void * hIcssg
Definition: icssg_timesync_priv.h:75
EnetMod_Obj enetMod
Definition: icssg_timesync_priv.h:72