Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
ptp_time.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
13#ifndef ZEPHYR_INCLUDE_NET_PTP_TIME_H_
14#define ZEPHYR_INCLUDE_NET_PTP_TIME_H_
15
23#include <net/net_core.h>
24#include <toolchain.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
41 union {
42 struct {
43#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
47#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
51#else
52#error "Unknown byte order"
53#endif
54 } _sec;
56 };
57
60};
61
62#ifdef __cplusplus
63}
64#endif
65
78 union {
79 struct {
80#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
84#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
88#else
89#error "Unknown byte order"
90#endif
91 } _sec;
93 };
94
96 union {
97 struct {
98#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
102#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
106#else
107#error "Unknown byte order"
108#endif
109 } _fns;
111 };
112} __packed;
113
118#endif /* ZEPHYR_INCLUDE_NET_PTP_TIME_H_ */
Network core definitions.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT64_TYPE__ uint64_t
Definition: stdint.h:61
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Precision Time Protocol Extended Timestamp format.
Definition: ptp_time.h:76
uint16_t unused
Definition: ptp_time.h:83
uint16_t high
Definition: ptp_time.h:82
uint64_t fract_nsecond
Definition: ptp_time.h:110
uint64_t second
Definition: ptp_time.h:92
uint32_t low
Definition: ptp_time.h:81
Precision Time Protocol Timestamp format.
Definition: ptp_time.h:39
uint16_t high
Definition: ptp_time.h:45
uint32_t nanosecond
Definition: ptp_time.h:59
uint64_t second
Definition: ptp_time.h:55
uint16_t unused
Definition: ptp_time.h:46
uint32_t low
Definition: ptp_time.h:44
Macros to abstract toolchain specific capabilities.