Thread

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 ConnectivityMenus.c
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 #include "ConnectivityMenus.h"
andreikovacs 0:4eb2240dbd22 34
andreikovacs 0:4eb2240dbd22 35 /************************************************************************************
andreikovacs 0:4eb2240dbd22 36 *************************************************************************************
andreikovacs 0:4eb2240dbd22 37 * Public memory declarations
andreikovacs 0:4eb2240dbd22 38 *************************************************************************************
andreikovacs 0:4eb2240dbd22 39 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 40
andreikovacs 0:4eb2240dbd22 41 char * const cu8FreescaleLogo[]={
andreikovacs 0:4eb2240dbd22 42 "\f\r\n",
andreikovacs 0:4eb2240dbd22 43 "\n\r\n\r\n\r #\n",
andreikovacs 0:4eb2240dbd22 44 "\r ###\n",
andreikovacs 0:4eb2240dbd22 45 "\r ### *\n",
andreikovacs 0:4eb2240dbd22 46 "\r # ***\n",
andreikovacs 0:4eb2240dbd22 47 "\r *** #\n",
andreikovacs 0:4eb2240dbd22 48 "\r * ###\n",
andreikovacs 0:4eb2240dbd22 49 "\r ###\n",
andreikovacs 0:4eb2240dbd22 50 "\r * #\n",
andreikovacs 0:4eb2240dbd22 51 "\r ***\n",
andreikovacs 0:4eb2240dbd22 52 "\r *** #\n",
andreikovacs 0:4eb2240dbd22 53 "\r # * ###\n",
andreikovacs 0:4eb2240dbd22 54 "\r ### ###\n",
andreikovacs 0:4eb2240dbd22 55 "\r ### * # F R E E S C A L E\n",
andreikovacs 0:4eb2240dbd22 56 "\r # ***\n",
andreikovacs 0:4eb2240dbd22 57 "\r *** S E M I C O N D U C T O R\n",
andreikovacs 0:4eb2240dbd22 58 "\r # *\n",
andreikovacs 0:4eb2240dbd22 59 "\r ### 2 0 1 5\n",
andreikovacs 0:4eb2240dbd22 60 "\r ###\n",
andreikovacs 0:4eb2240dbd22 61 "\r # Connectivity Test Demo\n\n",
andreikovacs 0:4eb2240dbd22 62 "\r\n -Press enter to start",
andreikovacs 0:4eb2240dbd22 63 NULL
andreikovacs 0:4eb2240dbd22 64 };
andreikovacs 0:4eb2240dbd22 65
phy_sam 8:c37e57032093 66 char * const cu8IupuiLogo[]={ " \r IUPUI DEPARTMENT OF \n"
phy_sam 8:c37e57032093 67 "\r ELECTRICAL AND COMPUTER ENGINEERING \n "
phy_sam 8:c37e57032093 68 " \r LAB ON THREAD COMMNICATION \n"
phy_sam 8:c37e57032093 69 "\r\n -Press enter to start",
phy_sam 8:c37e57032093 70 NULL
phy_sam 8:c37e57032093 71 };
phy_sam 8:c37e57032093 72
andreikovacs 0:4eb2240dbd22 73 /*@CMA, Conn Test. New string*/
andreikovacs 0:4eb2240dbd22 74 char * const cu8MainMenu[]={
andreikovacs 0:4eb2240dbd22 75 "\f\r Connectivity Test Interface short cuts\n",
andreikovacs 0:4eb2240dbd22 76 "\r------------------------------------------\n",
andreikovacs 0:4eb2240dbd22 77 "\r -Press [t] for Tx operation\n",
andreikovacs 0:4eb2240dbd22 78 "\r -Press [r] for Rx operation\n",
andreikovacs 0:4eb2240dbd22 79 "\r -Press [q] for channel up\n",
andreikovacs 0:4eb2240dbd22 80 "\r -Press [w] for channel down\n",
andreikovacs 0:4eb2240dbd22 81 "\r -Press [a] for Power up\n",
andreikovacs 0:4eb2240dbd22 82 "\r -Press [s] for Power down\n",
andreikovacs 0:4eb2240dbd22 83 "\r -Press [n] to increase the Payload\n",
andreikovacs 0:4eb2240dbd22 84 "\r -Press [m] to decrease the Payload\n",
andreikovacs 0:4eb2240dbd22 85 "\r -Press [k] to increase CCA Threshold in Carrier Sense Test\n",
andreikovacs 0:4eb2240dbd22 86 "\r -Press [l] to decrease CCA Threshold in Carrier Sense Test\n",
andreikovacs 0:4eb2240dbd22 87 "\r These keys can be used all over the application to change \n",
andreikovacs 0:4eb2240dbd22 88 "\r the test parameters\n",
andreikovacs 0:4eb2240dbd22 89 "\r ________________________________\n",
andreikovacs 0:4eb2240dbd22 90 "\r | |\n",
andreikovacs 0:4eb2240dbd22 91 "\r | Select the Test to perform |\n",
andreikovacs 0:4eb2240dbd22 92 "\r |________________________________|\n",
andreikovacs 0:4eb2240dbd22 93 "\r -Press [1] Continuous tests\n",
andreikovacs 0:4eb2240dbd22 94 "\r -Press [2] Packet Error Rate test\n",
andreikovacs 0:4eb2240dbd22 95 "\r -Press [3] Range test\n",
andreikovacs 0:4eb2240dbd22 96 "\r -Press [4] Carrier Sense and Transmission Control menu\n",
andreikovacs 0:4eb2240dbd22 97 "\r -Press [5] Radio registers edit\n",
andreikovacs 0:4eb2240dbd22 98 "\r -Press [p] Reset MCU\n\r\n",
andreikovacs 0:4eb2240dbd22 99 NULL
andreikovacs 0:4eb2240dbd22 100 };
andreikovacs 0:4eb2240dbd22 101
andreikovacs 0:4eb2240dbd22 102 /*@CMA, Conn Test. New string*/
andreikovacs 0:4eb2240dbd22 103 char * const cu8ShortCutsBar[]={
andreikovacs 0:4eb2240dbd22 104 "\f\r\n",
andreikovacs 0:4eb2240dbd22 105 "\r----------------------------------------------------\n",
andreikovacs 0:4eb2240dbd22 106 "\r [t] Tx [q] Ch+ [a] Pw+ [n] Pyld+ [l] CCAThr-\n",
andreikovacs 0:4eb2240dbd22 107 "\r [r] Rx [w] Ch- [s] Pw- [m] Pyld- [k] CCAThr+\n",
andreikovacs 0:4eb2240dbd22 108 "\r----------------------------------------------------\n\r",
andreikovacs 0:4eb2240dbd22 109 NULL
andreikovacs 0:4eb2240dbd22 110 };
andreikovacs 0:4eb2240dbd22 111
andreikovacs 0:4eb2240dbd22 112 char * const cu8ContinuousTestMenu[]={
andreikovacs 0:4eb2240dbd22 113 "\r __________________________ \n",
andreikovacs 0:4eb2240dbd22 114 "\r| |\n",
andreikovacs 0:4eb2240dbd22 115 "\r| Continuous Test Menu |\n",
andreikovacs 0:4eb2240dbd22 116 "\r|__________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 117 "\r-Press [1] Idle\n",
andreikovacs 0:4eb2240dbd22 118 "\r-Press [2] Burst PRBS Transmission using packet mode\n",
andreikovacs 0:4eb2240dbd22 119 "\r-Press [3] Continuous Modulated Transmission\n",
andreikovacs 0:4eb2240dbd22 120 "\r-Press [4] Continuous Unmodulated Transmission\n",
andreikovacs 0:4eb2240dbd22 121 "\r-Press [5] Continuous Reception\n",
andreikovacs 0:4eb2240dbd22 122 "\r-Press [6] Continuous Energy Detect\n",
andreikovacs 0:4eb2240dbd22 123 "\r-Press [7] Continuous Scan\n",
andreikovacs 0:4eb2240dbd22 124 "\r-Press [8] Continuous Cca\n"
andreikovacs 0:4eb2240dbd22 125 "\r-Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 126 "\rNow Running: ",
andreikovacs 0:4eb2240dbd22 127 NULL
andreikovacs 0:4eb2240dbd22 128 };
andreikovacs 0:4eb2240dbd22 129
andreikovacs 0:4eb2240dbd22 130 char * const cu8PerTxTestMenu[]={
andreikovacs 0:4eb2240dbd22 131 "\r ____________________________ \n",
andreikovacs 0:4eb2240dbd22 132 "\r | |\n",
andreikovacs 0:4eb2240dbd22 133 "\r | PER Tx Test Menu |\n",
andreikovacs 0:4eb2240dbd22 134 "\r |____________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 135 "\r Choose the amount of packets to send:\n",
andreikovacs 0:4eb2240dbd22 136 "\r [0] - 1 Packet [1] - 25 Packets\n",
andreikovacs 0:4eb2240dbd22 137 "\r [2] - 100 Packets [3] - 500 Packets\n",
andreikovacs 0:4eb2240dbd22 138 "\r [4] - 1000 Packets [5] - 2000 Packets\n",
andreikovacs 0:4eb2240dbd22 139 "\r [6] - 5000 Packets [7] - 10000 Packets\n",
andreikovacs 0:4eb2240dbd22 140 "\r [8] - 65535 Packets\n\r\n",
andreikovacs 0:4eb2240dbd22 141 "\r-Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 142 NULL
andreikovacs 0:4eb2240dbd22 143 };
andreikovacs 0:4eb2240dbd22 144
andreikovacs 0:4eb2240dbd22 145 char * const cu8PerRxTestMenu[]={
andreikovacs 0:4eb2240dbd22 146 "\r ______________________ \n",
andreikovacs 0:4eb2240dbd22 147 "\r | |\n",
andreikovacs 0:4eb2240dbd22 148 "\r | PER Rx Test Menu |\n",
andreikovacs 0:4eb2240dbd22 149 "\r |______________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 150 "\r -Press [space bar] to start/stop Receiving Packets\n",
andreikovacs 0:4eb2240dbd22 151 "\r -Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 152 NULL
andreikovacs 0:4eb2240dbd22 153 };
andreikovacs 0:4eb2240dbd22 154
andreikovacs 0:4eb2240dbd22 155 char * const cu8RangeTxTestMenu[]={
andreikovacs 0:4eb2240dbd22 156 "\r ________________________ \n",
andreikovacs 0:4eb2240dbd22 157 "\r | |\n",
andreikovacs 0:4eb2240dbd22 158 "\r | Range Tx Test Menu |\n",
andreikovacs 0:4eb2240dbd22 159 "\r |________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 160 "\r -Press [space bar] to start/stop Transmiting Packets\n",
andreikovacs 0:4eb2240dbd22 161 "\r -Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 162 NULL
andreikovacs 0:4eb2240dbd22 163 };
andreikovacs 0:4eb2240dbd22 164
andreikovacs 0:4eb2240dbd22 165 char * const cu8RangeRxTestMenu[]={
andreikovacs 0:4eb2240dbd22 166 "\r ________________________ \n",
andreikovacs 0:4eb2240dbd22 167 "\r | |\n",
andreikovacs 0:4eb2240dbd22 168 "\r | Range Rx Test Menu |\n",
andreikovacs 0:4eb2240dbd22 169 "\r |________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 170 "\r -Press [space bar] to start/stop Receiving Packets\n",
andreikovacs 0:4eb2240dbd22 171 "\r -Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 172 NULL
andreikovacs 0:4eb2240dbd22 173 };
andreikovacs 0:4eb2240dbd22 174
andreikovacs 0:4eb2240dbd22 175 /*@CMA, Conn Test. New menu*/
andreikovacs 0:4eb2240dbd22 176 char * const cu8RadioRegistersEditMenu[]={
andreikovacs 0:4eb2240dbd22 177 "\r ____________________________ \n",
andreikovacs 0:4eb2240dbd22 178 "\r | |\n",
andreikovacs 0:4eb2240dbd22 179 "\r | Radio Registers Edit Menu |\n",
andreikovacs 0:4eb2240dbd22 180 "\r |____________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 181 "\r -Press [1] Write Direct Registers\n",
andreikovacs 0:4eb2240dbd22 182 "\r -Press [2] Read Direct Registers\n",
andreikovacs 0:4eb2240dbd22 183 "\r -Press [3] Write Indirect Registers\n",
andreikovacs 0:4eb2240dbd22 184 "\r -Press [4] Read Indirect Registers\n",
andreikovacs 0:4eb2240dbd22 185 "\r -Press [5] Dump All Registers\n",
andreikovacs 0:4eb2240dbd22 186 "\r -Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 187 NULL
andreikovacs 0:4eb2240dbd22 188 };
andreikovacs 0:4eb2240dbd22 189
andreikovacs 0:4eb2240dbd22 190 char * const cu8RadioCSTCSelectMenu[]={
andreikovacs 0:4eb2240dbd22 191 "\r ___________________________________________________________ \n",
andreikovacs 0:4eb2240dbd22 192 "\r | |\n",
andreikovacs 0:4eb2240dbd22 193 "\r | Radio Carrier Sense and Transmission Control Select Menu |\n",
andreikovacs 0:4eb2240dbd22 194 "\r |___________________________________________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 195 "\r -Press [1] Carrier Sense Test with un-modulation input signal\n",
andreikovacs 0:4eb2240dbd22 196 "\r -Press [2] Transmission Control Test\n",
andreikovacs 0:4eb2240dbd22 197 "\r -Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 198 NULL
andreikovacs 0:4eb2240dbd22 199 };
andreikovacs 0:4eb2240dbd22 200
andreikovacs 0:4eb2240dbd22 201 char * const cu8CsTcTestMenu[]={
andreikovacs 0:4eb2240dbd22 202 "\r ____________________________ \n",
andreikovacs 0:4eb2240dbd22 203 "\r | |\n",
andreikovacs 0:4eb2240dbd22 204 "\r | Tr Ctrl Test Menu |\n",
andreikovacs 0:4eb2240dbd22 205 "\r |____________________________|\n\r\n",
andreikovacs 0:4eb2240dbd22 206 "\r Choose the amount of packets to send:\n",
andreikovacs 0:4eb2240dbd22 207 "\r [0] - 1 Packet [1] - 25 Packets\n",
andreikovacs 0:4eb2240dbd22 208 "\r [2] - 100 Packets [3] - 500 Packets\n",
andreikovacs 0:4eb2240dbd22 209 "\r [4] - 1000 Packets [5] - 2000 Packets\n",
andreikovacs 0:4eb2240dbd22 210 "\r [6] - 5000 Packets [7] - 10000 Packets\n",
andreikovacs 0:4eb2240dbd22 211 "\r [8] - 65535 Packets\n\r\n",
andreikovacs 0:4eb2240dbd22 212 "\r-Press [p] Previous Menu\n\r\n",
andreikovacs 0:4eb2240dbd22 213 NULL
andreikovacs 0:4eb2240dbd22 214 };
andreikovacs 0:4eb2240dbd22 215
andreikovacs 0:4eb2240dbd22 216 char * const cu8SelectTags[] ={
andreikovacs 0:4eb2240dbd22 217 " Channel select ",
andreikovacs 0:4eb2240dbd22 218 " Power select ",
andreikovacs 0:4eb2240dbd22 219 " Test Tx select ",
andreikovacs 0:4eb2240dbd22 220 " Test Rx select ",
andreikovacs 0:4eb2240dbd22 221 "Trim coarse tune",
andreikovacs 0:4eb2240dbd22 222 " Trim fine tune "
andreikovacs 0:4eb2240dbd22 223 };
andreikovacs 0:4eb2240dbd22 224
andreikovacs 0:4eb2240dbd22 225 char * const cu8TxTestTags[] ={
andreikovacs 0:4eb2240dbd22 226 " PER Tx ",
andreikovacs 0:4eb2240dbd22 227 " Range Tx ",
andreikovacs 0:4eb2240dbd22 228 " Cont. Idle ",
andreikovacs 0:4eb2240dbd22 229 " Cont. PRBS9 ",
andreikovacs 0:4eb2240dbd22 230 "Cont. Modulated ",
andreikovacs 0:4eb2240dbd22 231 "Cont. Unmodulatd"
andreikovacs 0:4eb2240dbd22 232 };
andreikovacs 0:4eb2240dbd22 233
andreikovacs 0:4eb2240dbd22 234 char * const cu8RxTestTags[] ={
andreikovacs 0:4eb2240dbd22 235 " PER Rx ",
andreikovacs 0:4eb2240dbd22 236 " Range Rx ",
andreikovacs 0:4eb2240dbd22 237 "Cont. Reception ",
andreikovacs 0:4eb2240dbd22 238 " Cont. Scan ",
andreikovacs 0:4eb2240dbd22 239 "Cont.Energy Det."
andreikovacs 0:4eb2240dbd22 240 };
andreikovacs 0:4eb2240dbd22 241
andreikovacs 0:4eb2240dbd22 242 char * const cu8TxModTestTags[] ={
andreikovacs 0:4eb2240dbd22 243 "0's\r\n",
andreikovacs 0:4eb2240dbd22 244 "1's\r\n",
andreikovacs 0:4eb2240dbd22 245 "\b\b\b\b\b PN9\r\n"
andreikovacs 0:4eb2240dbd22 246 };
andreikovacs 0:4eb2240dbd22 247
andreikovacs 0:4eb2240dbd22 248 char * const cu8ContinuousTestTags[] ={
andreikovacs 0:4eb2240dbd22 249 "Idle mode",
andreikovacs 0:4eb2240dbd22 250 "Continuous Tx Modulated - All ",
andreikovacs 0:4eb2240dbd22 251 "Continuous Tx Unmodulated",
andreikovacs 0:4eb2240dbd22 252 "Continuous PRBS9"
andreikovacs 0:4eb2240dbd22 253 };
andreikovacs 0:4eb2240dbd22 254
andreikovacs 0:4eb2240dbd22 255 /************************************************************************************
andreikovacs 0:4eb2240dbd22 256 *************************************************************************************
andreikovacs 0:4eb2240dbd22 257 * Private prototypes
andreikovacs 0:4eb2240dbd22 258 *************************************************************************************
andreikovacs 0:4eb2240dbd22 259 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 260
andreikovacs 0:4eb2240dbd22 261
andreikovacs 0:4eb2240dbd22 262 /************************************************************************************
andreikovacs 0:4eb2240dbd22 263 *************************************************************************************
andreikovacs 0:4eb2240dbd22 264 * Private memory declarations
andreikovacs 0:4eb2240dbd22 265 *************************************************************************************
andreikovacs 0:4eb2240dbd22 266 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 267
andreikovacs 0:4eb2240dbd22 268
andreikovacs 0:4eb2240dbd22 269 /************************************************************************************
andreikovacs 0:4eb2240dbd22 270 *************************************************************************************
andreikovacs 0:4eb2240dbd22 271 * Interface functions
andreikovacs 0:4eb2240dbd22 272 *************************************************************************************
andreikovacs 0:4eb2240dbd22 273 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 274
andreikovacs 0:4eb2240dbd22 275 /************************************************************************************
andreikovacs 0:4eb2240dbd22 276 *************************************************************************************
andreikovacs 0:4eb2240dbd22 277 * private functions
andreikovacs 0:4eb2240dbd22 278 *************************************************************************************
andreikovacs 0:4eb2240dbd22 279 ************************************************************************************/
andreikovacs 0:4eb2240dbd22 280
andreikovacs 0:4eb2240dbd22 281