Microchip® Advanced Software Framework

tal_phy_cfg.c File Reference

This file handles the PHY 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_pib.h"
#include "tal_internal.h"
#include "ieee_154g.h"

Functions

static retval_t conf_fsk (trx_id_t trx_id)
 Configures FSK. More...
 
static retval_t conf_leg_oqpsk (trx_id_t trx_id)
 Configures legacy O-QPSK. More...
 
static retval_t conf_ofdm (trx_id_t trx_id)
 Configures MR-OFDM. More...
 
static retval_t conf_oqpsk (trx_id_t trx_id)
 Configures MR-OQPSK. More...
 
retval_t conf_trx_modulation (trx_id_t trx_id)
 Configure the transceiver w.r.t. More...
 
void config_fsk_rpc (trx_id_t trx_id, fsk_sym_rate_t sym_rate)
 Configures reduced power consumption for FSK. More...
 
void set_sfd (trx_id_t trx_id)
 Configures SFDs. More...
 

static retval_t conf_fsk ( trx_id_t  trx_id)
static
static retval_t conf_leg_oqpsk ( trx_id_t  trx_id)
static

Configures legacy O-QPSK.

Parameters
trx_idTransceiver identifier

References BB_MROQPSK, MAC_SUCCESS, oqpsk_rfcfg(), RF_BASE_ADDR_OFFSET, SR_BBC0_OQPSKC0_FCHIP, SR_BBC0_OQPSKC2_RXM, SR_BBC0_OQPSKPHRTX_LEG, SR_BBC0_PC_PT, status, tal_pib, and trx_bit_write().

Referenced by conf_trx_modulation().

static retval_t conf_ofdm ( trx_id_t  trx_id)
static

Configures MR-OFDM.

Parameters
trx_idTransceiver identifier

References BB_MROFDM, MAC_SUCCESS, ofdm_rfcfg(), RF_BASE_ADDR_OFFSET, SR_BBC0_OFDMC_OPT, SR_BBC0_PC_PT, status, tal_pib, and trx_bit_write().

Referenced by conf_trx_modulation().

static retval_t conf_oqpsk ( trx_id_t  trx_id)
static
retval_t conf_trx_modulation ( trx_id_t  trx_id)

Configure the transceiver w.r.t.

modulation

Parameters
trx_idTransceiver identifier
Returns
MAC_SUCCESS if setting could be executed, else MAC_INVALID_PARAMETER

References BB_IRQ_AGCH, BB_IRQ_AGCR, BB_IRQ_RXFS, conf_fsk(), conf_leg_oqpsk(), conf_ofdm(), conf_oqpsk(), DEFAULT_TX_PWR_REG, FSK, LEG_OQPSK, MAC_INVALID_PARAMETER, OFDM, OQPSK, RF_BASE_ADDR_OFFSET, RF_RX, RF_TRXOFF, RF_TXPREP, RG_BBC0_IRQM, RG_RF09_CMD, RG_RF09_STATE, start_rpc(), status, stop_rpc(), switch_to_rx(), switch_to_txprep(), tal_pib, trx_reg_read(), trx_reg_write(), and trx_state.

Referenced by config_phy(), and tal_pib_set().

void config_fsk_rpc ( trx_id_t  trx_id,
fsk_sym_rate_t  sym_rate 
)

Configures reduced power consumption for FSK.

Parameters
trx_idTransceiver identifier
sym_rateSymbol rate

References FSK_SYM_RATE_100, FSK_SYM_RATE_150, FSK_SYM_RATE_200, FSK_SYM_RATE_300, FSK_SYM_RATE_400, FSK_SYM_RATE_50, RF_BASE_ADDR_OFFSET, RG_BBC0_FSKPLL, RG_BBC0_FSKRPC, SR_BBC0_FSKC1_FSKPLH, SR_BBC0_FSKC2_PDTM, SR_BBC0_FSKRPC_EN, tal_pib, trx_bit_write(), and trx_reg_write().

Referenced by conf_fsk(), and tal_pib_set().

void set_sfd ( trx_id_t  trx_id)

Configures SFDs.

Parameters
trx_idTransceiver identifier

References F2FSK_SFD_0_CODED, F2FSK_SFD_0_UNCODED, F2FSK_SFD_1_CODED, F2FSK_SFD_1_UNCODED, RF_BASE_ADDR_OFFSET, RG_BBC0_FSKSFD0L, and tal_pib.

Referenced by conf_fsk(), and tal_pib_set().