Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Performs the ED scan functionalities.

Macros

#define CALCULATE_SYMBOL_TIME_SCAN_DURATION(SD)   (aBaseSuperframeDuration * ((1UL << (SD)) + 1))
 
#define CLIP_VALUE_REG   (56)
 

Functions

void ed_scan_done (void)
 Scan done. More...
 
retval_t tal_ed_start (uint8_t scan_duration)
 Starts ED Scan. More...
 
static void trx_ed_irq_handler_cb (void)
 ED Scan Interrupt. More...
 

Variables

static uint8_t max_ed_level
 The peak_ed_level is the maximum ED value received from the transceiver for the specified Scan Duration. More...
 
static uint32_t sampler_counter
 

#define CALCULATE_SYMBOL_TIME_SCAN_DURATION (   SD)    (aBaseSuperframeDuration * ((1UL << (SD)) + 1))

Referenced by tal_ed_start().

#define CLIP_VALUE_REG   (56)

Referenced by ed_scan_done().

void ed_scan_done ( void  )
retval_t tal_ed_start ( uint8_t  scan_duration)

Starts ED Scan.

This function starts an ED Scan for the scan duration specified by the MAC layer.

Parameters
scan_durationSpecifies the ED scan duration in symbols
Returns
MAC_SUCCESS - ED scan duration timer started successfully TAL_BUSY - TAL is busy servicing the previous request from MAC TAL_TRX_ASLEEP - Transceiver is currently sleeping FAILURE otherwise

References Assert, CALCULATE_SYMBOL_TIME_SCAN_DURATION, CMD_FORCE_PLL_ON, CMD_RX_ON, ED_SAMPLE_DURATION_SYM, FAILURE, FUNC_PTR, MAC_SUCCESS, max_ed_level, pal_trx_irq_dis, pal_trx_irq_en, RG_IRQ_MASK, RG_IRQ_STATUS, RG_PHY_ED_LEVEL, RX_DISABLE, RX_ENABLE, RX_ON, sampler_counter, set_trx_state(), SR_IRQ_MASK, SR_RX_PDT_DIS, TAL_BUSY, TAL_ED_RUNNING, TAL_IDLE, tal_state, TAL_TRX_ASLEEP, tal_trx_status, trx_bit_write(), trx_ed_irq_handler_cb(), TRX_IRQ_4_CCA_ED_DONE, TRX_IRQ_DEFAULT, trx_irq_handler_cb(), trx_irq_init(), trx_reg_read(), trx_reg_write(), and TRX_SLEEP.

Referenced by per_mode_initiator_ed_end_cb(), and start_ed_scan().

static void trx_ed_irq_handler_cb ( void  )
static

ED Scan Interrupt.

This function handles an ED done interrupt from the transceiver.

References Assert, max_ed_level, RG_IRQ_STATUS, RG_PHY_ED_LEVEL, sampler_counter, TAL_ED_DONE, tal_state, TRX_IRQ_0_PLL_LOCK, TRX_IRQ_4_CCA_ED_DONE, trx_reg_read(), and trx_reg_write().

Referenced by tal_ed_start().

uint8_t max_ed_level
static

The peak_ed_level is the maximum ED value received from the transceiver for the specified Scan Duration.

Referenced by ed_scan_done(), tal_ed_start(), and trx_ed_irq_handler_cb().

uint32_t sampler_counter
static