Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
test15_4_phy_tests.c File Reference

PHY Test Functions. More...

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include "ca821x_api.h"
#include "test15_4_phy_tests.h"
Include dependency graph for test15_4_phy_tests.c:

Macros

#define M1P5(x)   ((x) + ((x) >> 1)) /* multiply by 1.5 */
 

Functions

void PHYTestModeHandler (struct ca821x_dev *pDeviceRef)
 Dispatch Branch for PHY Tests including Initialisation. More...
 
uint8_t PHYTestInitialise (struct ca821x_dev *pDeviceRef)
 Sequential Initialisation of TDME. More...
 
void PHYTestDeinitialise (struct ca821x_dev *pDeviceRef)
 Deinitialisation of TDME. More...
 
uint8_t PHYTestTransmitPacket (struct ca821x_dev *pDeviceRef)
 PHY Test Transmit Packet. More...
 
void PHYTestReceivePacketPER (struct ca821x_dev *pDeviceRef)
 PHY Test Receive Packet in PER Mode (Packet Error Rate) More...
 
void PHYTestReceivePacketPSN (struct ca821x_dev *pDeviceRef)
 PHY Test Receive Packet in in PSN Mode (Packet Sniffer) More...
 
void PHYTestReceiveED (struct ca821x_dev *pDeviceRef)
 PHY Test Receive in ED Detect Mode (Energy Sniffer) More...
 
uint8_t PHYTestLOLocking (struct ca821x_dev *pDeviceRef)
 PHY Test LO_3 (Locking) Test. More...
 
void PHYTestExit (char *errmsg)
 PHY Test Mode Exit. More...
 
void PHYTestInitTestResults (void)
 PHY Test Initialise Results and Run Parameters. More...
 
void PHYTestReset (void)
 PHY Test Reset Testmode PIB. More...
 
void PHYTestStatistics (uint8_t mode, uint8_t ed, uint8_t cs, uint8_t fo)
 Calculate Test Statistics. More...
 
uint32_t PHYTest_divu32round (uint32_t va, uint32_t vb)
 Division of Unsigned 32-Bit Values with Rounding. More...
 
int32_t PHYTest_divs32round (int32_t va, int32_t vb)
 Division of Signed 32-Bit Values with Rounding. More...
 
uint8_t PHYTestCalculateReportTime (uint8_t init)
 Calculate Time when to report Results. More...
 
void PHYTestReportTestMode (void)
 Report Test Mode after Initialisation is done. More...
 
void PHYTestReportTestParameters (uint8_t parameter)
 Report Test Parameter PIB. More...
 
void PHYTestReportPacketTransmitted (struct MAC_Message *msg, uint8_t status)
 Report Successful Transmission of Packet. More...
 
void PHYTestReportTransmitPacketAnalysis (void)
 Report Packet Transmission Analysis. More...
 
void PHYTestReportPacketReceived (struct TDME_RXPKT_indication_pset *params)
 Report Reception of Packet. More...
 
void PHYTestReportReceivedPacketAnalysis (void)
 Report Packet Reception Analysis. More...
 
void PHYTestReportTestResult (void)
 Report Complete Test Result. More...
 
void PHYTestReportEDReceived (struct TDME_EDDET_indication_pset *params)
 Report Reception of ED above Threshold. More...
 
void PHYTestReportLOLocking (struct TDME_LOTLK_confirm_pset *params, uint8_t ntest)
 Report LO Test 3 Result (Locking Test) More...
 
void PHYTestCfg (uint8_t val)
 PHY Change Test Configuration. More...
 
uint8_t PHY_TESTMODE_request (uint8_t testmode, struct ca821x_dev *pDeviceRef)
 PHY Test Wrapper for TDME_TESTMODE_request_sync. More...
 
uint8_t PHY_SET_request (uint8_t attribute, struct ca821x_dev *pDeviceRef)
 PHY Test Wrapper for TDME_SET_request_sync. More...
 
uint8_t PHY_TXPKT_request (struct MAC_Message *msg, struct ca821x_dev *pDeviceRef)
 PHY Test Wrapper for TDME_TXPKT_request_sync. More...
 
uint8_t PHY_LOTLK_request (uint8_t ch, uint8_t rx_txb, uint8_t ntest, struct ca821x_dev *pDeviceRef)
 PHY Test Wrapper for TDME_LOTLK_request_sync. More...
 
int PHY_RXPKT_indication (struct TDME_RXPKT_indication_pset *params, struct ca821x_dev *pDeviceRef)
 PHY Test Wrapper for TDME_RXPKT_indication. More...
 
int PHY_EDDET_indication (struct TDME_EDDET_indication_pset *params, struct ca821x_dev *pDeviceRef)
 PHY Test Wrapper for TDME_EDDET_indication. More...
 

Variables

uint8_t PHY_TESTMODE
 
struct PHYTestPar PHY_TESTPAR
 
struct PHYTestRes PHY_TESTRES
 
uint8_t PHY_TEST_INITIALISED
 

Detailed Description

PHY Test Functions.

Macro Definition Documentation

◆ M1P5

#define M1P5 (   x)    ((x) + ((x) >> 1)) /* multiply by 1.5 */

Function Documentation

◆ PHY_EDDET_indication()

int PHY_EDDET_indication ( struct TDME_EDDET_indication_pset params,
struct ca821x_dev pDeviceRef 
)

PHY Test Wrapper for TDME_EDDET_indication.

Parameters
params- eddet indication buffer
pDeviceRef- Device reference
Returns
Status

◆ PHY_LOTLK_request()

uint8_t PHY_LOTLK_request ( uint8_t  ch,
uint8_t  rx_txb,
uint8_t  ntest,
struct ca821x_dev pDeviceRef 
)

PHY Test Wrapper for TDME_LOTLK_request_sync.

Parameters
ch- 802.15.4 Channel to be tested
rx_txb- rx Mode to be tested when 1, Tx Mode when 0#
ntest- Number of Test
pDeviceRef- Device reference
Returns
Status

◆ PHY_RXPKT_indication()

int PHY_RXPKT_indication ( struct TDME_RXPKT_indication_pset params,
struct ca821x_dev pDeviceRef 
)

PHY Test Wrapper for TDME_RXPKT_indication.

Parameters
params- rxpkt indication buffer
pDeviceRef- Device reference
Returns
Status

◆ PHY_SET_request()

uint8_t PHY_SET_request ( uint8_t  evbme_attribute,
struct ca821x_dev pDeviceRef 
)

PHY Test Wrapper for TDME_SET_request_sync.

Parameters
evbme_attribute- TDME Attribute
pDeviceRef- Device reference
Returns
Status

◆ PHY_TESTMODE_request()

uint8_t PHY_TESTMODE_request ( uint8_t  testmode,
struct ca821x_dev pDeviceRef 
)

PHY Test Wrapper for TDME_TESTMODE_request_sync.

Parameters
testmode- Test mode
pDeviceRef- Device reference
Returns
Status

◆ PHY_TXPKT_request()

uint8_t PHY_TXPKT_request ( struct MAC_Message msg,
struct ca821x_dev pDeviceRef 
)

PHY Test Wrapper for TDME_TXPKT_request_sync.

Parameters
msg- TDME TxPktReq MAC Message
pDeviceRef- Device reference
Returns
Status

◆ PHYTest_divs32round()

int32_t PHYTest_divs32round ( int32_t  va,
int32_t  vb 
)

Division of Signed 32-Bit Values with Rounding.

Parameters
va- Dividend
vb- Divisor
Returns
Result

◆ PHYTest_divu32round()

uint32_t PHYTest_divu32round ( uint32_t  va,
uint32_t  vb 
)

Division of Unsigned 32-Bit Values with Rounding.

Parameters
va- Dividend
vb- Divisor
Returns
Result

◆ PHYTestCalculateReportTime()

uint8_t PHYTestCalculateReportTime ( uint8_t  init)

Calculate Time when to report Results.

Parameters
init- Initialise when 1
Returns
1: report results

◆ PHYTestCfg()

void PHYTestCfg ( uint8_t  val)

PHY Change Test Configuration.

Parameters
val- Value to set the Configurations to

◆ PHYTestDeinitialise()

void PHYTestDeinitialise ( struct ca821x_dev pDeviceRef)

Deinitialisation of TDME.

Parameters
pDeviceRef- Device reference

◆ PHYTestExit()

void PHYTestExit ( char *  errmsg)

PHY Test Mode Exit.

Parameters
errmsg- Status to be reported

◆ PHYTestInitialise()

uint8_t PHYTestInitialise ( struct ca821x_dev pDeviceRef)

Sequential Initialisation of TDME.

Parameters
pDeviceRef- Device reference
Returns
Status

◆ PHYTestInitTestResults()

void PHYTestInitTestResults ( void  )

PHY Test Initialise Results and Run Parameters.

◆ PHYTestLOLocking()

uint8_t PHYTestLOLocking ( struct ca821x_dev pDeviceRef)

PHY Test LO_3 (Locking) Test.

Parameters
pDeviceRef- Device reference
Returns
Status

◆ PHYTestModeHandler()

void PHYTestModeHandler ( struct ca821x_dev pDeviceRef)

Dispatch Branch for PHY Tests including Initialisation.

Parameters
pDeviceRef- Device reference

◆ PHYTestReceiveED()

void PHYTestReceiveED ( struct ca821x_dev pDeviceRef)

PHY Test Receive in ED Detect Mode (Energy Sniffer)

Parameters
pDeviceRef- Device reference

◆ PHYTestReceivePacketPER()

void PHYTestReceivePacketPER ( struct ca821x_dev pDeviceRef)

PHY Test Receive Packet in PER Mode (Packet Error Rate)

Parameters
pDeviceRef- Device reference

◆ PHYTestReceivePacketPSN()

void PHYTestReceivePacketPSN ( struct ca821x_dev pDeviceRef)

PHY Test Receive Packet in in PSN Mode (Packet Sniffer)

Parameters
pDeviceRef- Device reference

◆ PHYTestReportEDReceived()

void PHYTestReportEDReceived ( struct TDME_EDDET_indication_pset params)

Report Reception of ED above Threshold.

◆ PHYTestReportLOLocking()

void PHYTestReportLOLocking ( struct TDME_LOTLK_confirm_pset params,
uint8_t  ntest 
)

Report LO Test 3 Result (Locking Test)

Parameters
ntest- Number of Test
params- TDME LOTLK confirm buffer

◆ PHYTestReportPacketReceived()

void PHYTestReportPacketReceived ( struct TDME_RXPKT_indication_pset params)

Report Reception of Packet.

◆ PHYTestReportPacketTransmitted()

void PHYTestReportPacketTransmitted ( struct MAC_Message msg,
uint8_t  status 
)

Report Successful Transmission of Packet.

◆ PHYTestReportReceivedPacketAnalysis()

void PHYTestReportReceivedPacketAnalysis ( void  )

Report Packet Reception Analysis.

◆ PHYTestReportTestMode()

void PHYTestReportTestMode ( void  )

Report Test Mode after Initialisation is done.

◆ PHYTestReportTestParameters()

void PHYTestReportTestParameters ( uint8_t  parameter)

Report Test Parameter PIB.

Parameters
parameter- Specific Parameter or PHY_TESTPAR_ALL

◆ PHYTestReportTestResult()

void PHYTestReportTestResult ( void  )

Report Complete Test Result.

◆ PHYTestReportTransmitPacketAnalysis()

void PHYTestReportTransmitPacketAnalysis ( void  )

Report Packet Transmission Analysis.

◆ PHYTestReset()

void PHYTestReset ( void  )

PHY Test Reset Testmode PIB.

◆ PHYTestStatistics()

void PHYTestStatistics ( uint8_t  mode,
uint8_t  ed,
uint8_t  cs,
uint8_t  fo 
)

Calculate Test Statistics.

Parameters
modemode: accumulation, initialisation, rollover report, final report rollover - rollover for reporting when 1 final - final calculations for end of test reporting
ed- Test Packet energy Detect Value
cs- Test Packet carrier sense value
fo- Test Packet count of falloffs

◆ PHYTestTransmitPacket()

uint8_t PHYTestTransmitPacket ( struct ca821x_dev pDeviceRef)

PHY Test Transmit Packet.

Parameters
pDeviceRef- Device reference
Returns
Status

Variable Documentation

◆ PHY_TEST_INITIALISED

uint8_t PHY_TEST_INITIALISED

◆ PHY_TESTMODE

uint8_t PHY_TESTMODE

◆ PHY_TESTPAR

struct PHYTestPar PHY_TESTPAR

◆ PHY_TESTRES

struct PHYTestRes PHY_TESTRES