This file contains TAL API function declarations.
Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
#include <stdint.h>
#include <stdbool.h>
#include "pal.h"
#include "tal_config.h"
#include "tal_generic.h"
#include "bmm.h"
#include "stack_config.h"
#include "return_val.h"
#include "tal_types.h"
#include "mac_build_config.h"
#include "qmm.h"
#include "tal_multi_trx.h"
Data Structures | |
struct | frame_info_tag |
Globally used frame information structure. More... | |
struct | tal_pib_tag |
Macros | |
#define | BAND_2400 (1) |
2.4 GHz (channels 11 through 26) More... | |
#define | BAND_900 (0) |
868 / 910 MHz (channels 0 through 10) using BPSK More... | |
#define | BAND_MULTIPLE (2) |
450 / 900 MHz and 2.4 GHz - Multiple band support More... | |
#define | mac_i_pan_coordinator (0x0B) |
Attribute id of mac_i_pan_coordinator PIB. More... | |
#define | MAX_CHANNEL (26) |
Maximum channel. More... | |
#define | MAX_FRAME_DURATION |
Maximum number of symbols in a frame for the current PHY. More... | |
#define | MAX_SYMBOL_TIME (0x0FFFFFFF) |
The maximum time in symbols for a 32 bit timer. More... | |
#define | MIN_CHANNEL (11) |
Minimum channel. More... | |
#define | NO_OF_SYMBOLS_PREAMBLE_SFD |
Number of symbols forming the synchronization header (SHR) for the current PHY. More... | |
#define | NO_SYMBOLS_PREAMBLE (8) |
Number of symbols included in the preamble. More... | |
#define | NO_SYMBOLS_SFD (2) |
Number of symbols included in the SFD field. More... | |
#define | NUM_TRX 1 |
#define | RF_BAND BAND_2400 |
RF band. More... | |
#define | SYMBOL_MASK (0x0FFFFFFF) |
Symbol mask for ignoring most significant nibble. More... | |
#define | SYMBOLS_PER_OCTET (2) |
Symbols per octet. More... | |
#define | TAL_BIT_MASK(ADDR, MASK, POS) MASK |
Get bit mask from sub register definition. More... | |
#define | TAL_BIT_POS(ADDR, MASK, POS) POS |
Get bit position from sub register definition. More... | |
#define | TAL_CONVERT_SYMBOLS_TO_US(trx_id, symbols) |
#define | TAL_GET_BEACON_INTERVAL_TIME(BO) ((1UL * aBaseSuperframeDuration) << (BO)) |
Beacon Interval time in symbols. More... | |
#define | TAL_GET_SUPERFRAME_DURATION_TIME(SO) ((1UL * aBaseSuperframeDuration) << (SO)) |
Superframe Duration time in symbols. More... | |
#define | VALID_CHANNEL_MASK (0x07FFF800UL) |
Valid channel masks for scanning. More... | |
Typedefs | |
typedef enum csma_mode_tag | csma_mode_t |
CSMA Mode supported by transceiver. More... | |
typedef struct frame_info_tag | frame_info_t |
Globally used frame information structure. More... | |
typedef enum sleep_mode_tag | sleep_mode_t |
Sleep Mode supported by transceiver. More... | |
typedef __PACK__DATA__ struct tal_pib_tag | tal_pib_t |
Enumerations | |
enum | csma_mode_tag { NO_CSMA_NO_IFS, NO_CSMA_WITH_IFS, CSMA_UNSLOTTED, CSMA_SLOTTED } |
CSMA Mode supported by transceiver. More... | |
enum | SHORTENUM { ASSOCIATIONREQUEST = (0x01), ASSOCIATIONRESPONSE, DISASSOCIATIONNOTIFICATION, DATAREQUEST, PANIDCONFLICTNOTIFICAION, ORPHANNOTIFICATION, BEACONREQUEST, COORDINATORREALIGNMENT, GTSREQUEST, ORPHANREALIGNMENT, BEACON_MESSAGE, DATAREQUEST_IMPL_POLL, NULL_FRAME, MCPS_MESSAGE, DISCOVERY_REQUEST = 0x01, DISCOVERY_RESPONSE = 0x02, PAIR_REQUEST = 0x03, PAIR_RESPONSE = 0x04, UNPAIR_REQUEST = 0x05, KEY_SEED = 0x06, PING_REQUEST = 0x07, PING_RESPONSE = 0x08 } |
MAC Message types. More... | |
enum | sleep_mode_tag { SLEEP_MODE_1, DEEP_SLEEP_MODE } |
Sleep Mode supported by transceiver. More... | |
Functions | |
static uint32_t | tal_add_time_symbols (uint32_t a, uint32_t b) |
Adds two time values. More... | |
void | tal_generate_rand_seed (void) |
Generates a 16-bit random number used as initial seed for srand() More... | |
retval_t | tal_init (void) |
Initializes the TAL. More... | |
static uint32_t | tal_sub_time_symbols (uint32_t a, uint32_t b) |
Subtract two time values. More... | |
void | tal_task (void) |
TAL task handling. More... | |
Variables | |
tal_pib_t | tal_pib [NUM_TRX] |
TAL PIBs. More... | |
#define BAND_2400 (1) |
2.4 GHz (channels 11 through 26)
#define BAND_900 (0) |
868 / 910 MHz (channels 0 through 10) using BPSK
#define BAND_MULTIPLE (2) |
450 / 900 MHz and 2.4 GHz - Multiple band support
#define mac_i_pan_coordinator (0x0B) |
Attribute id of mac_i_pan_coordinator PIB.
Referenced by mlme_start_request(), tal_pib_get(), and tal_pib_set().
#define MAX_CHANNEL (26) |
Maximum channel.
Referenced by per_mode_initiator_ed_end_cb(), and start_ed_scan().
#define MAX_FRAME_DURATION |
Maximum number of symbols in a frame for the current PHY.
This value is the base for the PHY PIB attribute phyMaxFrameDuration.
Referenced by apply_channel_page_configuration(), and recalc_macMaxFrameTotalWaitTime().
#define MAX_SYMBOL_TIME (0x0FFFFFFF) |
The maximum time in symbols for a 32 bit timer.
Referenced by tal_sub_time_symbols().
#define MIN_CHANNEL (11) |
Minimum channel.
Referenced by per_mode_initiator_ed_end_cb(), and start_ed_scan().
#define NO_OF_SYMBOLS_PREAMBLE_SFD |
Number of symbols forming the synchronization header (SHR) for the current PHY.
This value is the base for the PHY PIB attribute phySHRDuration.
Referenced by apply_channel_page_configuration().
#define NO_SYMBOLS_PREAMBLE (8) |
Number of symbols included in the preamble.
#define NO_SYMBOLS_SFD (2) |
Number of symbols included in the SFD field.
#define NUM_TRX 1 |
Referenced by ack_timout_cb(), cancel_any_reception(), cca_start(), continue_deferred_transmission(), per_mode_initiator_ed_end_cb(), per_mode_initiator_rx_cb(), per_mode_receptor_rx_cb(), send_range_test_marker_rsp(), tal_init(), tal_pib_get(), tal_pib_set(), tal_pib_set_all(), tal_reset(), tal_rx_enable(), tal_task(), tal_trx_sleep(), tal_trx_wakeup(), tal_tx_frame(), trx_irq_handler_cb(), and trx_reset().
#define RF_BAND BAND_2400 |
RF band.
#define SYMBOL_MASK (0x0FFFFFFF) |
Symbol mask for ignoring most significant nibble.
Referenced by tal_add_time_symbols(), and tal_sub_time_symbols().
#define SYMBOLS_PER_OCTET (2) |
Symbols per octet.
Referenced by apply_channel_page_configuration(), calc_frame_transmit_duration(), calculate_transaction_duration(), and tx_done_handling().
#define TAL_BIT_MASK | ( | ADDR, | |
MASK, | |||
POS | |||
) | MASK |
Get bit mask from sub register definition.
#define TAL_BIT_POS | ( | ADDR, | |
MASK, | |||
POS | |||
) | POS |
Get bit position from sub register definition.
#define TAL_CONVERT_SYMBOLS_TO_US | ( | trx_id, | |
symbols | |||
) |
Referenced by csma_backoff_calculation(), handle_gts_data_req(), mac_process_tal_tx_status(), mac_t_gts_cb(), perform_cca_twice(), process_data_ind_not_transient(), send_frame(), start_beacon_loss_timer(), start_ed_scan(), tal_convert_symbols_to_us_def(), tfa_cca_perform(), tfa_ed_sample(), and tx_done_handling().
#define TAL_GET_BEACON_INTERVAL_TIME | ( | BO | ) | ((1UL * aBaseSuperframeDuration) << (BO)) |
Beacon Interval time in symbols.
Referenced by check_beacon_reception(), process_data_ind_not_transient(), start_beacon_loss_timer(), and tal_tx_frame().
#define TAL_GET_SUPERFRAME_DURATION_TIME | ( | SO | ) | ((1UL * aBaseSuperframeDuration) << (SO)) |
Superframe Duration time in symbols.
Referenced by csma_backoff_calculation(), handle_gts_data_req(), mac_t_gts_cb(), and process_data_ind_not_transient().
#define VALID_CHANNEL_MASK (0x07FFF800UL) |
Valid channel masks for scanning.
typedef enum csma_mode_tag csma_mode_t |
CSMA Mode supported by transceiver.
typedef struct frame_info_tag frame_info_t |
Globally used frame information structure.
typedef enum sleep_mode_tag sleep_mode_t |
Sleep Mode supported by transceiver.
typedef __PACK__DATA__ struct tal_pib_tag tal_pib_t |
enum csma_mode_tag |
enum SHORTENUM |
MAC Message types.
enum sleep_mode_tag |
|
inlinestatic |
Adds two time values.
This function adds two time values
a | Time value 1 |
b | Time value 2 |
References SYMBOL_MASK.
Referenced by check_beacon_reception(), csma_backoff_calculation(), process_data_ind_not_transient(), and tal_tx_frame().
|
inlinestatic |
Subtract two time values.
This function subtracts two time values taking care of roll over.
a | Time value 1 |
b | Time value 2 |
References MAX_SYMBOL_TIME, and SYMBOL_MASK.
Referenced by csma_backoff_calculation(), process_data_ind_not_transient(), and tal_tx_frame().
void tal_task | ( | void | ) |
TAL task handling.
This function
This function
References Assert, BB_IRQ_AGCH, BB_IRQ_AGCR, BB_IRQ_NO_IRQ, BB_IRQ_RXAM, BB_IRQ_RXEM, BB_IRQ_RXFE, BB_IRQ_RXFS, BB_IRQ_TXFE, cca_done_handling(), CMD_RX_AACK_ON, CMD_RX_ON, csma_continue(), ENTER_CRITICAL_REGION, handle_batmon_irq(), handle_ed_end_irq(), handle_rx_end_irq(), handle_trxerr(), handle_tx_end_irq(), LEAVE_CRITICAL_REGION, NULL, NUM_TRX, process_incoming_frame(), RF_IRQ_BATLOW, RF_IRQ_EDC, RF_IRQ_IQIFSF, RF_IRQ_TRXERR, RF_IRQ_TRXRDY, RF_IRQ_WAKEUP, set_trx_state(), slotted_csma_state_handling(), switch_to_rx(), TAL_BB_IRQ_CLR, tal_bb_irqs, tal_buf_shortage, TAL_IDLE, tal_incoming_frame_queue, tal_pib, TAL_RF_IRQ_CLR, tal_rf_irqs, tal_rx_buffer, tal_rx_on_required, TAL_SLEEP, TAL_SLOTTED_CSMA, tal_state, TAL_TX_AUTO, TAL_TX_DONE, TX_CCATX, tx_done_handling(), and tx_state.
Referenced by performance_analyzer_task(), and wpan_task().
TAL PIBs.
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().