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