The MCR20A Wireless UART application functions as an wireless UART bridge between two (one-to-one) or several (one to many) boards. The application can be used with both a TERM, or with software that is capable of opening a serial port and writing to or reading from it. The characters sent or received are not necessarily ASCII printable characters.

Dependencies:   fsl_phy_mcr20a fsl_smac mbed-rtos mbed

Fork of mcr20_wireless_uart by Freescale

By default, the application uses broadcast addresses for OTA communication. This way, the application can be directly downloaded and run without any user intervention. The following use case assumes no changes have been done to the project.

  • Two (or more) MCR20A platforms (plugged into the FRDM-K64F Freescale Freedom Development platform) have to be connected to the PC using the mini/micro-USB cables.
  • The code must be downloaded on the platforms via CMSIS-DAP (or other means).
  • After that, two or more TERM applications must be opened, and the serial ports must be configured with the same baud rate as the one in the project (default baud rate is 115200). Other necessary serial configurations are 8 bit, no parity, and 1 stop bit.
  • To start the setup, each platform must be reset, and one of the (user) push buttons found on the MCR20A platform must be pressed. The user can press any of the non-reset buttons on the FRDM-K64F Freescale Freedom Development platform as well. *This initiates the state machine of the application so user can start.

Documentation

SMAC Demo Applications User Guide

Committer:
cotigac
Date:
Sun Mar 15 06:08:30 2015 +0000
Revision:
16:549f2f246ece
Minor updates to compile also online

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cotigac 16:549f2f246ece 1 /*!
cotigac 16:549f2f246ece 2 * Copyright (c) 2015, Freescale Semiconductor, Inc.
cotigac 16:549f2f246ece 3 * All rights reserved.
cotigac 16:549f2f246ece 4 *
cotigac 16:549f2f246ece 5 * \file PhyDebug.h
cotigac 16:549f2f246ece 6 *
cotigac 16:549f2f246ece 7 * Redistribution and use in source and binary forms, with or without modification,
cotigac 16:549f2f246ece 8 * are permitted provided that the following conditions are met:
cotigac 16:549f2f246ece 9 *
cotigac 16:549f2f246ece 10 * o Redistributions of source code must retain the above copyright notice, this list
cotigac 16:549f2f246ece 11 * of conditions and the following disclaimer.
cotigac 16:549f2f246ece 12 *
cotigac 16:549f2f246ece 13 * o Redistributions in binary form must reproduce the above copyright notice, this
cotigac 16:549f2f246ece 14 * list of conditions and the following disclaimer in the documentation and/or
cotigac 16:549f2f246ece 15 * other materials provided with the distribution.
cotigac 16:549f2f246ece 16 *
cotigac 16:549f2f246ece 17 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
cotigac 16:549f2f246ece 18 * contributors may be used to endorse or promote products derived from this
cotigac 16:549f2f246ece 19 * software without specific prior written permission.
cotigac 16:549f2f246ece 20 *
cotigac 16:549f2f246ece 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
cotigac 16:549f2f246ece 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
cotigac 16:549f2f246ece 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
cotigac 16:549f2f246ece 24 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
cotigac 16:549f2f246ece 25 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
cotigac 16:549f2f246ece 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
cotigac 16:549f2f246ece 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
cotigac 16:549f2f246ece 28 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
cotigac 16:549f2f246ece 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
cotigac 16:549f2f246ece 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cotigac 16:549f2f246ece 31 */
cotigac 16:549f2f246ece 32
cotigac 16:549f2f246ece 33 #ifndef _PHY_DEBUG_H_
cotigac 16:549f2f246ece 34 #define _PHY_DEBUG_H_
cotigac 16:549f2f246ece 35
cotigac 16:549f2f246ece 36
cotigac 16:549f2f246ece 37 /************************************************************************************
cotigac 16:549f2f246ece 38 *************************************************************************************
cotigac 16:549f2f246ece 39 * Includes
cotigac 16:549f2f246ece 40 *************************************************************************************
cotigac 16:549f2f246ece 41 ************************************************************************************/
cotigac 16:549f2f246ece 42 //#include "MacPhyDebug.h"
cotigac 16:549f2f246ece 43
cotigac 16:549f2f246ece 44
cotigac 16:549f2f246ece 45 // a value of zero disables the logging of that event
cotigac 16:549f2f246ece 46 #define PDBG_SET_EVENT_TRIGGER 0x01 // 2 parameters
cotigac 16:549f2f246ece 47 #define PDBG_SET_EVENT_TIMEOUT 0x02 // 3 parameters
cotigac 16:549f2f246ece 48 #define PDBG_DISABLE_EVENT_TIMEOUT 0x03
cotigac 16:549f2f246ece 49 #define PDBG_READ_CLOCK 0x04
cotigac 16:549f2f246ece 50 #define PDBG_INIT_EVENT_TIMER 0
cotigac 16:549f2f246ece 51
cotigac 16:549f2f246ece 52 #define PDBG_WTRMRK_VECT_INTERRUPT 0x06
cotigac 16:549f2f246ece 53 #define PDBG_TIMERS_VECT_INTERRUPT 0x07
cotigac 16:549f2f246ece 54 #define PDBG_TX_VECT_INTERRUPT 0x08
cotigac 16:549f2f246ece 55 #define PDBG_RX_VECT_INTERRUPT 0x09
cotigac 16:549f2f246ece 56
cotigac 16:549f2f246ece 57 #define PDBG_CCA_CONFIRM_IDLE 0x0A
cotigac 16:549f2f246ece 58 #define PDBG_CCA_CONFIRM_BUSY 0x0B
cotigac 16:549f2f246ece 59 #define PDBG_DATA_CONFIRM 0x0C
cotigac 16:549f2f246ece 60 #define PDBG_DATA_INDICATION 0x0D
cotigac 16:549f2f246ece 61 #define PDBG_ED_CONFIRM 0x0E
cotigac 16:549f2f246ece 62 #define PDBG_SYNC_LOSS_INDICATION 0x0F
cotigac 16:549f2f246ece 63
cotigac 16:549f2f246ece 64 #define PDBG_UNLOCK_IRQ 0x10
cotigac 16:549f2f246ece 65 #define PDBG_WTRMARK_IRQ 0x11
cotigac 16:549f2f246ece 66 #define PDBG_START_INDICATION 0x12
cotigac 16:549f2f246ece 67 #define PDBG_TIMEOUT_INDICATION 0x13
cotigac 16:549f2f246ece 68 #define PDBG_TMR1_IRQ 0x14
cotigac 16:549f2f246ece 69 #define PDBG_TMR4_IRQ 0x15
cotigac 16:549f2f246ece 70 #define PDBG_FILTER_FAIL_IRQ 0x16
cotigac 16:549f2f246ece 71 #define PDBG_TX_IRQ 0x17
cotigac 16:549f2f246ece 72 #define PDBG_RX_IRQ 0x18 // 1 parameter
cotigac 16:549f2f246ece 73 #define PDBG_CCA_IRQ 0x19
cotigac 16:549f2f246ece 74 #define PDBG_SEQ_IRQ 0x1A // 1 parameter
cotigac 16:549f2f246ece 75
cotigac 16:549f2f246ece 76 #define PDBG_PHY_INIT 0x20
cotigac 16:549f2f246ece 77 #define PDBG_PHY_ABORT 0x21
cotigac 16:549f2f246ece 78 #define PDBG_PP_SET_PROMISC 0
cotigac 16:549f2f246ece 79 #define PDBG_PP_SET_PANID_PAN0 0x23
cotigac 16:549f2f246ece 80 #define PDBG_PP_SET_SHORTADDR_PAN0 0x24
cotigac 16:549f2f246ece 81 #define PDBG_PP_SET_LONGADDR_PAN0 0x25
cotigac 16:549f2f246ece 82 #define PDBG_PP_SET_MACROLE_PAN0 0x26
cotigac 16:549f2f246ece 83 #define PDBG_PP_ADD_INDIRECT 0x27 // 1 parameter
cotigac 16:549f2f246ece 84 #define PDBG_PP_REMOVE_INDIRECT 0x28 // 1 parameter
cotigac 16:549f2f246ece 85 #define PDBG_PP_READ_LATEST_INDEX 0x29 // 1 parameter
cotigac 16:549f2f246ece 86
cotigac 16:549f2f246ece 87 #define PDBG_DATA_REQUEST 0x30
cotigac 16:549f2f246ece 88 #define PDBG_PLME_RX_REQUEST 0x31
cotigac 16:549f2f246ece 89 #define PDBG_PLME_CCA_ED_REQUEST 0x32
cotigac 16:549f2f246ece 90 #define PDBG_PLME_SET_CHAN_REQUEST 0x33
cotigac 16:549f2f246ece 91 #define PDBG_PLME_SET_POWER_REQUEST 0x34
cotigac 16:549f2f246ece 92 #define PDBG_PLME_WAIT_REQUEST 0x35
cotigac 16:549f2f246ece 93
cotigac 16:549f2f246ece 94 #define PDBG_PP_SET_PANID_PAN1 0x36
cotigac 16:549f2f246ece 95 #define PDBG_PP_SET_SHORTADDR_PAN1 0x37
cotigac 16:549f2f246ece 96 #define PDBG_PP_SET_LONGADDR_PAN1 0x38
cotigac 16:549f2f246ece 97 #define PDBG_PP_SET_MACROLE_PAN1 0x39
cotigac 16:549f2f246ece 98
cotigac 16:549f2f246ece 99 //simple events - without timestamp
cotigac 16:549f2f246ece 100 //***** PDBG_MAC_FUNCTION_CALL PDBG_SIMPLE_EVENT // 3 parameters
cotigac 16:549f2f246ece 101 #define PDBG_READ_FSM PDBG_SIMPLE_EVENT + 0x01 // 1 parameter
cotigac 16:549f2f246ece 102 #define PDBG_FILTER_FAIL_CODE PDBG_SIMPLE_EVENT + 0x02 // 2 parameters
cotigac 16:549f2f246ece 103
cotigac 16:549f2f246ece 104
cotigac 16:549f2f246ece 105 #ifdef MAC_PHY_DEBUG
cotigac 16:549f2f246ece 106
cotigac 16:549f2f246ece 107 #define DEBUG_LOG_ENTRIES 768
cotigac 16:549f2f246ece 108
cotigac 16:549f2f246ece 109 #define PHY_DEBUG_LOG(item) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogTime(item);}
cotigac 16:549f2f246ece 110 #define PHY_DEBUG_LOG1(item,param) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogTime(PDBG_EXTENDED_EVENT | item);PhyDebugLogParam1(item,param);}
cotigac 16:549f2f246ece 111 #define PHY_DEBUG_LOG2(item,param1,param2) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogTime(PDBG_EXTENDED_EVENT | item);PhyDebugLogParam2(item,param1,param2);}
cotigac 16:549f2f246ece 112 #define PHY_DEBUG_LOG3(item,param1,param2,param3) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogTime(PDBG_EXTENDED_EVENT | item);PhyDebugLogParam3(item,param1,param2,param3);}
cotigac 16:549f2f246ece 113
cotigac 16:549f2f246ece 114 #define PHY_DEBUG_LOG_SIMPLE1(item,param) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogParam1(item,param);}
cotigac 16:549f2f246ece 115 #define PHY_DEBUG_LOG_SIMPLE2(item,param1,param2) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogParam2(item,param1,param2);}
cotigac 16:549f2f246ece 116 #define PHY_DEBUG_LOG_SIMPLE3(item,param1,param2,param3) if(PDBG_RESERVED_EVENT!=item){PhyDebugLogParam3(item,param1,param2,param3);}
cotigac 16:549f2f246ece 117
cotigac 16:549f2f246ece 118 void PhyUnexpectedTransceiverReset(void);
cotigac 16:549f2f246ece 119
cotigac 16:549f2f246ece 120 void PhyDebugLogTime(uint8_t item);
cotigac 16:549f2f246ece 121 void PhyDebugLogParam1(uint8_t item, uint8_t param1);
cotigac 16:549f2f246ece 122 void PhyDebugLogParam2(uint8_t item, uint8_t param1, uint8_t param2);
cotigac 16:549f2f246ece 123 void PhyDebugLogParam3(uint8_t item, uint8_t param1, uint8_t param2, uint8_t param3);
cotigac 16:549f2f246ece 124
cotigac 16:549f2f246ece 125
cotigac 16:549f2f246ece 126 #else /* not def MAC_PHY_DEBUG */
cotigac 16:549f2f246ece 127
cotigac 16:549f2f246ece 128 #define PhyUnexpectedTransceiverReset()
cotigac 16:549f2f246ece 129
cotigac 16:549f2f246ece 130 #define PHY_DEBUG_LOG(item)
cotigac 16:549f2f246ece 131 #define PHY_DEBUG_LOG1(item,param)
cotigac 16:549f2f246ece 132 #define PHY_DEBUG_LOG2(item,param1,param2)
cotigac 16:549f2f246ece 133 #define PHY_DEBUG_LOG3(item,param1,param2,param3)
cotigac 16:549f2f246ece 134
cotigac 16:549f2f246ece 135 #define PHY_DEBUG_LOG_SIMPLE1(item,param)
cotigac 16:549f2f246ece 136 #define PHY_DEBUG_LOG_SIMPLE2(item,param1,param2)
cotigac 16:549f2f246ece 137 #define PHY_DEBUG_LOG_SIMPLE3(item,param1,param2,param3)
cotigac 16:549f2f246ece 138
cotigac 16:549f2f246ece 139 #endif /* MAC_PHY_DEBUG */
cotigac 16:549f2f246ece 140
cotigac 16:549f2f246ece 141
cotigac 16:549f2f246ece 142 #endif /* _PHY_DEBUG_H_ */
cotigac 16:549f2f246ece 143
cotigac 16:549f2f246ece 144
cotigac 16:549f2f246ece 145