Front Haul Interface Library update to third seed code contribution
[o-du/phy.git] / fhi_lib / lib / src / xran_frame_struct.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2019 Intel.
4 *
5 *   Licensed under the Apache License, Version 2.0 (the "License");
6 *   you may not use this file except in compliance with the License.
7 *   You may obtain a copy of the License at
8 *
9 *       http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *   Unless required by applicable law or agreed to in writing, software
12 *   distributed under the License is distributed on an "AS IS" BASIS,
13 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *   See the License for the specific language governing permissions and
15 *   limitations under the License.
16 *
17 *******************************************************************************/
18
19
20 /**
21  * @brief Header file for function to work with 5G NR frame structure and related
22  *        routines
23  * @file xran_frame_struct.h
24  * @ingroup group_source_xran
25  * @author Intel Corporation
26  **/
27
28 #ifndef _XRAN_FRAME_STRUCT_
29 #define _XRAN_FRAME_STRUCT_
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35
36 #include "xran_fh_o_du.h"
37
38 uint32_t xran_fs_get_tti_interval(uint8_t nMu);
39 uint32_t xran_fs_get_scs(uint8_t nMu);
40
41 //-------------------------------------------------------------------------------------------
42 /** @ingroup group_nr5g_source_phy_common
43  *
44  *  @param[in]   nNumerology - Numerology determine sub carrier spacing, Value: 0->4 0: 15khz,  1: 30khz,  2: 60khz 3: 120khz, 4: 240khz
45  *  @param[in]   nBandwidth - Carrier bandwidth for in MHz. Value: 5->400
46  *  @param[in]   nAbsFrePointA - Abs Freq Point A of the Carrier Center Frequency for in KHz Value: 450000->52600000
47  *
48  *  @return  Number of RBs in cell
49  *
50  *  @description
51  *  Returns number of RBs based on 38.101-1 and 38.101-2 for the cell
52  *
53 **/
54 //-------------------------------------------------------------------------------------------
55 uint16_t xran_fs_get_num_rbs(uint32_t nNumerology, uint32_t nBandwidth, uint32_t nAbsFrePointA);
56
57 //-------------------------------------------------------------------------------------------
58 /** @ingroup phy_cal_nrarfcn
59  *
60  *  @param[in]   center frequency
61  *
62  *  @return  NR-ARFCN
63  *
64  *  @description
65  *  This calculates NR-ARFCN value according to center frequency
66  *
67 **/
68 //-------------------------------------------------------------------------------------------
69 uint32_t xran_fs_cal_nrarfcn(uint32_t nCenterFreq);
70 int32_t xran_fs_slot_limit(int32_t nSlotIdx);
71 void xran_fs_clear_slot_type(uint32_t nCcId);
72 int32_t xran_fs_set_slot_type(uint32_t nCcId, uint32_t nFrameDuplexType, uint32_t nTddPeriod, struct xran_slot_config* psSlotConfig);
73 int32_t xran_fs_get_slot_type(int32_t nCcId, int32_t nSlotIdx, int32_t nType);
74 uint32_t xran_fs_slot_limit_init(int32_t tti_interval_us);
75 uint32_t xran_fs_get_max_slot(void);
76 uint32_t xran_fs_get_max_slot_SFN(void);
77 int32_t xran_fs_get_symbol_type(int32_t nCellIdx, int32_t nSlotdx,  int32_t nSymbIdx);
78
79 #ifdef __cplusplus
80 }
81 #endif
82
83 #endif /* _XRAN_FRAME_STRUCT_ */
84