Microchip® Advanced Software Framework

tal_helper_2.h File Reference

This file contains TAL helper function declarations.

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

Macros

#define AACK_PROM_DISABLE   (0x00)
 
#define AACK_PROM_ENABLE   (0x01)
 
#define MAX_PDT_LEVEL   (0x0f)
 
#define MAX_REG_ADDR_VALUE   (0X3fff)
 

Typedefs

typedef enum param_tag param_type
 
typedef enum tal_trx_status_tag tal_trx_status_t
 sub-register TRX_STATUS in register TRX_STATUS More...
 

Enumerations

enum  param_tag {
  CC_BAND = 0x04,
  CC_NUMBER = 0x05,
  TX_PWR = 0x06,
  CC_BAND = 0x04,
  CC_NUMBER = 0x05,
  TX_PWR = 0x06
}
 
enum  tal_trx_status_tag {
  P_ON = (0),
  BUSY_RX = (1),
  BUSY_TX = (2),
  RX_ON = (6),
  TRX_OFF = (8),
  PLL_ON = (9),
  TRX_SLEEP = (15),
  BUSY_RX_AACK = (17),
  BUSY_TX_ARET = (18),
  RX_AACK_ON = (22),
  TX_ARET_ON = (25),
  RX_ON_NOCLK = (28),
  RX_AACK_ON_NOCLK = (29),
  BUSY_RX_AACK_NOCLK = (30),
  STATE_TRANSITION_IN_PROGRESS = (31),
  P_ON = (0x00),
  TRX_OFF = (0x08),
  PLL_ON = (0x09),
  TRX_SLEEP = (0x0F),
  RX_ON = (0x16),
  P_ON = (0x00),
  BUSY_RX = (0x01),
  BUSY_TX = (0x02),
  RX_ON = (0x06),
  TRX_OFF = (0x08),
  PLL_ON = (0x09),
  TRX_SLEEP = (0x0F),
  BUSY_RX_AACK = (0x11),
  BUSY_TX_ARET = (0x12),
  RX_AACK_ON = (0x16),
  TX_ARET_ON = (0x19),
  RX_ON_NOCLK = (0x1C),
  RX_AACK_ON_NOCLK = (0x1D),
  BUSY_RX_AACK_NOCLK = (0x1E),
  STATE_TRANSITION_IN_PROGRESS = (0x1F),
  P_ON = (0x00),
  BUSY_RX = (0x01),
  BUSY_TX = (0x02),
  RX_ON = (0x06),
  TRX_OFF = (0x08),
  PLL_ON = (0x09),
  TRX_SLEEP = (0x0F),
  BUSY_RX_AACK = (0x11),
  BUSY_TX_ARET = (0x12),
  RX_AACK_ON = (0x16),
  TX_ARET_ON = (0x19),
  RX_ON_NOCLK = (0x1C),
  RX_AACK_ON_NOCLK = (0x1D),
  BUSY_RX_AACK_NOCLK = (0x1E),
  STATE_TRANSITION_IN_PROGRESS = (0x1F),
  P_ON = (0x00),
  BUSY_RX = (0x01),
  BUSY_TX = (0x02),
  RX_ON = (0x06),
  TRX_OFF = (0x08),
  PLL_ON = (0x09),
  TRX_SLEEP = (0x0F),
  PREP_DEEP_SLEEP = (0x10),
  BUSY_RX_AACK = (0x11),
  BUSY_TX_ARET = (0x12),
  RX_AACK_ON = (0x16),
  TX_ARET_ON = (0x19),
  STATE_TRANSITION_IN_PROGRESS = (0x1F),
  TRX_DEEP_SLEEP = (0x20),
  P_ON = (0x00),
  BUSY_RX = (0x01),
  BUSY_TX = (0x02),
  RX_ON = (0x06),
  TRX_OFF = (0x08),
  PLL_ON = (0x09),
  TRX_SLEEP = (0x0F),
  BUSY_RX_AACK = (0x11),
  BUSY_TX_ARET = (0x12),
  RX_AACK_ON = (0x16),
  TX_ARET_ON = (0x19),
  STATE_TRANSITION_IN_PROGRESS = (0x1F)
}
 sub-register TRX_STATUS in register TRX_STATUS More...
 

Functions

bool crc_check_ok (trx_id_t trx)
 Calculates CRC manually and compares with the received and returns true if both are same,false otherwise. More...
 
retval_t tal_ant_div_config (bool div_ctrl, uint8_t ant_ctrl)
 
retval_t tal_convert_reg_value_to_dBm (uint8_t reg_value, int8_t *dbm_value)
 
retval_t tal_dump_registers (trx_id_t trx, uint16_t start_addr, uint16_t end_addr, uint8_t *value)
 
retval_t tal_ext_pa_ctrl (bool pa_ext_sw_ctrl)
 Enable/Disable the external RF front end control. More...
 
retval_t tal_get_curr_trx_config (trx_id_t trx, param_type parameter, uint8_t *param_value)
 
tal_trx_status_t tal_get_trx_status (trx_id_t trx)
 
retval_t tal_rxaack_prom_mode_ctrl (trx_id_t trx, bool prom_ctrl)
 
retval_t tal_set_rx_sensitivity_level (trx_id_t trx, uint8_t pdt_level)
 
retval_t tal_set_tx_pwr (trx_id_t trx, bool type, int8_t pwr_value)
 Enable/Disable the external RF front end control. More...
 
retval_t tal_trx_reg_read (trx_id_t trx, uint16_t reg_addr, uint8_t *data)
 
retval_t tal_trx_reg_write (trx_id_t trx, uint16_t reg_addr, uint8_t value)
 

#define AACK_PROM_DISABLE   (0x00)
#define AACK_PROM_ENABLE   (0x01)

Referenced by per_mode_receptor_rx_cb().

#define MAX_PDT_LEVEL   (0x0f)
#define MAX_REG_ADDR_VALUE   (0X3fff)

typedef enum param_tag param_type

sub-register TRX_STATUS in register TRX_STATUS

enum param_tag
Enumerator
CC_BAND 
CC_NUMBER 
TX_PWR 
CC_BAND 
CC_NUMBER 
TX_PWR 

sub-register TRX_STATUS in register TRX_STATUS

Enumerator
P_ON 

Constant P_ON for sub-register SR_TRX_STATUS.

BUSY_RX 

Constant BUSY_RX for sub-register SR_TRX_STATUS.

BUSY_TX 

Constant BUSY_TX for sub-register SR_TRX_STATUS.

RX_ON 

Constant RX_ON for sub-register SR_TRX_STATUS.

TRX_OFF 

Constant TRX_OFF for sub-register SR_TRX_STATUS.

PLL_ON 

Constant PLL_ON for sub-register SR_TRX_STATUS.

TRX_SLEEP 

Constant SLEEP for sub-register SR_TRX_STATUS.

BUSY_RX_AACK 

Constant BUSY_RX_AACK for sub-register SR_TRX_STATUS.

BUSY_TX_ARET 

Constant BUSY_TX_ARET for sub-register SR_TRX_STATUS.

RX_AACK_ON 

Constant RX_AACK_ON for sub-register SR_TRX_STATUS.

TX_ARET_ON 

Constant TX_ARET_ON for sub-register SR_TRX_STATUS.

RX_ON_NOCLK 

Constant RX_ON_NOCLK for sub-register SR_TRX_STATUS.

RX_AACK_ON_NOCLK 

Constant RX_AACK_ON_NOCLK for sub-register SR_TRX_STATUS.

BUSY_RX_AACK_NOCLK 

Constant BUSY_RX_AACK_NOCLK for sub-register SR_TRX_STATUS.

STATE_TRANSITION_IN_PROGRESS 

Constant STATE_TRANSITION_IN_PROGRESS for sub-register SR_TRX_STATUS.

P_ON 

Constant P_ON for sub-register SR_TRX_STATUS.

TRX_OFF 

Constant TRX_OFF for sub-register SR_TRX_STATUS.

PLL_ON 

Constant PLL_ON for sub-register SR_TRX_STATUS.

TRX_SLEEP 

Constant TRX_SLEEP for sub-register SR_TRX_STATUS.

RX_ON 

Constant RX_AACK_ON for sub-register SR_TRX_STATUS.

P_ON 

Constant P_ON for sub-register SR_TRX_STATUS.

BUSY_RX 

Constant BUSY_RX for sub-register SR_TRX_STATUS.

BUSY_TX 

Constant BUSY_TX for sub-register SR_TRX_STATUS.

RX_ON 

Constant RX_ON for sub-register SR_TRX_STATUS.

TRX_OFF 

Constant TRX_OFF for sub-register SR_TRX_STATUS.

PLL_ON 

Constant PLL_ON for sub-register SR_TRX_STATUS.

TRX_SLEEP 

Constant TRX_SLEEP for sub-register SR_TRX_STATUS.

BUSY_RX_AACK 

Constant BUSY_RX_AACK for sub-register SR_TRX_STATUS.

BUSY_TX_ARET 

Constant BUSY_TX_ARET for sub-register SR_TRX_STATUS.

RX_AACK_ON 

Constant RX_AACK_ON for sub-register SR_TRX_STATUS.

TX_ARET_ON 

Constant TX_ARET_ON for sub-register SR_TRX_STATUS.

RX_ON_NOCLK 

Constant RX_ON_NOCLK for sub-register SR_TRX_STATUS.

RX_AACK_ON_NOCLK 

Constant RX_AACK_ON_NOCLK for sub-register SR_TRX_STATUS.

BUSY_RX_AACK_NOCLK 

Constant BUSY_RX_AACK_NOCLK for sub-register SR_TRX_STATUS.

STATE_TRANSITION_IN_PROGRESS 

Constant STATE_TRANSITION_IN_PROGRESS for sub-register SR_TRX_STATUS.

P_ON 

Constant P_ON for sub-register SR_TRX_STATUS.

BUSY_RX 

Constant BUSY_RX for sub-register SR_TRX_STATUS.

BUSY_TX 

Constant BUSY_TX for sub-register SR_TRX_STATUS.

RX_ON 

Constant RX_ON for sub-register SR_TRX_STATUS.

TRX_OFF 

Constant TRX_OFF for sub-register SR_TRX_STATUS.

PLL_ON 

Constant PLL_ON for sub-register SR_TRX_STATUS.

TRX_SLEEP 

Constant TRX_SLEEP for sub-register SR_TRX_STATUS.

BUSY_RX_AACK 

Constant BUSY_RX_AACK for sub-register SR_TRX_STATUS.

BUSY_TX_ARET 

Constant BUSY_TX_ARET for sub-register SR_TRX_STATUS.

RX_AACK_ON 

Constant RX_AACK_ON for sub-register SR_TRX_STATUS.

TX_ARET_ON 

Constant TX_ARET_ON for sub-register SR_TRX_STATUS.

RX_ON_NOCLK 

Constant RX_ON_NOCLK for sub-register SR_TRX_STATUS.

RX_AACK_ON_NOCLK 

Constant RX_AACK_ON_NOCLK for sub-register SR_TRX_STATUS.

BUSY_RX_AACK_NOCLK 

Constant BUSY_RX_AACK_NOCLK for sub-register SR_TRX_STATUS.

STATE_TRANSITION_IN_PROGRESS 

Constant STATE_TRANSITION_IN_PROGRESS for sub-register SR_TRX_STATUS.

P_ON 

Constant P_ON for sub-register SR_TRX_STATUS.

BUSY_RX 

Constant BUSY_RX for sub-register SR_TRX_STATUS.

BUSY_TX 

Constant BUSY_TX for sub-register SR_TRX_STATUS.

RX_ON 

Constant RX_ON for sub-register SR_TRX_STATUS.

TRX_OFF 

Constant TRX_OFF for sub-register SR_TRX_STATUS.

PLL_ON 

Constant PLL_ON for sub-register SR_TRX_STATUS.

TRX_SLEEP 

Constant TRX_SLEEP for sub-register SR_TRX_STATUS.

PREP_DEEP_SLEEP 

Constant PREP_DEEP_SLEEP for sub-register SR_TRX_STATUS.

BUSY_RX_AACK 

Constant BUSY_RX_AACK for sub-register SR_TRX_STATUS.

BUSY_TX_ARET 

Constant BUSY_TX_ARET for sub-register SR_TRX_STATUS.

RX_AACK_ON 

Constant RX_AACK_ON for sub-register SR_TRX_STATUS.

TX_ARET_ON 

Constant TX_ARET_ON for sub-register SR_TRX_STATUS.

STATE_TRANSITION_IN_PROGRESS 

Constant STATE_TRANSITION_IN_PROGRESS for sub-register SR_TRX_STATUS.

TRX_DEEP_SLEEP 

Software implemented state.

P_ON 

Constant P_ON for sub-register SR_TRX_STATUS.

BUSY_RX 

Constant BUSY_RX for sub-register SR_TRX_STATUS.

BUSY_TX 

Constant BUSY_TX for sub-register SR_TRX_STATUS.

RX_ON 

Constant RX_ON for sub-register SR_TRX_STATUS.

TRX_OFF 

Constant TRX_OFF for sub-register SR_TRX_STATUS.

PLL_ON 

Constant PLL_ON for sub-register SR_TRX_STATUS.

TRX_SLEEP 

Constant TRX_SLEEP for sub-register SR_TRX_STATUS.

BUSY_RX_AACK 

Constant BUSY_RX_AACK for sub-register SR_TRX_STATUS.

BUSY_TX_ARET 

Constant BUSY_TX_ARET for sub-register SR_TRX_STATUS.

RX_AACK_ON 

Constant RX_AACK_ON for sub-register SR_TRX_STATUS.

TX_ARET_ON 

Constant TX_ARET_ON for sub-register SR_TRX_STATUS.

STATE_TRANSITION_IN_PROGRESS 

Constant STATE_TRANSITION_IN_PROGRESS for sub-register SR_TRX_STATUS.

bool crc_check_ok ( trx_id_t  trx)

Calculates CRC manually and compares with the received and returns true if both are same,false otherwise.

References RF_BASE_ADDR_OFFSET, SR_BBC0_PC_FCSOK, and trx_bit_read().

Referenced by per_mode_receptor_rx_cb().

retval_t tal_ant_div_config ( bool  div_ctrl,
uint8_t  ant_ctrl 
)
retval_t tal_convert_reg_value_to_dBm ( uint8_t  reg_value,
int8_t *  dbm_value 
)
retval_t tal_dump_registers ( trx_id_t  trx,
uint16_t  start_addr,
uint16_t  end_addr,
uint8_t *  value 
)
retval_t tal_ext_pa_ctrl ( bool  pa_ext_sw_ctrl)

Enable/Disable the external RF front end control.

Parameters
pa_ext_sw_ctrltrue if external rf front end control has to be enabled
Returns
MAC_SUCCESS if PA_EXT_EN bit is configured correctly FAILURE otherwise

Referenced by peer_search_initiator_init(), peer_search_receptor_init(), and per_mode_initiator_init().

retval_t tal_set_tx_pwr ( trx_id_t  trx,
bool  type,
int8_t  pwr_value 
)

Enable/Disable the external RF front end control.

Parameters
pa_ext_sw_ctrltrue if external rf front end control has to be enabled
Returns
MAC_SUCCESS if PA_EXT_EN bit is configured correctly FAILURE otherwise

References CONV_DBM_TO_phyTransmitPower, convert_phyTransmitPower_to_reg_value(), FAILURE, MAC_INVALID_PARAMETER, MAC_SUCCESS, phyTransmitPower, tal_convert_reg_value_to_dBm(), tal_pib, tal_pib_set(), and temp.

Referenced by peer_search_initiator_init(), peer_search_receptor_init(), set_paramter_on_recptor_node(), and set_tx_power().

retval_t tal_trx_reg_read ( trx_id_t  trx,
uint16_t  reg_addr,
uint8_t *  data 
)