Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Transceiver Feature Access

The Atmel transceivers provide a variety of additional hardware features features that are not reflected in the IEEE 802.15.4 standard.

These features are for eg .Reading battery voltage, Continuous wave transmission etc .

Macros

#define SUPPLY_VOLTAGE_ABOVE_UPPER_LIMIT   (0xFFFF)
 Supply voltage above upper limit. More...
 
#define SUPPLY_VOLTAGE_BELOW_LOWER_LIMIT   (0)
 Supply voltage below lower limit. More...
 
#define TFA_PIB_RX_SENS_DEF   (RSSI_BASE_VAL_BPSK_40_DBM)
 Default value of TFA PIB attribute to reduce the Rx sensitivity. More...
 

Typedefs

typedef enum continuous_tx_mode_tag continuous_tx_mode_t
 Continuous Transmission modes. More...
 
typedef enum tfa_pib_t tfa_pib_t
 Transceiver commands. More...
 

Enumerations

enum  continuous_tx_mode_tag {
  CW_MODE = 0,
  PRBS_MODE = 1,
  CW_MODE_2 = 2,
  CW_ALL_ZEROS_MODE = 3
}
 Continuous Transmission modes. More...
 
enum  tfa_pib_t { TFA_PIB_RX_SENS = 0 }
 Transceiver commands. More...
 

Functions

static void init_tfa_pib (void)
 Initialize the TFA PIB. More...
 
retval_t tfa_batmon_irq_init (FUNC_PTR(batmon_irq_cb), uint16_t vth)
 Setups the battery monitor interrupt. More...
 
phy_enum_t tfa_cca_perform (void)
 Perform a CCA. More...
 
void tfa_continuous_tx_start (continuous_tx_mode_t tx_mode, bool random_content)
 Starts continuous transmission on current channel. More...
 
void tfa_continuous_tx_stop (void)
 Stops CW transmission. More...
 
uint8_t tfa_ed_sample (void)
 Perform a single ED measurement. More...
 
uint16_t tfa_get_batmon_voltage (void)
 Gets the transceiver's supply voltage. More...
 
double tfa_get_temperature (void)
 Get the temperature value from the integrated sensor. More...
 
retval_t tfa_init (void)
 Initializes the TFA. More...
 
retval_t tfa_pib_get (tfa_pib_t tfa_pib_attribute, void *value)
 Gets a TFA PIB attribute. More...
 
retval_t tfa_pib_set (tfa_pib_t tfa_pib_attribute, void *value)
 Sets a TFA PIB attribute. More...
 
void tfa_reset (bool set_default_pib)
 Reset the TFA. More...
 
static void write_all_tfa_pibs_to_trx (void)
 Write all shadow PIB variables to the transceiver. More...
 

#define SUPPLY_VOLTAGE_ABOVE_UPPER_LIMIT   (0xFFFF)

Supply voltage above upper limit.

Referenced by tfa_get_batmon_voltage().

#define SUPPLY_VOLTAGE_BELOW_LOWER_LIMIT   (0)

Supply voltage below lower limit.

Referenced by tfa_get_batmon_voltage().

#define TFA_PIB_RX_SENS_DEF   (RSSI_BASE_VAL_BPSK_40_DBM)

Default value of TFA PIB attribute to reduce the Rx sensitivity.

By default, reduced sensitivity is disabled.

Referenced by init_tfa_pib().

Continuous Transmission modes.

typedef enum tfa_pib_t tfa_pib_t

Transceiver commands.

Continuous Transmission modes.

Enumerator
CW_MODE 
PRBS_MODE 
CW_MODE_2 
CW_ALL_ZEROS_MODE 
enum tfa_pib_t

Transceiver commands.

Enumerator
TFA_PIB_RX_SENS 

static void init_tfa_pib ( void  )
static

Initialize the TFA PIB.

This function initializes the TFA information base attributes to their default values.

References tfa_pib_rx_sens, and TFA_PIB_RX_SENS_DEF.

Referenced by tfa_init(), and tfa_reset().

retval_t tfa_batmon_irq_init ( FUNC_PTR(batmon_irq_cb)  ,
uint16_t  vth 
)

Setups the battery monitor interrupt.

Parameters
batmon_irq_cbCallback function for the batmon interrupt
vthThreshold value in millivolt
Returns
MAC_SUCCESS if provided voltage is within range, else MAC_INVALID_PARAMETER
void tfa_continuous_tx_start ( continuous_tx_mode_t  tx_mode,
bool  random_content 
)

Starts continuous transmission on current channel.

Parameters
trx_idIdentifier of the transceiver
tx_modeTransmission mode
random_contentUse random content if true

References CMD_PLL_ON, CMD_TRX_OFF, CW_MODE, i, RG_PART_NUM, RG_RX_CTRL, RG_TRX_CTRL_2, RG_TRX_STATE, set_trx_state(), SR_TST_CTRL_DIG, SR_TX_AUTO_CRC_ON, tal_pib, trx_bit_write(), trx_frame_write(), trx_reg_write(), TRX_SLP_TR_HIGH, TRX_SLP_TR_LOW, TST_CONT_TX, and TX_AUTO_CRC_DISABLE.

void tfa_continuous_tx_stop ( void  )

Stops CW transmission.

References tal_reset().

uint8_t tfa_ed_sample ( void  )

Perform a single ED measurement.

Returns
ed_value Result of the measurement (transceiver's register value) If the build switch TRX_REG_RAW_VALUE is defined, the transceiver's register value is returned.

References CLIP_VALUE_REG, CMD_RX_ON, CMD_TRX_OFF, ED_SAMPLE_DURATION_SYM, pal_timer_delay, RG_IRQ_STATUS, RG_PHY_ED_LEVEL, RX_DISABLE, RX_ENABLE, RX_ON, set_trx_state(), SR_RX_PDT_DIS, TAL_CONVERT_SYMBOLS_TO_US, trx_bit_write(), TRX_IRQ_4_CCA_ED_DONE, TRX_IRQ_CCA_ED_READY, trx_reg_read(), and trx_reg_write().

double tfa_get_temperature ( void  )

Get the temperature value from the integrated sensor.

Returns
temperature value in degree Celsius

Referenced by get_sensor_data().

retval_t tfa_init ( void  )

Initializes the TFA.

This function is called to initialize the TFA.

Returns
MAC_SUCCESS if everything went correct; FAILURE otherwise

References init_tfa_pib(), MAC_SUCCESS, and write_all_tfa_pibs_to_trx().

Referenced by tal_init().

retval_t tfa_pib_get ( tfa_pib_t  tfa_pib_attribute,
void *  value 
)

Gets a TFA PIB attribute.

This function is called to retrieve the transceiver information base attributes.

Parameters
[in]tfa_pib_attributeTAL infobase attribute ID
[out]valueTFA infobase attribute value
Returns
MAC_UNSUPPORTED_ATTRIBUTE if the TFA infobase attribute is not found MAC_SUCCESS otherwise

References MAC_SUCCESS, MAC_UNSUPPORTED_ATTRIBUTE, TFA_PIB_RX_SENS, and tfa_pib_rx_sens.

retval_t tfa_pib_set ( tfa_pib_t  tfa_pib_attribute,
void *  value 
)

Sets a TFA PIB attribute.

This function is called to set the transceiver information base attributes.

Parameters
[in]tfa_pib_attributeTFA infobase attribute ID
[in]valueTFA infobase attribute value to be set
Returns
MAC_UNSUPPORTED_ATTRIBUTE if the TFA info base attribute is not found TAL_BUSY if the TAL is not in TAL_IDLE state. MAC_SUCCESS if the attempt to set the PIB attribute was successful

References MAC_SUCCESS, MAC_UNSUPPORTED_ATTRIBUTE, RSSI_BASE_VAL_BPSK_20_DBM, RSSI_BASE_VAL_BPSK_300_DBM, RSSI_BASE_VAL_BPSK_40_DBM, RSSI_BASE_VAL_BPSK_600_DBM, RSSI_BASE_VAL_DBM, RSSI_BASE_VAL_OQPSK_1000_RC_DBM, RSSI_BASE_VAL_OQPSK_1000_SIN_DBM, RSSI_BASE_VAL_OQPSK_100_DBM, RSSI_BASE_VAL_OQPSK_400_SIN_RC_DBM, RSSI_BASE_VAL_OQPSK_RC_250_DBM, RSSI_BASE_VAL_OQPSK_SIN_250_DBM, SR_RX_PDT_LEVEL, tal_pib, TFA_PIB_RX_SENS, tfa_pib_rx_sens, and trx_bit_write().

Referenced by write_all_tfa_pibs_to_trx().

void tfa_reset ( bool  set_default_pib)

Reset the TFA.

This function is called to reset the TFA.

Parameters
set_default_pibDefines whether PIB values need to be set to its default values

References init_tfa_pib(), and write_all_tfa_pibs_to_trx().

Referenced by tal_reset().

static void write_all_tfa_pibs_to_trx ( void  )
static

Write all shadow PIB variables to the transceiver.

This function writes all shadow PIB variables to the transceiver. It is assumed that the radio does not sleep.

References TFA_PIB_RX_SENS, tfa_pib_rx_sens, and tfa_pib_set().

Referenced by tfa_init(), and tfa_reset().