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=d44b5e0b2b6509ed60128d5bc3090531bdff9835;hp=0000000000000000000000000000000000000000;hb=4745e5c88ba931c6d71cb6d8c681f76cf364eac5;hpb=59f84608ec15c016958a6e0e0ddd813f376c0925 diff --git a/fhi_lib/lib/api/xran_timer.h b/fhi_lib/lib/api/xran_timer.h new file mode 100644 index 0000000..d44b5e0 --- /dev/null +++ b/fhi_lib/lib/api/xran_timer.h @@ -0,0 +1,47 @@ +/****************************************************************************** +* +* Copyright (c) 2019 Intel. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*******************************************************************************/ + + +/** + * @brief This file provides interface to Timing for XRAN. + * + * @file xran_timer.h + * @ingroup group_lte_source_xran + * @author Intel Corporation + * + **/ + +#ifndef _XRAN_TIMER_H +#define _XRAN_TIMER_H +#include +#include +#include +#include + +#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) +#define XranDecrementSymIdx(sym_idx, numSymPerMs) (((uint32_t)sym_idx == 0) ? (((uint32_t)numSymPerMs * MSEC_PER_SEC)) - 1) : (uint32_t)sym_idx-1) + +long poll_next_tick(long interval_ns); +long sleep_next_tick(long interval); +int timing_set_debug_stop(int value); +int timing_get_debug_stop(void); +inline uint64_t timing_get_current_second(void); + +#endif