Microchip® Advanced Software Framework

tal_auto_rx.c File Reference

This file implements function to handle received frames.

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

#include "tal_config.h"
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "pal.h"
#include "return_val.h"
#include "tal.h"
#include "ieee_const.h"
#include "stack_config.h"
#include "bmm.h"
#include "qmm.h"
#include "tal_pib.h"
#include "tal_internal.h"

Functions

void complete_rx_transaction (trx_id_t trx_id)
 Completes Rx transaction. More...
 
static void handle_incoming_frame (trx_id_t trx_id)
 Handles incoming frame from transceiver. More...
 
void handle_rx_end_irq (trx_id_t trx_id)
 Handle received frame interrupt. More...
 
void process_incoming_frame (trx_id_t trx_id, buffer_t *buf_ptr)
 Parses received frame and create the frame_info_t structure. More...
 
static bool upload_frame (trx_id_t trx_id)
 Parses received frame and create the frame_info_t structure. More...
 

Variables

frame_info_trx_frm_info [NUM_TRX]
 

void complete_rx_transaction ( trx_id_t  trx_id)

Completes Rx transaction.

Parameters
trx_idTransceiver identifier

References frame_info_tag::mpdu, NULL, RF_BASE_ADDR_OFFSET, RG_RF09_EDV, tal_incoming_frame_queue, tal_pib, and tal_rx_buffer.

Referenced by ack_transmission_done(), handle_incoming_frame(), and handle_rx_end_irq().

void handle_rx_end_irq ( trx_id_t  trx_id)

Handle received frame interrupt.

This function handles transceiver interrupts for received frames.

Parameters
trx_idTransceiver identifier

References complete_rx_transaction(), FSK, handle_incoming_frame(), RF_BASE_ADDR_OFFSET, RF_RX, RG_RF09_CMD, SR_BBC0_AMCS_AACK, SR_BBC0_AMCS_AACKFT, SR_BBC0_FSKPHRRX_FCST, SR_BBC0_FSKPHRRX_MS, start_rpc(), stop_rpc(), stop_tal_timer(), switch_to_rx(), TAL_IDLE, tal_pib, tal_state, trx_state, TX_BACKOFF, TX_DEFER, tx_state, and upload_frame().

Referenced by tal_task().

void process_incoming_frame ( trx_id_t  trx_id,
buffer_t *  buf_ptr 
)

Parses received frame and create the frame_info_t structure.

This function parses the received frame and creates the frame_info_t structure to be sent to the MAC as a parameter of tal_rx_frame_cb().

Parameters
trx_idTransceiver identifier
buf_ptrPointer to the buffer containing the received frame

References frame_info_tag::buffer_header, frame_info_tag::mpdu, scale_ed_value(), tal_pib, and tal_rx_frame_cb().

static bool upload_frame ( trx_id_t  trx_id)
static

Parses received frame and create the frame_info_t structure.

This function parses the received frame and creates the frame_info_t structure to be sent to the MAC as a parameter of tal_rx_frame_cb().

Parameters
trx_idTransceiver identifier

References Assert, BB_RX_FRM_BUF_OFFSET, ED_VAL_LEN, fs_tstamp, LQI_LEN, frame_info_tag::mpdu, NULL, RF_BASE_ADDR_OFFSET, RG_BBC0_FBRXS, RG_BBC0_RXFLL, tal_pib, tal_rx_buffer, and frame_info_tag::time_stamp.

Referenced by handle_rx_end_irq().

frame_info_t* rx_frm_info[NUM_TRX]

Referenced by is_ack_valid(), and is_frame_an_ack().