Microchip® Advanced Software Framework

tal_rf215.h File Reference

This file contains types and variable definition that are used within the TAL only.

Copyright (c) 2015-2018 Microchip Technology Inc. and its subsidiaries.

#include "tal.h"
#include "tal_config.h"
#include "pal.h"
#include "ieee_154g.h"
#include "at86rf215.h"

Macros

#define BB_BASE_ADDR_OFFSET
 Register offset between the baseband cores. More...
 
#define BB_RX_FRM_BUF_OFFSET   (RG_BBC1_FBRXS - RG_BBC0_FBRXS)
 Register offset between the Rx frame buffers. More...
 
#define BB_TX_FRM_BUF_OFFSET   (RG_BBC1_FBTXS - RG_BBC0_FBTXS)
 Register offset between the Tx frame buffers. More...
 
#define RF_BASE_ADDR_OFFSET
 Register offset between RF09 and TRX24. More...
 
#define RFT_TST_ADDR_OFFSET   (0x280 - 0x180)
 Register offset for test register area. More...
 
#define TAL_BB_IRQ_ADD(BB_CORE, IRQ)   tal_bb_irqs[BB_CORE] |= IRQ
 Add interrupt(s) for provided baseband core. More...
 
#define TAL_BB_IRQ_CLR(BB_CORE, IRQ)
 Clear interrupt(s) for provided baseband core, avoid Pa091. More...
 
#define TAL_BB_IRQ_CLR_ALL(BB_CORE)   tal_bb_irqs[BB_CORE] = BB_IRQ_NO_IRQ
 Clear all interrupts for provided baseband core. More...
 
#define TAL_BB_IS_IRQ_SET(BB_CORE, IRQ)   ((tal_bb_irqs[BB_CORE] & IRQ) ? 1 : 0)
 Check if certain IRQ is set for provided baseband core. More...
 
#define TAL_RF_IRQ_ADD(RF_CORE, IRQ)   tal_rf_irqs[RF_CORE] |= IRQ
 Add interrupt(s) for provided radio core. More...
 
#define TAL_RF_IRQ_CLR(RF_CORE, IRQ)
 Clear interrupt(s) for provided radio core, avoid Pa091. More...
 
#define TAL_RF_IRQ_CLR_ALL(RF_CORE)   tal_rf_irqs[RF_CORE] = RF_IRQ_NO_IRQ
 Clear all interrupts for provided radio core. More...
 
#define TAL_RF_IS_IRQ_SET(RF_CORE, IRQ)   ((tal_rf_irqs[RF_CORE] & IRQ) ? 1 : 0)
 Check if certain IRQ is set for provided radio core. More...
 
#define TRX_SUPPORTED_CHANNELS_LEG(trx)
 
#define TX_PWR_TOLERANCE   (0x80)
 

Typedefs

typedef enum trx_id_tag trx_id_t
 Enumeration for TRX identification. More...
 

Enumerations

enum  trx_id_tag {
  RF09,
  RF24,
  RFBOTH
}
 Enumeration for TRX identification. More...
 

Functions

void get_fsk_freq_f0 (trx_id_t trx_id, sun_freq_band_t freq_band, fsk_op_mode_t option, uint32_t *freq, uint32_t *spacing)
 Gets the FSK center frequency F0. More...
 
void get_leg_oqpsk_freq_f0 (trx_id_t trx_id, sun_freq_band_t freq_band, uint32_t *freq, uint32_t *spacing)
 Gets the Legacy OQPSK center frequency F0. More...
 
void get_ofdm_freq_f0 (trx_id_t trx_id, sun_freq_band_t freq_band, ofdm_option_t option, uint32_t *freq, uint32_t *spacing)
 Gets the OFDM center frequency F0. More...
 
oqpsk_chip_rate_t get_oqpsk_chip_rate (trx_id_t trx_id, sun_freq_band_t freq_band)
 Gets the OQPSK Chiprate. More...
 
void get_oqpsk_freq_f0 (trx_id_t trx_id, sun_freq_band_t freq_band, uint32_t *freq, uint32_t *spacing)
 Gets the OQPSK center frequency F0. More...
 
uint16_t get_sun_max_ch_no (trx_id_t trx_id)
 Gets Maximum no of channel supported by each modulation. More...
 

#define BB_BASE_ADDR_OFFSET
Value:
#define BASE_ADDR_BBC0_CORE0
Base address for BBC0_CORE0 register set.
Definition: at86rf215.h:1646
#define BASE_ADDR_BBC1_CORE1
Base address for BBC1_CORE1 register set.
Definition: at86rf215.h:1648

Register offset between the baseband cores.

#define BB_RX_FRM_BUF_OFFSET   (RG_BBC1_FBRXS - RG_BBC0_FBRXS)

Register offset between the Rx frame buffers.

Referenced by trx_irq_handler_cb(), and upload_frame().

#define BB_TX_FRM_BUF_OFFSET   (RG_BBC1_FBTXS - RG_BBC0_FBTXS)

Register offset between the Tx frame buffers.

Referenced by tfa_continuous_tx_start(), and transmit_frame().

#define RFT_TST_ADDR_OFFSET   (0x280 - 0x180)

Register offset for test register area.

Referenced by tfa_continuous_tx_stop().

#define TAL_BB_IRQ_ADD (   BB_CORE,
  IRQ 
)    tal_bb_irqs[BB_CORE] |= IRQ

Add interrupt(s) for provided baseband core.

#define TAL_BB_IRQ_CLR (   BB_CORE,
  IRQ 
)
Value:
tal_bb_irqs[BB_CORE] \
&= (uint8_t)(~((uint32_t)IRQ))
volatile bb_irq_t tal_bb_irqs[NUM_TRX]
Shadow variable for BB IRQS; variable is filled during TRX ISR, see trx_irq_handler_cb() in tal_irq_h...
Definition: tal.c:121

Clear interrupt(s) for provided baseband core, avoid Pa091.

Referenced by tal_task(), and transmit_frame().

#define TAL_BB_IRQ_CLR_ALL (   BB_CORE)    tal_bb_irqs[BB_CORE] = BB_IRQ_NO_IRQ

Clear all interrupts for provided baseband core.

Referenced by cancel_any_reception(), and tal_trx_sleep().

#define TAL_BB_IS_IRQ_SET (   BB_CORE,
  IRQ 
)    ((tal_bb_irqs[BB_CORE] & IRQ) ? 1 : 0)

Check if certain IRQ is set for provided baseband core.

#define TAL_RF_IRQ_ADD (   RF_CORE,
  IRQ 
)    tal_rf_irqs[RF_CORE] |= IRQ

Add interrupt(s) for provided radio core.

Referenced by tfa_get_batmon_voltage().

#define TAL_RF_IRQ_CLR (   RF_CORE,
  IRQ 
)
Value:
tal_rf_irqs[RF_CORE] \
&= (uint8_t)(~((uint32_t)IRQ))
volatile rf_irq_t tal_rf_irqs[NUM_TRX]
Shadow variable for RF IRQS; variable is filled during TRX ISR, see trx_irq_handler_cb() in tal_irq_h...
Definition: tal.c:131

Clear interrupt(s) for provided radio core, avoid Pa091.

Referenced by stop_ed_scan(), tal_task(), tal_trx_wakeup(), tfa_cca_perform(), tfa_get_batmon_voltage(), transmit_frame(), and trx_reset().

#define TAL_RF_IRQ_CLR_ALL (   RF_CORE)    tal_rf_irqs[RF_CORE] = RF_IRQ_NO_IRQ

Clear all interrupts for provided radio core.

Referenced by cancel_any_reception(), tal_trx_sleep(), and trx_reset().

#define TAL_RF_IS_IRQ_SET (   RF_CORE,
  IRQ 
)    ((tal_rf_irqs[RF_CORE] & IRQ) ? 1 : 0)

Check if certain IRQ is set for provided radio core.

Referenced by tal_trx_wakeup(), and tfa_cca_perform().

#define TRX_SUPPORTED_CHANNELS_LEG (   trx)
Value:
( \
(trx == RF24) ? \
(0x07FFF800) : \
(0x000007FF) \
)
Id for 2.4 GHz device.
Definition: tal_rf215.h:65

Referenced by handle_incoming_msg().

#define TX_PWR_TOLERANCE   (0x80)

typedef enum trx_id_tag trx_id_t

Enumeration for TRX identification.

enum trx_id_tag

Enumeration for TRX identification.

Enumerator
RF09 

Id for sub-1 GHz device.

RF24 

Id for 2.4 GHz device.

RFBOTH 

Id for both device parts.

void get_fsk_freq_f0 ( trx_id_t  trx_id,
sun_freq_band_t  freq_band,
fsk_op_mode_t  option,
uint32_t *  freq,
uint32_t *  spacing 
)

Gets the FSK center frequency F0.

Parameters
[in]trx_idTransceiver identifier
[in]freq_bandFrequency band
[in]optionFSK operating mode
[out]freqPointer to frequency F0
[out]spacingPointer to Channel spacing
Returns

References FSK_CH_CENTER_FREQ0_MAP_ROW_SIZE, and PGM_READ_DWORD.

Referenced by perf_set_sun_page().

void get_leg_oqpsk_freq_f0 ( trx_id_t  trx_id,
sun_freq_band_t  freq_band,
uint32_t *  freq,
uint32_t *  spacing 
)

Gets the Legacy OQPSK center frequency F0.

Parameters
[in]trx_idTransceiver identifier
[in]freq_bandFrequency band
[out]freqPointer to frequency F0
[out]spacingPointer to Channel spacing
Returns

References LEG_OQPSK_CH_CENTER_FREQ0_MAP_ROW_SIZE, and PGM_READ_DWORD.

Referenced by perf_set_sun_page().

void get_ofdm_freq_f0 ( trx_id_t  trx_id,
sun_freq_band_t  freq_band,
ofdm_option_t  option,
uint32_t *  freq,
uint32_t *  spacing 
)

Gets the OFDM center frequency F0.

Parameters
[in]trx_idTransceiver identifier
[in]freq_bandFrequency band
[in]optionOFDM option
[out]freqPointer to frequency F0
[out]spacingPointer to Channel spacing
Returns

References OFDM_CH_CENTER_FREQ0_MAP_ROW_SIZE, and PGM_READ_DWORD.

Referenced by perf_set_sun_page().

oqpsk_chip_rate_t get_oqpsk_chip_rate ( trx_id_t  trx_id,
sun_freq_band_t  freq_band 
)

Gets the OQPSK Chiprate.

Parameters
[in]trx_idTransceiver identifier
[in]freq_bandFrequency band
Returns
oqpsk chiprate

References CHIP_RATE_100, CHIP_RATE_1000, CHIP_RATE_200, CHIP_RATE_2000, OQPSK_CHIP_RATE_FREQ_TABLE_ROW_SIZE, and PGM_READ_WORD.

void get_oqpsk_freq_f0 ( trx_id_t  trx_id,
sun_freq_band_t  freq_band,
uint32_t *  freq,
uint32_t *  spacing 
)

Gets the OQPSK center frequency F0.

Parameters
[in]trx_idTransceiver identifier
[in]freq_bandFrequency band
[out]freqPointer to frequency F0
[out]spacingPointer to Channel spacing
Returns

References EU_863, OQPSK_CH_CENTER_FREQ0_MAP_ROW_SIZE, and PGM_READ_DWORD.

Referenced by perf_set_sun_page().

uint16_t get_sun_max_ch_no ( trx_id_t  trx_id)

Gets Maximum no of channel supported by each modulation.

Parameters
[in]trx_idTransceiver identifier
Returns
No of channels supported

References FSK, FSK_CH_CENTER_FREQ0_MAP_ROW_SIZE, OFDM, OFDM_CH_CENTER_FREQ0_MAP_ROW_SIZE, OQPSK, OQPSK_CH_CENTER_FREQ0_MAP_ROW_SIZE, PGM_READ_DWORD, and tal_pib.

Referenced by apply_channel_settings(), and set_channel_app().