This file handles the front-end configuration.
Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "pal.h"
#include "return_val.h"
#include "tal.h"
#include "tal_config.h"
#include "ieee_const.h"
#include "tal_internal.h"
#include "ieee_154g.h"
#include "tal_fe_fsk_params.h"
Macros | |
#define | AGC_SETTLE_TABLE |
#define | AGC_SETTLE_TABLE_COL_SIZE 9 |
#define | AGC_SETTLE_TABLE_ROW_SIZE 8 |
#define | AGC_SETTLE_TABLE_TABLE_DATA_TYPE uint8_t |
#define | bb_bit_read(reg) trx_bit_read(reg) |
#define | bb_bit_write(reg, val) trx_bit_write(reg, val) |
#define | bb_blk_write(reg, addr, len) trx_write(reg, addr, len) |
#define | bb_reg_read(reg) trx_reg_read(reg) |
#define | rf_bit_write(reg, val) trx_bit_write(reg, val) |
#define | rf_blk_write(reg, addr, len) trx_write(reg, addr, len) |
#define | rf_reg_write(reg, val) trx_reg_write(reg, val) |
Functions | |
FLASH_DECLARE (AGC_SETTLE_TABLE_TABLE_DATA_TYPE agc_settle[AGC_SETTLE_TABLE_ROW_SIZE][AGC_SETTLE_TABLE_COL_SIZE]) | |
FLASH_DECLARE (uint8_t fsk_params_tbl[48][11]) | |
FLASH_DECLARE (uint8_t fsk_pe_tbl[3 *6]) | |
retval_t | fsk_rfcfg (fsk_mod_type_t mod_type, fsk_sym_rate_t srate, mod_idx_t mod_idx, trx_id_t trx_id) |
Configures RF according FSK. More... | |
static uint16_t | get_agc_settling_period (uint8_t sr, uint8_t avgs, uint8_t agci) |
Gets the AGC settling period. More... | |
retval_t | ofdm_rfcfg (ofdm_option_t ofdm_opt, trx_id_t trx_id) |
Configures RF according MR-OFDM. More... | |
retval_t | oqpsk_rfcfg (oqpsk_chip_rate_t chip_rate, trx_id_t trx_id) |
Configures RF according MR-OQPSK. More... | |
#define AGC_SETTLE_TABLE |
#define AGC_SETTLE_TABLE_COL_SIZE 9 |
#define AGC_SETTLE_TABLE_ROW_SIZE 8 |
Referenced by get_agc_settling_period().
#define AGC_SETTLE_TABLE_TABLE_DATA_TYPE uint8_t |
#define bb_bit_read | ( | reg | ) | trx_bit_read(reg) |
Referenced by ofdm_rfcfg().
#define bb_bit_write | ( | reg, | |
val | |||
) | trx_bit_write(reg, val) |
Referenced by ofdm_rfcfg(), and oqpsk_rfcfg().
Referenced by fsk_rfcfg().
#define bb_reg_read | ( | reg | ) | trx_reg_read(reg) |
#define rf_bit_write | ( | reg, | |
val | |||
) | trx_bit_write(reg, val) |
Referenced by fsk_rfcfg(), ofdm_rfcfg(), and oqpsk_rfcfg().
#define rf_reg_write | ( | reg, | |
val | |||
) | trx_reg_write(reg, val) |
FLASH_DECLARE | ( | AGC_SETTLE_TABLE_TABLE_DATA_TYPE | agc_settle[AGC_SETTLE_TABLE_ROW_SIZE][AGC_SETTLE_TABLE_COL_SIZE] | ) |
FLASH_DECLARE | ( | uint8_t | fsk_params_tbl[48][11] | ) |
FLASH_DECLARE | ( | uint8_t | fsk_pe_tbl[3 *6] | ) |
retval_t fsk_rfcfg | ( | fsk_mod_type_t | mod_type, |
fsk_sym_rate_t | srate, | ||
mod_idx_t | mod_idx, | ||
trx_id_t | trx_id | ||
) |
Configures RF according FSK.
mod_type | Modulation order / type; i.e. F2FSK or F4FSK |
srate | Symbol rate |
mod_idx | Modulation index |
trx_id | Transceiver identifier |
References AGCC_AGCI_MASK, AGCC_AGCI_SHIFT, AGCC_AVGS_MASK, AGCC_AVGS_SHIFT, bb_blk_write, DEFAULT_TX_PWR_REG, FSKDM_EN_SHIFT, FSKDM_PE_SHIFT, get_agc_settling_period(), MAC_SUCCESS, PAC_PACUR_SHIFT, PAC_TXPWR_SHIFT, PGM_READ_BLOCK, PGM_READ_BYTE, RF09, RF_BASE_ADDR_OFFSET, rf_blk_write, RG_BBC0_FSKDM, RG_RF09_AGCC, RG_RF09_PAC, RG_RF09_RXBWC, RG_RF09_TXCUTC, RXDFE_SR_MASK, status, tal_pib, temp, trx_reg_write(), and TXDFE_DM_SHIFT.
Referenced by conf_fsk().
|
static |
Gets the AGC settling period.
sr | Sample rate |
avgs | AGC average time in number of samples |
agci | AGC input |
References AGC_SETTLE_TABLE_ROW_SIZE, and PGM_READ_BYTE.
Referenced by fsk_rfcfg(), ofdm_rfcfg(), and oqpsk_rfcfg().
retval_t ofdm_rfcfg | ( | ofdm_option_t | ofdm_opt, |
trx_id_t | trx_id | ||
) |
Configures RF according MR-OFDM.
trx_id | Transceiver identifier |
ofdm_opt | OFDM option |
References AGCC_AGCI_SHIFT, AGCC_AVGS_SHIFT, AGCS_GCW_SHIFT, AGCS_TGT_SHIFT, bb_bit_read, bb_bit_write, DEFAULT_TX_PWR_REG, FAILURE, get_agc_settling_period(), MAC_SUCCESS, OFDM_OPT_1, OFDM_OPT_2, OFDM_OPT_3, OFDM_OPT_4, PAC_PACUR_SHIFT, PAC_TXPWR_SHIFT, RF09, RF_BASE_ADDR_OFFSET, rf_blk_write, RF_PARAMP32U, RG_RF09_RXBWC, RG_RF09_TXCUTC, RXBWC_BW_SHIFT, RXBWC_IFS_SHIFT, RXDFE_RCUT_SHIFT, RXDFE_SR_SHIFT, SR_BBC0_OFDMC_LFO, SR_BBC0_OFDMPHRRX_SPC, SR_BBC0_OFDMSW_PDT, SR_RF09_TXCUTC_PARAMP, status, tal_pib, trx_bit_write(), TXCUTC_LPFCUT_SHIFT, TXCUTC_PARAMP_SHIFT, TXDFE_RCUT_SHIFT, and TXDFE_SR_SHIFT.
Referenced by conf_ofdm().
retval_t oqpsk_rfcfg | ( | oqpsk_chip_rate_t | chip_rate, |
trx_id_t | trx_id | ||
) |
Configures RF according MR-OQPSK.
trx_id | Transceiver identifier |
chip_rate | OQPSK chip mode |
References AGCC_AGCI_SHIFT, AGCC_AVGS_SHIFT, AGCS_GCW_SHIFT, AGCS_TGT_SHIFT, bb_bit_write, CHIP_RATE_100, CHIP_RATE_1000, CHIP_RATE_200, CHIP_RATE_2000, DEFAULT_TX_PWR_REG, FAILURE, get_agc_settling_period(), MAC_SUCCESS, PAC_PACUR_SHIFT, PAC_TXPWR_SHIFT, RF_BASE_ADDR_OFFSET, rf_blk_write, RF_BW1000KHZ_IF1000KHZ, RF_BW160KHZ_IF250KHZ, RF_BW2000KHZ_IF2000KHZ, RF_BW250KHZ_IF250KHZ, RF_FLC1000KHZ, RF_FLC400KHZ, RF_PARAMP16U, RF_PARAMP32U, RF_PARAMP4U, RG_RF09_RXBWC, RG_RF09_TXCUTC, RXBWC_BW_SHIFT, RXBWC_IFS_SHIFT, RXDFE_RCUT_SHIFT, RXDFE_SR_SHIFT, SR_BBC0_OQPSKC0_DM, SR_RF09_TXCUTC_PARAMP, status, tal_pib, trx_bit_write(), TXCUTC_LPFCUT_SHIFT, TXCUTC_PARAMP_SHIFT, TXDFE_DM_SHIFT, TXDFE_RCUT_SHIFT, and TXDFE_SR_SHIFT.
Referenced by conf_leg_oqpsk(), and conf_oqpsk().