srsLTE/lib/include/srslte/phy/phch/regs.h

140 lines
4.8 KiB
C
Raw Normal View History

2019-04-26 12:27:38 -07:00
/*
* Copyright 2013-2019 Software Radio Systems Limited
2014-03-27 09:31:25 -07:00
*
2019-04-26 12:27:38 -07:00
* This file is part of srsLTE.
2014-03-27 09:31:25 -07:00
*
* srsLTE is free software: you can redistribute it and/or modify
2015-05-08 08:05:40 -07:00
* it under the terms of the GNU Affero General Public License as
2014-03-27 09:31:25 -07:00
* published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* srsLTE is distributed in the hope that it will be useful,
2014-03-27 09:31:25 -07:00
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2015-05-08 08:05:40 -07:00
* GNU Affero General Public License for more details.
2014-03-27 09:31:25 -07:00
*
2015-05-08 08:05:40 -07:00
* A copy of the GNU Affero General Public License can be found in
2014-03-27 09:31:25 -07:00
* the LICENSE file in the top-level directory of this distribution
* and at http://www.gnu.org/licenses/.
*
*/
/******************************************************************************
* File: regs.h
*
* Description: Resource element mapping functions.
*
* Reference: 3GPP TS 36.211 version 10.0.0 Release 10
*****************************************************************************/
2014-03-27 09:31:25 -07:00
2018-03-31 10:04:04 -07:00
#ifndef SRSLTE_REGS_H
#define SRSLTE_REGS_H
2014-03-27 09:31:25 -07:00
#include <stdbool.h>
#include "srslte/config.h"
2017-05-18 00:48:24 -07:00
#include "srslte/phy/common/phy_common.h"
2014-03-27 09:31:25 -07:00
2014-06-17 02:11:41 -07:00
#define REGS_PHICH_NSYM 12
#define REGS_PHICH_REGS_X_GROUP 3
2014-03-27 09:31:25 -07:00
2014-06-17 02:11:41 -07:00
#define REGS_PCFICH_NSYM 16
#define REGS_PCFICH_NREGS 4
2014-03-27 09:31:25 -07:00
2014-06-17 02:11:41 -07:00
#define REGS_RE_X_REG 4
2014-03-27 09:31:25 -07:00
typedef struct SRSLTE_API {
uint32_t k[4];
uint32_t k0;
uint32_t l;
2014-06-17 02:11:41 -07:00
bool assigned;
2015-03-18 11:14:24 -07:00
}srslte_regs_reg_t;
2014-03-27 09:31:25 -07:00
typedef struct SRSLTE_API {
uint32_t nof_regs;
2015-03-18 11:14:24 -07:00
srslte_regs_reg_t **regs;
}srslte_regs_ch_t;
2014-03-27 09:31:25 -07:00
typedef struct SRSLTE_API {
2015-03-18 05:41:50 -07:00
srslte_cell_t cell;
uint32_t max_ctrl_symbols;
uint32_t ngroups_phich;
2019-04-23 01:53:11 -07:00
srslte_phich_r_t phich_res;
2015-03-18 05:59:29 -07:00
srslte_phich_length_t phich_len;
2015-03-18 11:14:24 -07:00
srslte_regs_ch_t pcfich;
srslte_regs_ch_t *phich; // there are several phich
srslte_regs_ch_t pdcch[3]; /* PDCCH indexing, permutation and interleaving is computed for
2014-06-17 02:11:41 -07:00
the three possible CFI value */
2019-04-23 01:53:11 -07:00
uint32_t phich_mi;
uint32_t nof_regs;
2015-03-18 11:14:24 -07:00
srslte_regs_reg_t *regs;
}srslte_regs_t;
2014-03-27 09:31:25 -07:00
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_regs_init(srslte_regs_t *h,
srslte_cell_t cell);
2019-04-23 01:53:11 -07:00
SRSLTE_API int srslte_regs_init_opts(srslte_regs_t* h, srslte_cell_t cell, uint32_t phich_mi, bool mbsfn_or_sf1_6_tdd);
2019-04-23 01:53:11 -07:00
SRSLTE_API void srslte_regs_free(srslte_regs_t* h);
SRSLTE_API int srslte_regs_pdcch_nregs(srslte_regs_t *h,
uint32_t cfi);
SRSLTE_API int srslte_regs_pdcch_ncce(srslte_regs_t *h,
uint32_t cfi);
SRSLTE_API int srslte_regs_pcfich_put(srslte_regs_t *h,
cf_t symbols[REGS_PCFICH_NSYM],
cf_t *slot_symbols);
2015-03-18 11:14:24 -07:00
SRSLTE_API int srslte_regs_pcfich_get(srslte_regs_t *h,
cf_t *slot_symbols,
2015-03-18 11:14:24 -07:00
cf_t symbols[REGS_PCFICH_NSYM]);
2014-03-27 09:31:25 -07:00
2015-03-18 11:14:24 -07:00
SRSLTE_API uint32_t srslte_regs_phich_nregs(srslte_regs_t *h);
2019-04-23 01:53:11 -07:00
SRSLTE_API int srslte_regs_phich_add(srslte_regs_t *h,
cf_t symbols[REGS_PHICH_NSYM],
2015-03-18 11:14:24 -07:00
uint32_t ngroup,
cf_t *slot_symbols);
2014-03-27 09:31:25 -07:00
SRSLTE_API int srslte_regs_phich_get(srslte_regs_t *h,
cf_t *slot_symbols,
2015-03-18 11:14:24 -07:00
cf_t symbols[REGS_PHICH_NSYM],
uint32_t ngroup);
2014-03-27 09:31:25 -07:00
2015-03-18 11:14:24 -07:00
SRSLTE_API uint32_t srslte_regs_phich_ngroups(srslte_regs_t *h);
SRSLTE_API int srslte_regs_phich_reset(srslte_regs_t *h,
cf_t *slot_symbols);
2014-03-27 09:31:25 -07:00
SRSLTE_API int srslte_regs_pdcch_put(srslte_regs_t *h,
uint32_t cfi,
cf_t *d,
2015-03-18 11:14:24 -07:00
cf_t *slot_symbols);
SRSLTE_API int srslte_regs_pdcch_put_offset(srslte_regs_t *h,
uint32_t cfi,
cf_t *d,
cf_t *slot_symbols,
uint32_t start_reg,
uint32_t nof_regs);
SRSLTE_API int srslte_regs_pdcch_get(srslte_regs_t *h,
uint32_t cfi,
cf_t *slot_symbols,
2015-03-18 11:14:24 -07:00
cf_t *d);
SRSLTE_API int srslte_regs_pdcch_get_offset(srslte_regs_t *h,
uint32_t cfi,
cf_t *slot_symbols,
2015-03-18 11:14:24 -07:00
cf_t *d,
uint32_t start_reg,
uint32_t nof_regs);
2018-03-31 10:04:04 -07:00
#endif // SRSLTE_REGS_H