Microchip® Advanced Software Framework

atmegarfr2/src/tfa.c File Reference
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include "pal.h"
#include "return_val.h"
#include "tal.h"
#include "tal_irq_handler.h"
#include "tal_constants.h"
#include "tal_internal.h"
#include "ieee_const.h"
#include "atmega256rfr2.h"
#include "tfa.h"

Macros

#define CLIP_VALUE_REG   (55)
 
#define NUM_SAMPLES   16
 

Typedefs

typedef enum pin_state_tag pin_state_t
 Pin State. More...
 

Enumerations

enum  pin_state_tag {
  LOW,
  HIGH,
  LOW,
  HIGH,
  LOW,
  HIGH
}
 Pin State. More...
 

Functions

static void init_tfa_pib (void)
 Initialize the TFA PIB. 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...
 

Variables

static int8_t tfa_pib_rx_sens
 TFA PIB attribute to reduce the Rx sensitivity. More...
 

#define CLIP_VALUE_REG   (55)

Referenced by tfa_ed_sample().

#define NUM_SAMPLES   16

Referenced by tfa_get_temperature().

typedef enum pin_state_tag pin_state_t

Pin State.

Pin State.

Enumerator
LOW 

Pin state low.

HIGH 

Pin state high.

LOW 

Pin state low.

HIGH 

Pin state high.

LOW 

Pin state low.

HIGH 

Pin state high.

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().

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().

int8_t tfa_pib_rx_sens
static

TFA PIB attribute to reduce the Rx sensitivity.

Represents the Rx sensitivity value in dBm; example: -52

Referenced by init_tfa_pib(), tfa_pib_get(), tfa_pib_set(), and write_all_tfa_pibs_to_trx().