Connectivity

Dependencies:   fsl_phy_mcr20a fsl_smac mbed-rtos mbed

Fork of mcr20_connectivity_test_FRDMk64f by samuel belete

Committer:
phy_sam
Date:
Thu Aug 18 16:25:26 2016 +0000
Revision:
8:c37e57032093
Parent:
0:4eb2240dbd22
FRDM K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andreikovacs 0:4eb2240dbd22 1 /*!
andreikovacs 0:4eb2240dbd22 2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
andreikovacs 0:4eb2240dbd22 3 * All rights reserved.
andreikovacs 0:4eb2240dbd22 4 *
andreikovacs 0:4eb2240dbd22 5 * \file Application_Interface.h
andreikovacs 0:4eb2240dbd22 6 *
andreikovacs 0:4eb2240dbd22 7 * Redistribution and use in source and binary forms, with or without modification,
andreikovacs 0:4eb2240dbd22 8 * are permitted provided that the following conditions are met:
andreikovacs 0:4eb2240dbd22 9 *
andreikovacs 0:4eb2240dbd22 10 * o Redistributions of source code must retain the above copyright notice, this list
andreikovacs 0:4eb2240dbd22 11 * of conditions and the following disclaimer.
andreikovacs 0:4eb2240dbd22 12 *
andreikovacs 0:4eb2240dbd22 13 * o Redistributions in binary form must reproduce the above copyright notice, this
andreikovacs 0:4eb2240dbd22 14 * list of conditions and the following disclaimer in the documentation and/or
andreikovacs 0:4eb2240dbd22 15 * other materials provided with the distribution.
andreikovacs 0:4eb2240dbd22 16 *
andreikovacs 0:4eb2240dbd22 17 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
andreikovacs 0:4eb2240dbd22 18 * contributors may be used to endorse or promote products derived from this
andreikovacs 0:4eb2240dbd22 19 * software without specific prior written permission.
andreikovacs 0:4eb2240dbd22 20 *
andreikovacs 0:4eb2240dbd22 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
andreikovacs 0:4eb2240dbd22 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
andreikovacs 0:4eb2240dbd22 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
andreikovacs 0:4eb2240dbd22 24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
andreikovacs 0:4eb2240dbd22 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
andreikovacs 0:4eb2240dbd22 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
andreikovacs 0:4eb2240dbd22 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
andreikovacs 0:4eb2240dbd22 28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
andreikovacs 0:4eb2240dbd22 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
andreikovacs 0:4eb2240dbd22 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
andreikovacs 0:4eb2240dbd22 31 */
andreikovacs 0:4eb2240dbd22 32
andreikovacs 0:4eb2240dbd22 33 #ifndef __SMAC_APPLICATION_CONF_H__
andreikovacs 0:4eb2240dbd22 34 #define __SMAC_APPLICATION_CONF_H__
andreikovacs 0:4eb2240dbd22 35
andreikovacs 0:4eb2240dbd22 36 #include "MemManager.h"
andreikovacs 0:4eb2240dbd22 37 #include "ConnectivityMenus.h" /*Defines the Application menus*/
andreikovacs 0:4eb2240dbd22 38
andreikovacs 0:4eb2240dbd22 39 #include "SMAC_Interface.h" /*@CMA Conn Test*/
andreikovacs 0:4eb2240dbd22 40 #include "FunctionLib.h"
andreikovacs 0:4eb2240dbd22 41 #include "AspInterface.h"
andreikovacs 0:4eb2240dbd22 42 #ifdef gPHY_802_15_4g_d
andreikovacs 0:4eb2240dbd22 43 #include "PhyTime.h"
andreikovacs 0:4eb2240dbd22 44 #endif
andreikovacs 0:4eb2240dbd22 45
andreikovacs 0:4eb2240dbd22 46 #include "mbed.h"
andreikovacs 0:4eb2240dbd22 47 #include "rtos.h"
andreikovacs 0:4eb2240dbd22 48
andreikovacs 0:4eb2240dbd22 49
andreikovacs 0:4eb2240dbd22 50
andreikovacs 0:4eb2240dbd22 51 /* BEGIN Configuration Parameters Definition */
andreikovacs 0:4eb2240dbd22 52 typedef enum ConnectivityStates_tag
andreikovacs 0:4eb2240dbd22 53 {
andreikovacs 0:4eb2240dbd22 54 gConnInitState_c,
andreikovacs 0:4eb2240dbd22 55 gConnIdleState_c,
andreikovacs 0:4eb2240dbd22 56 gConnSelectTest_c,
andreikovacs 0:4eb2240dbd22 57 gConnContinuousTxRxState_c,
andreikovacs 0:4eb2240dbd22 58 gConnPerState_c,
andreikovacs 0:4eb2240dbd22 59 gConnRangeState_c,
andreikovacs 0:4eb2240dbd22 60 gConnRegEditState_c,
andreikovacs 0:4eb2240dbd22 61 gConnSetChannelState_c,
andreikovacs 0:4eb2240dbd22 62 gConnSetPowerState_c,
andreikovacs 0:4eb2240dbd22 63 gConnSetTxTestState_c,
andreikovacs 0:4eb2240dbd22 64 gConnSetRxTestState_c,
andreikovacs 0:4eb2240dbd22 65 gConnSetTrimCoarseState_c,
andreikovacs 0:4eb2240dbd22 66 gConnSetTrimFineState_c,
andreikovacs 0:4eb2240dbd22 67 gConnContinuousTxState_c,
andreikovacs 0:4eb2240dbd22 68 gConnPerTxState_c,
andreikovacs 0:4eb2240dbd22 69 gConnRangeTxState_c,
andreikovacs 0:4eb2240dbd22 70 gConnContinuousRxState_c,
andreikovacs 0:4eb2240dbd22 71 gConnPerRxState_c,
andreikovacs 0:4eb2240dbd22 72 gConnRangeRxState_c,
andreikovacs 0:4eb2240dbd22 73 gConnBitrateSelectState_c,
andreikovacs 0:4eb2240dbd22 74 gConnCSenseAndTCtrl_c,
andreikovacs 0:4eb2240dbd22 75 gConnEDMeasCalib_c,
andreikovacs 0:4eb2240dbd22 76 gConnMaxState_c
andreikovacs 0:4eb2240dbd22 77 }ConnectivityStates_t;
andreikovacs 0:4eb2240dbd22 78
andreikovacs 0:4eb2240dbd22 79
andreikovacs 0:4eb2240dbd22 80 typedef enum ContinuousTxRxTestStates_tag
andreikovacs 0:4eb2240dbd22 81 {
andreikovacs 0:4eb2240dbd22 82 gCTxRxStateInit_c,
andreikovacs 0:4eb2240dbd22 83 gCTxRxStateIdle_c,
andreikovacs 0:4eb2240dbd22 84 gCTxRxStateSelectTest_c,
andreikovacs 0:4eb2240dbd22 85 gCTxRxStateRunnigEdTest_c,
andreikovacs 0:4eb2240dbd22 86 gCTxRxStateRunningEdTestGotResult_c,
andreikovacs 0:4eb2240dbd22 87 gCTxRxStateRunningPRBS9Test_c,
andreikovacs 0:4eb2240dbd22 88 gCTxRxStateRunnigScanTest_c,
andreikovacs 0:4eb2240dbd22 89 gCTxRxStateRunnigRxTest_c,
andreikovacs 0:4eb2240dbd22 90 gCTxRxStateRunningTXModSelectOpt,
andreikovacs 0:4eb2240dbd22 91 gCTxRxStateRunnigCcaTest_c,
andreikovacs 0:4eb2240dbd22 92 gCTxRxMaxState_c
andreikovacs 0:4eb2240dbd22 93 }ContinuousTxRxTestStates_t;
andreikovacs 0:4eb2240dbd22 94
andreikovacs 0:4eb2240dbd22 95 typedef enum PerTxStates_tag
andreikovacs 0:4eb2240dbd22 96 {
andreikovacs 0:4eb2240dbd22 97 gPerTxStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 98 gPerTxStateIdle_c,
andreikovacs 0:4eb2240dbd22 99 gPerTxStateSelectPacketNum_c,
andreikovacs 0:4eb2240dbd22 100 gPerTxStateInputPacketDelay_c,
andreikovacs 0:4eb2240dbd22 101 gPerTxStateStartTest_c,
andreikovacs 0:4eb2240dbd22 102 gPerTxStateRunningTest_c,
andreikovacs 0:4eb2240dbd22 103 gPerTxStateSendingLastFrames_c,
andreikovacs 0:4eb2240dbd22 104 gPerTxStateMaxState_c
andreikovacs 0:4eb2240dbd22 105 }PerTxStates_t;
andreikovacs 0:4eb2240dbd22 106
andreikovacs 0:4eb2240dbd22 107 typedef enum PerRxStates_tag
andreikovacs 0:4eb2240dbd22 108 {
andreikovacs 0:4eb2240dbd22 109 gPerRxStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 110 gPerRxStateIdle_c,
andreikovacs 0:4eb2240dbd22 111 gPerRxWaitStartTest_c,
andreikovacs 0:4eb2240dbd22 112 gPerRxStateStartTest_c,
andreikovacs 0:4eb2240dbd22 113 gPerRxStateRunningTest_c,
andreikovacs 0:4eb2240dbd22 114 gPerRxStateReceivingLastFrames_c,
andreikovacs 0:4eb2240dbd22 115 gPerrxStateMaxState_c
andreikovacs 0:4eb2240dbd22 116 }PerRxStates_t;
andreikovacs 0:4eb2240dbd22 117
andreikovacs 0:4eb2240dbd22 118 typedef enum RangeTxStates_tag
andreikovacs 0:4eb2240dbd22 119 {
andreikovacs 0:4eb2240dbd22 120 gRangeTxStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 121 gRangeTxStateIdle_c,
andreikovacs 0:4eb2240dbd22 122 gRangeTxWaitStartTest_c,
andreikovacs 0:4eb2240dbd22 123 gRangeTxStateStartTest_c,
andreikovacs 0:4eb2240dbd22 124 gRangeTxStateRunningTest_c,
andreikovacs 0:4eb2240dbd22 125 gRangeTxStatePrintTestResults_c,
andreikovacs 0:4eb2240dbd22 126 gRangeTxStateMaxState_c
andreikovacs 0:4eb2240dbd22 127 }RangeTxStates_t;
andreikovacs 0:4eb2240dbd22 128
andreikovacs 0:4eb2240dbd22 129 typedef enum RangeRxStates_tag
andreikovacs 0:4eb2240dbd22 130 {
andreikovacs 0:4eb2240dbd22 131 gRangeRxStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 132 gRangeRxStateIdle_c,
andreikovacs 0:4eb2240dbd22 133 gRangeRxWaitStartTest_c,
andreikovacs 0:4eb2240dbd22 134 gRangeRxStateStartTest_c,
andreikovacs 0:4eb2240dbd22 135 gRangeRxStateRunningTest_c,
andreikovacs 0:4eb2240dbd22 136 gRangeRxStatePrintTestResults_c,
andreikovacs 0:4eb2240dbd22 137 gRangeRxStateMaxState_c
andreikovacs 0:4eb2240dbd22 138 }RangeRxStates_t;
andreikovacs 0:4eb2240dbd22 139
andreikovacs 0:4eb2240dbd22 140 typedef enum CSenseTCtrlStates_tag
andreikovacs 0:4eb2240dbd22 141 {
andreikovacs 0:4eb2240dbd22 142 gCsTcStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 143 gCsTcStateSelectTest_c,
andreikovacs 0:4eb2240dbd22 144 gCsTcStateCarrierSenseStart_c,
andreikovacs 0:4eb2240dbd22 145 gCsTcStateCarrierSenseSelectType_c,
andreikovacs 0:4eb2240dbd22 146 gCsTcStateCarrierSensePerformingTest_c,
andreikovacs 0:4eb2240dbd22 147 gCsTcStateCarrierSenseEndTest_c,
andreikovacs 0:4eb2240dbd22 148 gCsTcStateTransmissionControlStart_c,
andreikovacs 0:4eb2240dbd22 149 gCsTcStateTransmissionControlSelectNumOfPackets_c,
andreikovacs 0:4eb2240dbd22 150 gCsTcStateTransmissionControlSelectInterpacketDelay_c,
andreikovacs 0:4eb2240dbd22 151 gCsTcStateTransmissionControlPerformingTest_c,
andreikovacs 0:4eb2240dbd22 152 gCsTcStateTransmissionControlEndTest_c,
andreikovacs 0:4eb2240dbd22 153 gCsTcStateMaxState_c
andreikovacs 0:4eb2240dbd22 154 }CSenseTCtrlStates_t;
andreikovacs 0:4eb2240dbd22 155
andreikovacs 0:4eb2240dbd22 156 typedef enum overrideRegistersStates_tag
andreikovacs 0:4eb2240dbd22 157 {
andreikovacs 0:4eb2240dbd22 158 gORStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 159 gORStateStart_c,
andreikovacs 0:4eb2240dbd22 160 gORWaitForTheAddress_c,
andreikovacs 0:4eb2240dbd22 161 gORWaitForTheValue_c,
andreikovacs 0:4eb2240dbd22 162 gORStateIdle_c,
andreikovacs 0:4eb2240dbd22 163 gORStateMaxState_c
andreikovacs 0:4eb2240dbd22 164 }oRStates_t;
andreikovacs 0:4eb2240dbd22 165
andreikovacs 0:4eb2240dbd22 166 typedef enum readRegistersStates_tag
andreikovacs 0:4eb2240dbd22 167 {
andreikovacs 0:4eb2240dbd22 168 gRRStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 169 gRRStateStart_c,
andreikovacs 0:4eb2240dbd22 170 gRRWaitForTheAddress_c,
andreikovacs 0:4eb2240dbd22 171 gRRStateMaxState_c
andreikovacs 0:4eb2240dbd22 172 }rRStates_t;
andreikovacs 0:4eb2240dbd22 173
andreikovacs 0:4eb2240dbd22 174 typedef enum EditRegsStates_tag
andreikovacs 0:4eb2240dbd22 175 {
andreikovacs 0:4eb2240dbd22 176 gERStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 177 gERWaitSelection_c,
andreikovacs 0:4eb2240dbd22 178 gERStateOverrideReg_c,
andreikovacs 0:4eb2240dbd22 179 gERStateReadReg_c,
andreikovacs 0:4eb2240dbd22 180 gERStateDumpAllRegs_c,
andreikovacs 0:4eb2240dbd22 181 gERStateOverrideRadioSpiReg_c,
andreikovacs 0:4eb2240dbd22 182 gERStateReadRadioSpiReg_c,
andreikovacs 0:4eb2240dbd22 183 gERStateMaxState_c
andreikovacs 0:4eb2240dbd22 184 }EditRegsStates_t;
andreikovacs 0:4eb2240dbd22 185
andreikovacs 0:4eb2240dbd22 186 typedef enum dumpRegistersStates_t
andreikovacs 0:4eb2240dbd22 187 {
andreikovacs 0:4eb2240dbd22 188 gDRStateInit_c = 0,
andreikovacs 0:4eb2240dbd22 189 gDRStateDumpRegs_c
andreikovacs 0:4eb2240dbd22 190 }dRStates_t;
andreikovacs 0:4eb2240dbd22 191 /* END Configuration Parameters Definition */
andreikovacs 0:4eb2240dbd22 192
andreikovacs 0:4eb2240dbd22 193 #define gDefaultOperationMode_c mTxOperation_c
andreikovacs 0:4eb2240dbd22 194 #define gDefaultPayload_c 20
andreikovacs 0:4eb2240dbd22 195 #define mTotalFinalFrames_c 25
andreikovacs 0:4eb2240dbd22 196
andreikovacs 0:4eb2240dbd22 197 #ifdef gPHY_802_15_4g_d
andreikovacs 0:4eb2240dbd22 198 #define gMaxChannel_c ((channels_t)(gTotalChannels - 1))
andreikovacs 0:4eb2240dbd22 199 #define gMinChannel_c (gChannel0_c)
andreikovacs 0:4eb2240dbd22 200 #else
andreikovacs 0:4eb2240dbd22 201 #define gMaxChannel_c ((channels_t)gTotalChannels)
andreikovacs 0:4eb2240dbd22 202 #define gMinChannel_c (gChannel11_c)
andreikovacs 0:4eb2240dbd22 203 #endif
andreikovacs 0:4eb2240dbd22 204
andreikovacs 0:4eb2240dbd22 205 extern smacErrors_t smacToAppMlmeSap(smacToAppMlmeMessage_t* pMsg, instanceId_t instance);
andreikovacs 0:4eb2240dbd22 206 extern smacErrors_t smacToAppMcpsSap(smacToAppDataMessage_t* pMsg, instanceId_t instance);
andreikovacs 0:4eb2240dbd22 207 extern void InitApp();
andreikovacs 0:4eb2240dbd22 208
andreikovacs 0:4eb2240dbd22 209 #endif /* __SMAC_APP_CONFIG_H__ */