PDK API Guide for AM65xx
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  int32_t drift;
76 
78  uint32_t syncInterval;
79 
81  volatile bool setClockOngoing;
82 
86 
90 typedef struct IcssgTimeSync_Obj_s *IcssgTimeSync_Handle;
91 
92 /* ========================================================================== */
93 /* Global Variables Declarations */
94 /* ========================================================================== */
95 
96 /* None */
97 
98 /* ========================================================================== */
99 /* Function Declarations */
100 /* ========================================================================== */
101 
107 void IcssgTimeSync_initCfg(IcssgTimeSync_Cfg *timeSyncCfg);
108 
125  Enet_Type enetType,
126  uint32_t instId,
127  const void *cfg,
128  uint32_t cfgSize);
129 
142  Enet_Type enetType,
143  uint32_t instId);
144 
157  uint32_t cmd,
158  Enet_IoctlPrms *prms);
159 
166 
167 /* ========================================================================== */
168 /* Deprecated Function Declarations */
169 /* ========================================================================== */
170 
171 /* None */
172 
173 /* ========================================================================== */
174 /* Static Function Definitions */
175 /* ========================================================================== */
176 
177 /* None */
178 
179 #ifdef __cplusplus
180 }
181 #endif
182 
183 #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:78
Ethernet Module object.
Definition: enet_mod.h:136
struct IcssgTimeSync_Obj_s * IcssgTimeSync_Handle
ICSSG TimeSync handle.
Definition: icssg_timesync_priv.h:90
IcssgTimeSync_ClkType clkType
Definition: icssg_timesync_priv.h:84
void IcssgTimeSync_initCfg(IcssgTimeSync_Cfg *timeSyncCfg)
Initialize TimeSync configuration parameters.
int32_t drift
Definition: icssg_timesync_priv.h:75
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:229
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:81
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.
EnetMod_Obj enetMod
Definition: icssg_timesync_priv.h:72