Microchip® Advanced Software Framework

at86rf231/src/tal.c File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include "pal.h"
#include "return_val.h"
#include "tal.h"
#include "ieee_const.h"
#include "tal_pib.h"
#include "tal_irq_handler.h"
#include "at86rf231.h"
#include "stack_config.h"
#include "bmm.h"
#include "qmm.h"
#include "tal_rx.h"
#include "tal_tx.h"
#include "tal_constants.h"
#include "tal_internal.h"
#include "tal_slotted_csma.h"
#include "mac_build_config.h"

Macros

#define PLL_LOCK_ATTEMPTS   (3)
 

Functions

tal_trx_status_t set_trx_state (trx_cmd_t trx_cmd)
 Sets transceiver state. More...
 
static void switch_pll_on (void)
 Switches the PLL on. More...
 
uint32_t tal_convert_symbols_to_us_def (uint32_t symbols)
 Conversion of symbols to microseconds. More...
 
uint32_t tal_convert_us_to_symbols_def (uint32_t time)
 Conversion of microseconds to symbols. More...
 
void tal_task (void)
 TAL task handling. More...
 

Variables

uint8_t last_frame_length
 
frame_info_tmac_frame_ptr
 Frame pointer for the frame structure provided by the MCL. More...
 
volatile bool tal_awake_end_flag
 
csma_state_t tal_csma_state
 CSMA state machine variable. More...
 
uint8_t * tal_frame_to_tx
 Pointer to the 15.4 frame created by the TAL to be handed over to the transceiver. More...
 
queue_t tal_incoming_frame_queue
 Queue that contains all frames that are uploaded from the trx, but have not be processed by the MCL yet. More...
 
tal_pib_t tal_pib
 
buffer_t * tal_rx_buffer = NULL
 Pointer to receive buffer that can be used to upload a frame from the trx. More...
 
bool tal_rx_on_required
 Indicates if the transceiver needs to switch on its receiver by tal_task(), because it could not be switched on due to buffer shortage. More...
 
uint32_t tal_rx_timestamp
 Timestamp The timestamping is only required for beaconing networks or if timestamping is explicitly enabled. More...
 
tal_state_t tal_state
 Current state of the TAL state machine. More...
 
tal_trx_status_t tal_trx_status
 Current state of the transceiver. More...
 

#define PLL_LOCK_ATTEMPTS   (3)

Referenced by switch_pll_on().

uint32_t tal_convert_symbols_to_us_def ( uint32_t  symbols)

Conversion of symbols to microseconds.

TAL task handling.

uint32_t tal_convert_us_to_symbols_def ( uint32_t  time)

Conversion of microseconds to symbols.

void tal_task ( void  )

TAL task handling.

This function

  • Checks and allocates the receive buffer.
  • Processes the TAL incoming frame queue.
  • Implements the TAL state machine.

Referenced by performance_analyzer_task(), and wpan_task().

uint8_t last_frame_length
frame_info_t* mac_frame_ptr

Frame pointer for the frame structure provided by the MCL.

Referenced by calculate_transaction_duration(), handle_tx_end_irq(), is_ack_valid(), tal_tx_frame(), transmit_frame(), tx_done(), and tx_done_handling().

volatile bool tal_awake_end_flag
uint8_t* tal_frame_to_tx

Pointer to the 15.4 frame created by the TAL to be handed over to the transceiver.

Referenced by calculate_transaction_duration(), send_frame(), tal_tx_frame(), and tx_done_handling().

queue_t tal_incoming_frame_queue

Queue that contains all frames that are uploaded from the trx, but have not be processed by the MCL yet.

Referenced by cleanup_tal(), complete_rx_transaction(), handle_received_frame_irq(), init_after_disconnect(), mac_ready_to_sleep(), tal_init(), tal_reset(), and tal_task().

tal_pib_t tal_pib

Referenced by ack_timout_cb(), ack_transmission_done(), app_transmit_frame(), apply_channel_page_configuration(), apply_channel_settings(), build_data_frame(), calc_ch_page(), calculate_cca_duration_us(), calculate_pib_values(), cca_start(), ceiling_sym(), check_beacon_reception(), complete_rx_transaction(), conf_fsk(), conf_leg_oqpsk(), conf_ofdm(), conf_oqpsk(), conf_trx_modulation(), config_fsk_rpc(), config_phy(), configure_frame_sending(), configure_pibs(), configure_pkt_stream_frames(), configure_range_test_frame_sending(), continue_deferred_transmission(), csma_backoff_calculation(), csma_continue(), csma_param_init(), csma_start(), fsk_rfcfg(), get_AckTiming_us(), get_AckWaitDuration_us(), get_board_details(), get_cca_duration_us(), get_cca_thres(), get_data_rate(), get_node_info(), get_sun_max_ch_no(), get_supported_channels_tuple(), handle_ed_end_irq(), handle_gts_data_req(), handle_gts_sync_loss(), handle_ifs(), handle_incoming_frame(), handle_incoming_msg(), handle_received_frame_irq(), handle_rx_end_irq(), handle_tx_end_irq(), init_tal_pib(), limit_tx_pwr(), mac_coord_realignment_command_tx_success(), mac_gts_allocate(), mac_parse_bcn_gts_info(), mac_process_tal_data_ind(), mac_sleep_trans(), mac_t_gts_cb(), main(), mcps_data_request(), mlme_get(), mlme_gts_request(), mlme_start_request(), ofdm_rfcfg(), oqpsk_ack_psdu_duration_sym(), oqpsk_get_chip_rate(), oqpsk_rfcfg(), parse_mpdu(), per_mode_initiator_rx_cb(), per_mode_initiator_task(), per_mode_initiator_tx_done_cb(), per_mode_receptor_rx_cb(), perf_set_sun_page(), phr_duration_sym(), process_data_ind_not_transient(), process_incoming_frame(), recalc_macMaxFrameTotalWaitTime(), reset_gts_expiry(), send_frame(), send_peer_conf(), set_channel(), set_channel_app(), set_default_tx_pwr(), set_fsk_pibs(), set_phy_based_on_channel_page(), set_phy_frame_length(), set_sfd(), set_tx_pwr(), shr_duration_sym(), slotted_csma_start(), slotted_csma_state_handling(), start_ack_wait_timer(), start_backoff(), start_beacon_loss_timer(), start_ed_scan(), start_rpc(), stop_rpc(), tal_get_rssi_base_val(), tal_get_symbol_duration_us(), tal_init(), tal_pib_get(), tal_pib_set(), tal_rx_enable(), tal_set_tx_pwr(), tal_task(), tal_tx_frame(), tfa_continuous_tx_start(), tfa_pib_set(), transmit_frame(), tx_done_handling(), upload_frame(), usr_range_test_beacon_rsp(), usr_range_test_beacon_tx(), usr_range_test_marker_ind(), validate_tx_power(), and write_all_tal_pib_to_trx().

buffer_t* tal_rx_buffer = NULL
uint32_t tal_rx_timestamp

Timestamp The timestamping is only required for beaconing networks or if timestamping is explicitly enabled.

Referenced by handle_received_frame_irq(), and trx_irq_handler_cb().