123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- #ifndef ZEPHYR_INCLUDE_NET_PTP_TIME_H_
- #define ZEPHYR_INCLUDE_NET_PTP_TIME_H_
- #include <net/net_core.h>
- #include <toolchain.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- struct net_ptp_time {
-
- union {
- struct {
- #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- uint32_t low;
- uint16_t high;
- uint16_t unused;
- #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- uint16_t unused;
- uint16_t high;
- uint32_t low;
- #else
- #error "Unknown byte order"
- #endif
- } _sec;
- uint64_t second;
- };
-
- uint32_t nanosecond;
- };
- #ifdef __cplusplus
- }
- #endif
- struct net_ptp_extended_time {
-
- union {
- struct {
- #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- uint32_t low;
- uint16_t high;
- uint16_t unused;
- #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- uint16_t unused;
- uint16_t high;
- uint32_t low;
- #else
- #error "Unknown byte order"
- #endif
- } _sec;
- uint64_t second;
- };
-
- union {
- struct {
- #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
- uint32_t low;
- uint16_t high;
- uint16_t unused;
- #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
- uint16_t unused;
- uint16_t high;
- uint32_t low;
- #else
- #error "Unknown byte order"
- #endif
- } _fns;
- uint64_t fract_nsecond;
- };
- } __packed;
- #endif
|