Microchip® Advanced Software Framework

at86rf233/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 "at86rf233.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
 TAL PIBs. More...
 
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...
 
tal_state_t tal_state
 Current state of the TAL state machine. More...
 
uint32_t tal_timestamp
 Timestamp The timestamping is only required for beaconing networks or if timestamping is explicitly enabled. More...
 
tal_trx_status_t tal_trx_status
 Current state of the transceiver. More...
 

#define PLL_LOCK_ATTEMPTS   (3)

uint32_t tal_convert_symbols_to_us_def ( uint32_t  symbols)

Conversion of symbols to microseconds.

TAL task handling.

References TAL_CONVERT_SYMBOLS_TO_US.

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.

This function

  • handles any pending IRQ flags
  • Processes the TAL incoming frame queue. The function needs to be called on a regular basis.

References Assert, CMD_RX_AACK_ON, CMD_RX_ON, NULL, process_incoming_frame(), set_trx_state(), slotted_csma_state_handling(), TAL_IDLE, tal_incoming_frame_queue, tal_pib, tal_rx_buffer, tal_rx_on_required, TAL_SLOTTED_CSMA, tal_state, TAL_TX_AUTO, TAL_TX_DONE, and tx_done_handling().

uint8_t last_frame_length
frame_info_t* mac_frame_ptr

Frame pointer for the frame structure provided by the MCL.

volatile bool tal_awake_end_flag
csma_state_t tal_csma_state

CSMA state machine variable.

uint8_t* tal_frame_to_tx

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

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.

tal_pib_t tal_pib

TAL PIBs.

buffer_t* tal_rx_buffer = NULL

Pointer to receive buffer that can be used to upload a frame from the trx.

uint32_t tal_timestamp

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

Referenced by handle_received_frame_irq(), handle_tx_end_irq(), and trx_irq_handler_cb().