Microchip® Advanced Software Framework

tal_rx.c File Reference

This file implements the frame reception functions.

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

#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_constants.h"
#include "tal_pib.h"
#include "tal_irq_handler.h"
#include "at86rf233.h"
#include "tal_rx.h"
#include "tal_internal.h"

Macros

#define ED_LEVEL_MAX_REG_VALUE   (84)
 
#define ED_LEVEL_MULTIPLIER   (255.0 / ED_LEVEL_MAX_REG_VALUE)
 
#define ED_MAX   (-RSSI_BASE_VAL_DBM - ED_THRESHOLD)
 
#define ED_THRESHOLD   (60)
 
#define LQI_MAX   (3)
 
#define US_PER_OCTECT   (32)
 

Functions

void handle_received_frame_irq (void)
 Handle received frame interrupt. More...
 
static uint8_t normalize_lqi (uint8_t lqi, uint8_t ed_value)
 Normalize LQI. More...
 
void process_incoming_frame (buffer_t *buf_ptr)
 Parses received frame and create the frame_info_t structure. More...
 

#define ED_LEVEL_MAX_REG_VALUE   (84)
#define ED_LEVEL_MULTIPLIER   (255.0 / ED_LEVEL_MAX_REG_VALUE)
#define ED_MAX   (-RSSI_BASE_VAL_DBM - ED_THRESHOLD)

Referenced by normalize_lqi().

#define ED_THRESHOLD   (60)
#define LQI_MAX   (3)

Referenced by normalize_lqi().

#define US_PER_OCTECT   (32)

static uint8_t normalize_lqi ( uint8_t  lqi,
uint8_t  ed_value 
)
inlinestatic

Normalize LQI.

This function normalizes the LQI value based on the ED and the originally appended LQI value.

Parameters
lqiMeasured LQI
ed_valueRead ED value
Returns
The calculated LQI value: ppduLinkQuality

References ED_MAX, LQI_MAX, and tal_pib.

Referenced by process_incoming_frame().