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_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
}
 Continuous Transmission modes. More...
 
enum  tfa_pib_t { TFA_PIB_RX_SENS = 0 }
 Transceiver commands. More...
 

Functions

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 (trx_id_t trx_id)
 Perform a CCA. More...
 
void tfa_continuous_tx_start (trx_id_t trx_id, continuous_tx_mode_t tx_mode)
 Starts continuous transmission on current channel. More...
 
void tfa_continuous_tx_stop (trx_id_t trx_id)
 Stops CW transmission. More...
 
uint8_t tfa_ed_sample (trx_id_t trx_id)
 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...
 

#define SUPPLY_VOLTAGE_ABOVE_UPPER_LIMIT   (0xFFFF)

Supply voltage above upper limit.

#define SUPPLY_VOLTAGE_BELOW_LOWER_LIMIT   (0)

Supply voltage below lower limit.

#define TFA_PIB_RX_SENS_DEF   (RSSI_BASE_VAL_DBM)

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

By default, reduced sensitivity is disabled.

Continuous Transmission modes.

typedef enum tfa_pib_t tfa_pib_t

Transceiver commands.

Continuous Transmission modes.

Enumerator
CW_MODE 
PRBS_MODE 
enum tfa_pib_t

Transceiver commands.

Enumerator
TFA_PIB_RX_SENS 

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

References BATMON_MON_VTH_MAX, BATMON_MON_VTH_MIN, irq_hdl_batmon, MAC_INVALID_PARAMETER, MAC_SUCCESS, SR_RF_BMDVC_BMHR, SR_RF_BMDVC_BMVTH, and trx_bit_write().

phy_enum_t tfa_cca_perform ( trx_id_t  trx_id)

Perform a CCA.

This function performs a CCA request.

Parameters
trx_idTransceiver identifier
Returns
phy_enum_t PHY_IDLE or PHY_BUSY

This blocking function performs a CCA request.

Returns
phy_enum_t PHY_IDLE or PHY_BUSY

References pal_timer_delay, PHY_BUSY, PHY_IDLE, RF_BASE_ADDR_OFFSET, RF_EDSINGLE, RF_IRQ_EDC, RF_RX, RF_TRXOFF, RG_RF09_CMD, RG_RF09_EDC, RG_RF09_EDV, SR_BBC0_PC_BBEN, SR_RF09_IRQM_EDC, switch_to_rx(), switch_to_txprep(), tal_current_ed_val, TAL_IDLE, tal_pib, TAL_RF_IRQ_CLR, TAL_RF_IS_IRQ_SET, tal_state, TAL_TFA_CCA, trx_bit_write(), trx_reg_read(), trx_reg_write(), and trx_state.

void tfa_continuous_tx_start ( trx_id_t  trx_id,
continuous_tx_mode_t  tx_mode 
)

Starts continuous transmission on current channel.

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

References BB_TX_FRM_BUF_OFFSET, CW_MODE, data, LEG_OQPSK, RF09, RF24, RF_BASE_ADDR_OFFSET, RF_RX, RF_TX, RG_BBC0_FBTXS, RG_BBC0_TXFLL, RG_RF09_CMD, RG_RF09_TXDACI, SR_BBC0_PC_CTX, SR_RF_IQIFC0_EEC, SR_RF_IQIFC1_CHPM, switch_to_txprep(), TAL_IDLE, tal_pib, tal_state, TAL_TFA_CW, TAL_TFA_CW_RX, trx_bit_write(), trx_reg_write(), trx_state, and trx_write().

Referenced by pulse_cw_transmission(), and start_cw_transmission().

void tfa_continuous_tx_stop ( trx_id_t  trx_id)
uint8_t tfa_ed_sample ( trx_id_t  trx_id)

Perform a single ED measurement.

Parameters
trx_idIdentifier of the transceiver
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.
uint16_t tfa_get_batmon_voltage ( void  )

Gets the transceiver's supply voltage.

Returns
mv Milli Volt; 0 if below threshold, 0xFFFF if above threshold
mv Milli Volt; 0 if below range, 0xFFFF if above range

References BATMON_MON_VTH_MAX, BATMON_MON_VTH_MIN, NUM_TRX, pal_timer_delay, RF09, RF24, RF_BASE_ADDR_OFFSET, RF_IRQ_BATLOW, RF_IRQ_TRXRDY, RG_RF09_IRQS, SR_RF09_IRQM_BATLOW, SR_RF_BMDVC_BMHR, SR_RF_BMDVC_BMS, SR_RF_BMDVC_BMVTH, TAL_RF_IRQ_ADD, TAL_RF_IRQ_CLR, TAL_SLEEP, tal_state, trx_bit_read(), trx_bit_write(), and trx_read().

Referenced by get_sensor_data().

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
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
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
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