sbgEComBinaryLogUtc.h
Go to the documentation of this file.
1 
20 #ifndef __SBG_ECOM_BINARY_LOG_UTC_H__
21 #define __SBG_ECOM_BINARY_LOG_UTC_H__
22 
23 #include <sbgCommon.h>
25 
26 //----------------------------------------------------------------------//
27 //- Clock status definitions -//
28 //----------------------------------------------------------------------//
29 
33 #define SBG_ECOM_CLOCK_STATUS_SHIFT (1u)
34 #define SBG_ECOM_CLOCK_STATUS_MASK (0x000Fu)
35 #define SBG_ECOM_CLOCK_UTC_STATUS_SHIFT (6u)
36 #define SBG_ECOM_CLOCK_UTC_STATUS_MASK (0x000Fu)
41 #define SBG_ECOM_CLOCK_STABLE_INPUT (0x0001u << 0)
42 #define SBG_ECOM_CLOCK_UTC_SYNC (0x0001u << 5)
47 typedef enum _SbgEComClockStatus
48 {
54 
59 {
64 
65 //----------------------------------------------------------------------//
66 //- Clock status helpers methods -//
67 //----------------------------------------------------------------------//
68 
75 {
77 }
78 
85 {
87 }
88 
96 SBG_INLINE uint16_t sbgEComLogUtcBuildClockStatus(SbgEComClockStatus clockStatus, SbgEComClockUtcStatus utcStatus, uint16_t masks)
97 {
98  //
99  // Create the combined status field
100  //
101  return ((((uint16_t)clockStatus)&SBG_ECOM_CLOCK_STATUS_MASK) << SBG_ECOM_CLOCK_STATUS_SHIFT) |
102  ((((uint16_t)utcStatus)&SBG_ECOM_CLOCK_UTC_STATUS_MASK) << SBG_ECOM_CLOCK_UTC_STATUS_SHIFT) | masks;
103 }
104 
105 //----------------------------------------------------------------------//
106 //- Log structure definitions -//
107 //----------------------------------------------------------------------//
108 
112 typedef struct _SbgLogUtcData
113 {
114  uint32_t timeStamp;
115  uint16_t status;
116  uint16_t year;
117  int8_t month;
118  int8_t day;
119  int8_t hour;
120  int8_t minute;
121  int8_t second;
122  int32_t nanoSecond;
123  uint32_t gpsTimeOfWeek;
124 } SbgLogUtcData;
125 
126 //----------------------------------------------------------------------//
127 //- Operations -//
128 //----------------------------------------------------------------------//
129 
137 
145 
146 #endif
enum _SbgEComClockStatus SbgEComClockStatus
#define SBG_ECOM_CLOCK_UTC_STATUS_MASK
#define SBG_ECOM_CLOCK_STATUS_MASK
SBG_INLINE uint16_t sbgEComLogUtcBuildClockStatus(SbgEComClockStatus clockStatus, SbgEComClockUtcStatus utcStatus, uint16_t masks)
Used to read/write data from/to a memory buffer stream.
#define SBG_ECOM_CLOCK_STATUS_SHIFT
SBG_INLINE SbgEComClockStatus sbgEComLogUtcGetClockStatus(uint16_t status)
_SbgEComClockUtcStatus
struct _SbgLogUtcData SbgLogUtcData
enum _SbgEComClockUtcStatus SbgEComClockUtcStatus
SBG_INLINE SbgEComClockUtcStatus sbgEComLogUtcGetClockUtcStatus(uint16_t status)
#define SBG_INLINE
Definition: sbgDefines.h:186
Main header file for SBG Systems common C library.
SbgErrorCode sbgEComBinaryLogWriteUtcData(SbgStreamBuffer *pOutputStream, const SbgLogUtcData *pInputData)
SbgErrorCode sbgEComBinaryLogParseUtcData(SbgStreamBuffer *pInputStream, SbgLogUtcData *pOutputData)
#define SBG_ECOM_CLOCK_UTC_STATUS_SHIFT
enum _SbgErrorCode SbgErrorCode


sbg_driver
Author(s): SBG Systems
autogenerated on Sat Sep 3 2022 02:53:35