X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=o-du%2Fphy.git;a=blobdiff_plain;f=fhi_lib%2Flib%2Fapi%2Fxran_timer.h;fp=fhi_lib%2Flib%2Fapi%2Fxran_timer.h;h=a7e933001a76b2cefae76e0f000dd24527949ae6;hp=b2cdfd8880daeafeef52db164e5ce3718092406a;hb=2de97529a4c5a1922214ba0e6f0fb84cacbd0bc7;hpb=81a09690b36b3a4e89b4dae34f30933de13f7f90 diff --git a/fhi_lib/lib/api/xran_timer.h b/fhi_lib/lib/api/xran_timer.h index b2cdfd8..a7e9330 100644 --- a/fhi_lib/lib/api/xran_timer.h +++ b/fhi_lib/lib/api/xran_timer.h @@ -1,6 +1,6 @@ /****************************************************************************** * -* Copyright (c) 2019 Intel. +* Copyright (c) 2020 Intel. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,6 +37,19 @@ extern "C" { #include #include +/* Difference between Unix seconds to GPS seconds + GPS epoch: 1980.1.6 00:00:00 (UTC); Unix time epoch: 1970:1.1 00:00:00 UTC + Value is calculated on Sep.6 2019. Need to be change if International + Earth Rotation and Reference Systems Service (IERS) adds more leap seconds + 1970:1.1 - 1980.1.6: 3657 days + 3657*24*3600=315 964 800 seconds (unix seconds value at 1980.1.6 00:00:00 (UTC)) + There are 18 leap seconds inserted after 1980.1.6 00:00:00 (UTC), which means + GPS is 18 larger. 315 964 800 - 18 = 315 964 782 +*/ +#define UNIX_TO_GPS_SECONDS_OFFSET 315964782UL +#define NUM_OF_FRAMES_PER_SFN_PERIOD 1024 +#define NUM_OF_FRAMES_PER_SECOND 100 + #define MSEC_PER_SEC 1000L #define XranIncrementSymIdx(sym_idx, numSymPerMs) (((uint32_t)sym_idx >= (((uint32_t)numSymPerMs * MSEC_PER_SEC) - 1)) ? 0 : (uint32_t)sym_idx+1) @@ -49,7 +62,9 @@ long sleep_next_tick(long interval); int timing_set_debug_stop(int value, int count); int timing_get_debug_stop(void); inline uint64_t timing_get_current_second(void); +uint8_t timing_get_numerology(void); int timing_set_numerology(uint8_t value); +uint32_t xran_max_ota_sym_idx(uint8_t numerlogy); #ifdef __cplusplus }