
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
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
IEEE802_14_5_PHY/AspInterface.h@18:b02fc0e53df8, 2015-04-03 (annotated)
- Committer:
- cotigac
- Date:
- Fri Apr 03 05:23:33 2015 +0000
- Revision:
- 18:b02fc0e53df8
Started creating wireless uart demo based on mbed-rtos
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cotigac | 18:b02fc0e53df8 | 1 | /*! |
cotigac | 18:b02fc0e53df8 | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
cotigac | 18:b02fc0e53df8 | 3 | * All rights reserved. |
cotigac | 18:b02fc0e53df8 | 4 | * |
cotigac | 18:b02fc0e53df8 | 5 | * \file ASP.h |
cotigac | 18:b02fc0e53df8 | 6 | * This is a header file for the ASP module. |
cotigac | 18:b02fc0e53df8 | 7 | * |
cotigac | 18:b02fc0e53df8 | 8 | * Redistribution and use in source and binary forms, with or without modification, |
cotigac | 18:b02fc0e53df8 | 9 | * are permitted provided that the following conditions are met: |
cotigac | 18:b02fc0e53df8 | 10 | * |
cotigac | 18:b02fc0e53df8 | 11 | * o Redistributions of source code must retain the above copyright notice, this list |
cotigac | 18:b02fc0e53df8 | 12 | * of conditions and the following disclaimer. |
cotigac | 18:b02fc0e53df8 | 13 | * |
cotigac | 18:b02fc0e53df8 | 14 | * o Redistributions in binary form must reproduce the above copyright notice, this |
cotigac | 18:b02fc0e53df8 | 15 | * list of conditions and the following disclaimer in the documentation and/or |
cotigac | 18:b02fc0e53df8 | 16 | * other materials provided with the distribution. |
cotigac | 18:b02fc0e53df8 | 17 | * |
cotigac | 18:b02fc0e53df8 | 18 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
cotigac | 18:b02fc0e53df8 | 19 | * contributors may be used to endorse or promote products derived from this |
cotigac | 18:b02fc0e53df8 | 20 | * software without specific prior written permission. |
cotigac | 18:b02fc0e53df8 | 21 | * |
cotigac | 18:b02fc0e53df8 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
cotigac | 18:b02fc0e53df8 | 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
cotigac | 18:b02fc0e53df8 | 24 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
cotigac | 18:b02fc0e53df8 | 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
cotigac | 18:b02fc0e53df8 | 26 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
cotigac | 18:b02fc0e53df8 | 27 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
cotigac | 18:b02fc0e53df8 | 28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
cotigac | 18:b02fc0e53df8 | 29 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
cotigac | 18:b02fc0e53df8 | 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
cotigac | 18:b02fc0e53df8 | 31 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
cotigac | 18:b02fc0e53df8 | 32 | */ |
cotigac | 18:b02fc0e53df8 | 33 | |
cotigac | 18:b02fc0e53df8 | 34 | #ifndef __ASP_H__ |
cotigac | 18:b02fc0e53df8 | 35 | #define __ASP_H__ |
cotigac | 18:b02fc0e53df8 | 36 | |
cotigac | 18:b02fc0e53df8 | 37 | /************************************************************************************ |
cotigac | 18:b02fc0e53df8 | 38 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 39 | * Include |
cotigac | 18:b02fc0e53df8 | 40 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 41 | ************************************************************************************/ |
cotigac | 18:b02fc0e53df8 | 42 | |
cotigac | 18:b02fc0e53df8 | 43 | #include "EmbeddedTypes.h" |
cotigac | 18:b02fc0e53df8 | 44 | //#include "fsl_os_abstraction.h" |
cotigac | 18:b02fc0e53df8 | 45 | #include "PhyInterface.h" |
cotigac | 18:b02fc0e53df8 | 46 | #include "MpmInterface.h" |
cotigac | 18:b02fc0e53df8 | 47 | |
cotigac | 18:b02fc0e53df8 | 48 | /************************************************************************************ |
cotigac | 18:b02fc0e53df8 | 49 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 50 | * Public macros |
cotigac | 18:b02fc0e53df8 | 51 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 52 | ************************************************************************************/ |
cotigac | 18:b02fc0e53df8 | 53 | /* Enable/Disable the ASP module */ |
cotigac | 18:b02fc0e53df8 | 54 | #ifndef gAspCapability_d |
cotigac | 18:b02fc0e53df8 | 55 | #ifndef gPHY_802_15_4g_d |
cotigac | 18:b02fc0e53df8 | 56 | #define gAspCapability_d (1) |
cotigac | 18:b02fc0e53df8 | 57 | #else |
cotigac | 18:b02fc0e53df8 | 58 | #define gAspCapability_d (0) |
cotigac | 18:b02fc0e53df8 | 59 | #endif // gPHY_802_15_4g_d |
cotigac | 18:b02fc0e53df8 | 60 | #endif // gAspCapability_d |
cotigac | 18:b02fc0e53df8 | 61 | |
cotigac | 18:b02fc0e53df8 | 62 | #define gAspInterfaceId (0) |
cotigac | 18:b02fc0e53df8 | 63 | |
cotigac | 18:b02fc0e53df8 | 64 | /* Allowed ASP Power Levels */ |
cotigac | 18:b02fc0e53df8 | 65 | #define gAspPowerLevel_m40dBm_c (uint8_t)gAspPowerLevel_m40dBm |
cotigac | 18:b02fc0e53df8 | 66 | #define gAspPowerLevel_m38dBm_c (uint8_t)gAspPowerLevel_m38dBm |
cotigac | 18:b02fc0e53df8 | 67 | #define gAspPowerLevel_m36dBm_c (uint8_t)gAspPowerLevel_m36dBm |
cotigac | 18:b02fc0e53df8 | 68 | #define gAspPowerLevel_m34dBm_c (uint8_t)gAspPowerLevel_m34dBm |
cotigac | 18:b02fc0e53df8 | 69 | #define gAspPowerLevel_m32dBm_c (uint8_t)gAspPowerLevel_m32dBm |
cotigac | 18:b02fc0e53df8 | 70 | #define gAspPowerLevel_m30dBm_c (uint8_t)gAspPowerLevel_m30dBm |
cotigac | 18:b02fc0e53df8 | 71 | #define gAspPowerLevel_m28dBm_c (uint8_t)gAspPowerLevel_m28dBm |
cotigac | 18:b02fc0e53df8 | 72 | #define gAspPowerLevel_m26dBm_c (uint8_t)gAspPowerLevel_m26dBm |
cotigac | 18:b02fc0e53df8 | 73 | #define gAspPowerLevel_m24dBm_c (uint8_t)gAspPowerLevel_m24dBm |
cotigac | 18:b02fc0e53df8 | 74 | #define gAspPowerLevel_m22dBm_c (uint8_t)gAspPowerLevel_m22dBm |
cotigac | 18:b02fc0e53df8 | 75 | #define gAspPowerLevel_m20dBm_c (uint8_t)gAspPowerLevel_m20dBm |
cotigac | 18:b02fc0e53df8 | 76 | #define gAspPowerLevel_m18dBm_c (uint8_t)gAspPowerLevel_m18dBm |
cotigac | 18:b02fc0e53df8 | 77 | #define gAspPowerLevel_m16dBm_c (uint8_t)gAspPowerLevel_m16dBm |
cotigac | 18:b02fc0e53df8 | 78 | #define gAspPowerLevel_m14dBm_c (uint8_t)gAspPowerLevel_m14dBm |
cotigac | 18:b02fc0e53df8 | 79 | #define gAspPowerLevel_m12dBm_c (uint8_t)gAspPowerLevel_m12dBm |
cotigac | 18:b02fc0e53df8 | 80 | #define gAspPowerLevel_m10dBm_c (uint8_t)gAspPowerLevel_m10dBm |
cotigac | 18:b02fc0e53df8 | 81 | #define gAspPowerLevel_m8dBm_c (uint8_t)gAspPowerLevel_m8dBm |
cotigac | 18:b02fc0e53df8 | 82 | #define gAspPowerLevel_m6dBm_c (uint8_t)gAspPowerLevel_m6dBm |
cotigac | 18:b02fc0e53df8 | 83 | #define gAspPowerLevel_m4dBm_c (uint8_t)gAspPowerLevel_m4dBm |
cotigac | 18:b02fc0e53df8 | 84 | #define gAspPowerLevel_m2dBm_c (uint8_t)gAspPowerLevel_m2dBm |
cotigac | 18:b02fc0e53df8 | 85 | #define gAspPowerLevel_0dBm_c (uint8_t)gAspPowerLevel_0dBm |
cotigac | 18:b02fc0e53df8 | 86 | #define gAspPowerLevel_2dBm_c (uint8_t)gAspPowerLevel_2dBm |
cotigac | 18:b02fc0e53df8 | 87 | #define gAspPowerLevel_4dBm_c (uint8_t)gAspPowerLevel_4dBm |
cotigac | 18:b02fc0e53df8 | 88 | #define gAspPowerLevel_6dBm_c (uint8_t)gAspPowerLevel_6dBm |
cotigac | 18:b02fc0e53df8 | 89 | #define gAspPowerLevel_8dBm_c (uint8_t)gAspPowerLevel_8dBm |
cotigac | 18:b02fc0e53df8 | 90 | #define gAspPowerLevel_10dBm_c (uint8_t)gAspPowerLevel_10dBm |
cotigac | 18:b02fc0e53df8 | 91 | #define gAspPowerLevel_12dBm_c (uint8_t)gAspPowerLevel_12dBm |
cotigac | 18:b02fc0e53df8 | 92 | #define gAspPowerLevel_14dBm_c (uint8_t)gAspPowerLevel_14dBm |
cotigac | 18:b02fc0e53df8 | 93 | #define gAspPowerLevel_16dBm_c (uint8_t)gAspPowerLevel_16dBm |
cotigac | 18:b02fc0e53df8 | 94 | |
cotigac | 18:b02fc0e53df8 | 95 | /* OpGroup codes used with FSCI */ |
cotigac | 18:b02fc0e53df8 | 96 | #define gFSCI_AspAppOpcodeGroup_c 0x94 /* ASP_APP_SapHandler */ |
cotigac | 18:b02fc0e53df8 | 97 | #define gFSCI_AppAspOpcodeGroup_c 0x95 /* APP_ASP_SapHandler */ |
cotigac | 18:b02fc0e53df8 | 98 | |
cotigac | 18:b02fc0e53df8 | 99 | /************************************************************************************ |
cotigac | 18:b02fc0e53df8 | 100 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 101 | * Public type definitions |
cotigac | 18:b02fc0e53df8 | 102 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 103 | ************************************************************************************/ |
cotigac | 18:b02fc0e53df8 | 104 | /* ASP status messages */ |
cotigac | 18:b02fc0e53df8 | 105 | typedef enum{ |
cotigac | 18:b02fc0e53df8 | 106 | gAspSuccess_c = 0x00, |
cotigac | 18:b02fc0e53df8 | 107 | gAspInvalidRequest_c = 0xC2, |
cotigac | 18:b02fc0e53df8 | 108 | gAspDenied_c = 0xE2, |
cotigac | 18:b02fc0e53df8 | 109 | gAspTooLong_c = 0xE5, |
cotigac | 18:b02fc0e53df8 | 110 | gAspInvalidParameter_c = 0xE8 |
cotigac | 18:b02fc0e53df8 | 111 | }AspStatus_t; |
cotigac | 18:b02fc0e53df8 | 112 | |
cotigac | 18:b02fc0e53df8 | 113 | /* Supported Power Levels */ |
cotigac | 18:b02fc0e53df8 | 114 | enum { |
cotigac | 18:b02fc0e53df8 | 115 | gAspPowerLevel_m40dBm = 0x03, |
cotigac | 18:b02fc0e53df8 | 116 | gAspPowerLevel_m38dBm = 0x04, |
cotigac | 18:b02fc0e53df8 | 117 | gAspPowerLevel_m36dBm = 0x05, |
cotigac | 18:b02fc0e53df8 | 118 | gAspPowerLevel_m34dBm = 0x06, |
cotigac | 18:b02fc0e53df8 | 119 | gAspPowerLevel_m32dBm = 0x07, |
cotigac | 18:b02fc0e53df8 | 120 | gAspPowerLevel_m30dBm = 0x08, |
cotigac | 18:b02fc0e53df8 | 121 | gAspPowerLevel_m28dBm = 0x09, |
cotigac | 18:b02fc0e53df8 | 122 | gAspPowerLevel_m26dBm = 0x0A, |
cotigac | 18:b02fc0e53df8 | 123 | gAspPowerLevel_m24dBm = 0x0B, |
cotigac | 18:b02fc0e53df8 | 124 | gAspPowerLevel_m22dBm = 0x0C, |
cotigac | 18:b02fc0e53df8 | 125 | gAspPowerLevel_m20dBm = 0x0D, |
cotigac | 18:b02fc0e53df8 | 126 | gAspPowerLevel_m18dBm = 0x0E, |
cotigac | 18:b02fc0e53df8 | 127 | gAspPowerLevel_m16dBm = 0x0F, |
cotigac | 18:b02fc0e53df8 | 128 | gAspPowerLevel_m14dBm = 0x10, |
cotigac | 18:b02fc0e53df8 | 129 | gAspPowerLevel_m12dBm = 0x11, |
cotigac | 18:b02fc0e53df8 | 130 | gAspPowerLevel_m10dBm = 0x12, |
cotigac | 18:b02fc0e53df8 | 131 | gAspPowerLevel_m8dBm = 0x13, |
cotigac | 18:b02fc0e53df8 | 132 | gAspPowerLevel_m6dBm = 0x14, |
cotigac | 18:b02fc0e53df8 | 133 | gAspPowerLevel_m4dBm = 0x15, |
cotigac | 18:b02fc0e53df8 | 134 | gAspPowerLevel_m2dBm = 0x16, |
cotigac | 18:b02fc0e53df8 | 135 | gAspPowerLevel_0dBm = 0x17, |
cotigac | 18:b02fc0e53df8 | 136 | gAspPowerLevel_2dBm = 0x18, |
cotigac | 18:b02fc0e53df8 | 137 | gAspPowerLevel_4dBm = 0x19, |
cotigac | 18:b02fc0e53df8 | 138 | gAspPowerLevel_6dBm = 0x1A, |
cotigac | 18:b02fc0e53df8 | 139 | gAspPowerLevel_8dBm = 0x1B, |
cotigac | 18:b02fc0e53df8 | 140 | gAspPowerLevel_10dBm = 0x1C, |
cotigac | 18:b02fc0e53df8 | 141 | gAspPowerLevel_12dBm = 0x1D, |
cotigac | 18:b02fc0e53df8 | 142 | gAspPowerLevel_14dBm = 0x1E, |
cotigac | 18:b02fc0e53df8 | 143 | gAspPowerLevel_16dBm = 0x1F |
cotigac | 18:b02fc0e53df8 | 144 | }; |
cotigac | 18:b02fc0e53df8 | 145 | |
cotigac | 18:b02fc0e53df8 | 146 | /* Radio test modes */ |
cotigac | 18:b02fc0e53df8 | 147 | enum { |
cotigac | 18:b02fc0e53df8 | 148 | gTestForceIdle_c = 0, |
cotigac | 18:b02fc0e53df8 | 149 | gTestPulseTxPrbs9_c = 1, |
cotigac | 18:b02fc0e53df8 | 150 | gTestContinuousRx_c = 2, |
cotigac | 18:b02fc0e53df8 | 151 | gTestContinuousTxMod_c = 3, |
cotigac | 18:b02fc0e53df8 | 152 | gTestContinuousTxNoMod_c = 4, |
cotigac | 18:b02fc0e53df8 | 153 | gTestContinuousTx2Mhz_c = 5, |
cotigac | 18:b02fc0e53df8 | 154 | gTestContinuousTx200Khz_c = 6, |
cotigac | 18:b02fc0e53df8 | 155 | gTestContinuousTx1MbpsPRBS9_c = 7, |
cotigac | 18:b02fc0e53df8 | 156 | gTestContinuousTxExternalSrc_c = 8, |
cotigac | 18:b02fc0e53df8 | 157 | gTestContinuousTxNoModZero_c = 9, |
cotigac | 18:b02fc0e53df8 | 158 | gTestContinuousTxNoModOne_c = 10 |
cotigac | 18:b02fc0e53df8 | 159 | }; |
cotigac | 18:b02fc0e53df8 | 160 | |
cotigac | 18:b02fc0e53df8 | 161 | /* This enum matches with the FSCI OpCode used by ASP*/ |
cotigac | 18:b02fc0e53df8 | 162 | typedef enum { |
cotigac | 18:b02fc0e53df8 | 163 | aspMsgTypeGetTimeReq_c = 0x00, |
cotigac | 18:b02fc0e53df8 | 164 | aspMsgTypeGetInactiveTimeReq_c = 0x01, |
cotigac | 18:b02fc0e53df8 | 165 | aspMsgTypeGetMacStateReq_c = 0x02, |
cotigac | 18:b02fc0e53df8 | 166 | aspMsgTypeDozeReq_c = 0x03, |
cotigac | 18:b02fc0e53df8 | 167 | aspMsgTypeAutoDozeReq_c = 0x04, |
cotigac | 18:b02fc0e53df8 | 168 | aspMsgTypeAcomaReq_c = 0x05, |
cotigac | 18:b02fc0e53df8 | 169 | aspMsgTypeHibernateReq_c = 0x06, |
cotigac | 18:b02fc0e53df8 | 170 | aspMsgTypeWakeReq_c = 0x07, |
cotigac | 18:b02fc0e53df8 | 171 | aspMsgTypeEventReq_c = 0x08, |
cotigac | 18:b02fc0e53df8 | 172 | aspMsgTypeClkoReq_c = 0x09, |
cotigac | 18:b02fc0e53df8 | 173 | aspMsgTypeTrimReq_c = 0x0A, |
cotigac | 18:b02fc0e53df8 | 174 | aspMsgTypeDdrReq_c = 0x0B, |
cotigac | 18:b02fc0e53df8 | 175 | aspMsgTypePortReq_c = 0x0C, |
cotigac | 18:b02fc0e53df8 | 176 | aspMsgTypeSetMinDozeTimeReq_c = 0x0D, |
cotigac | 18:b02fc0e53df8 | 177 | aspMsgTypeSetNotifyReq_c = 0x0E, |
cotigac | 18:b02fc0e53df8 | 178 | aspMsgTypeSetPowerLevel_c = 0x0F, |
cotigac | 18:b02fc0e53df8 | 179 | aspMsgTypeGetPowerLevel_c = 0x1F, |
cotigac | 18:b02fc0e53df8 | 180 | aspMsgTypeTelecTest_c = 0x10, |
cotigac | 18:b02fc0e53df8 | 181 | aspMsgTypeTelecSetFreq_c = 0x11, |
cotigac | 18:b02fc0e53df8 | 182 | aspMsgTypeGetInactiveTimeCnf_c = 0x12, |
cotigac | 18:b02fc0e53df8 | 183 | aspMsgTypeGetMacStateCnf_c = 0x13, |
cotigac | 18:b02fc0e53df8 | 184 | aspMsgTypeDozeCnf_c = 0x14, |
cotigac | 18:b02fc0e53df8 | 185 | aspMsgTypeAutoDozeCnf_c = 0x15, |
cotigac | 18:b02fc0e53df8 | 186 | aspMsgTypeTelecSendRawData_c = 0x16, |
cotigac | 18:b02fc0e53df8 | 187 | aspMsgTypeSetFADState_c = 0x17, |
cotigac | 18:b02fc0e53df8 | 188 | aspMsgTypeSetFADThreshold_c = 0x18, |
cotigac | 18:b02fc0e53df8 | 189 | aspMsgTypeGetFADThreshold_c = 0x19, |
cotigac | 18:b02fc0e53df8 | 190 | aspMsgTypeGetFADState_c = 0x1A, |
cotigac | 18:b02fc0e53df8 | 191 | aspMsgTypeSetActivePromState_c = 0x1B, |
cotigac | 18:b02fc0e53df8 | 192 | aspMsgTypeXcvrWriteReq_c = 0x1C, |
cotigac | 18:b02fc0e53df8 | 193 | aspMsgTypeXcvrReadReq_c = 0x1D, |
cotigac | 18:b02fc0e53df8 | 194 | aspMsgTypeSetANTXState_c = 0x20, |
cotigac | 18:b02fc0e53df8 | 195 | aspMsgTypeGetANTXState_c = 0x21, |
cotigac | 18:b02fc0e53df8 | 196 | aspMsgTypeSetLQIMode_c = 0x22, |
cotigac | 18:b02fc0e53df8 | 197 | aspMsgTypeGetRSSILevel_c = 0x23, |
cotigac | 18:b02fc0e53df8 | 198 | aspMsgTypeSetMpmConfig_c = 0x24, |
cotigac | 18:b02fc0e53df8 | 199 | aspMsgTypeGetMpmConfig_c = 0x25 |
cotigac | 18:b02fc0e53df8 | 200 | }AppAspMsgType_t; |
cotigac | 18:b02fc0e53df8 | 201 | |
cotigac | 18:b02fc0e53df8 | 202 | typedef PACKED_STRUCT aspEventReq_tag |
cotigac | 18:b02fc0e53df8 | 203 | { /* AspEvent.Request */ |
cotigac | 18:b02fc0e53df8 | 204 | uint32_t eventTime; |
cotigac | 18:b02fc0e53df8 | 205 | } aspEventReq_t; |
cotigac | 18:b02fc0e53df8 | 206 | |
cotigac | 18:b02fc0e53df8 | 207 | typedef PACKED_STRUCT aspGetTimeReq_tag |
cotigac | 18:b02fc0e53df8 | 208 | { /* AspGetTime.Request */ |
cotigac | 18:b02fc0e53df8 | 209 | uint32_t time; |
cotigac | 18:b02fc0e53df8 | 210 | } aspGetTimeReq_t; |
cotigac | 18:b02fc0e53df8 | 211 | |
cotigac | 18:b02fc0e53df8 | 212 | typedef PACKED_STRUCT aspSetNotifyReq_tag |
cotigac | 18:b02fc0e53df8 | 213 | { /* AspSetNotify.Request */ |
cotigac | 18:b02fc0e53df8 | 214 | uint8_t notifications; |
cotigac | 18:b02fc0e53df8 | 215 | } aspSetNotifyReq_t; |
cotigac | 18:b02fc0e53df8 | 216 | |
cotigac | 18:b02fc0e53df8 | 217 | |
cotigac | 18:b02fc0e53df8 | 218 | typedef PACKED_STRUCT aspSetPowerLevelReq_tag |
cotigac | 18:b02fc0e53df8 | 219 | { /* AspSetPowerLevel.Request */ |
cotigac | 18:b02fc0e53df8 | 220 | uint8_t powerLevel; |
cotigac | 18:b02fc0e53df8 | 221 | } aspSetPowerLevelReq_t; |
cotigac | 18:b02fc0e53df8 | 222 | |
cotigac | 18:b02fc0e53df8 | 223 | |
cotigac | 18:b02fc0e53df8 | 224 | typedef PACKED_STRUCT aspGetPowerLevelReq_tag |
cotigac | 18:b02fc0e53df8 | 225 | { /* AspGetPowerLevel.Request */ |
cotigac | 18:b02fc0e53df8 | 226 | uint8_t powerLevel; |
cotigac | 18:b02fc0e53df8 | 227 | } aspGetPowerLevelReq_t; |
cotigac | 18:b02fc0e53df8 | 228 | |
cotigac | 18:b02fc0e53df8 | 229 | |
cotigac | 18:b02fc0e53df8 | 230 | typedef PACKED_STRUCT aspTelecTest_tag |
cotigac | 18:b02fc0e53df8 | 231 | { /* AspTelecTest.Request */ |
cotigac | 18:b02fc0e53df8 | 232 | uint8_t mode; |
cotigac | 18:b02fc0e53df8 | 233 | } aspTelecTest_t; |
cotigac | 18:b02fc0e53df8 | 234 | |
cotigac | 18:b02fc0e53df8 | 235 | |
cotigac | 18:b02fc0e53df8 | 236 | typedef PACKED_STRUCT aspTelecsetFreq_tag |
cotigac | 18:b02fc0e53df8 | 237 | { /* AspTelecSetFreq.Request */ |
cotigac | 18:b02fc0e53df8 | 238 | uint8_t channel; |
cotigac | 18:b02fc0e53df8 | 239 | } aspTelecsetFreq_t; |
cotigac | 18:b02fc0e53df8 | 240 | |
cotigac | 18:b02fc0e53df8 | 241 | |
cotigac | 18:b02fc0e53df8 | 242 | typedef PACKED_STRUCT aspTelecSendRawData_tag |
cotigac | 18:b02fc0e53df8 | 243 | { /* AspTelecSendRawData.Request */ |
cotigac | 18:b02fc0e53df8 | 244 | uint8_t length; |
cotigac | 18:b02fc0e53df8 | 245 | uint8_t* dataPtr; |
cotigac | 18:b02fc0e53df8 | 246 | } aspTelecSendRawData_t; |
cotigac | 18:b02fc0e53df8 | 247 | |
cotigac | 18:b02fc0e53df8 | 248 | /* AspSetFADThreshold.Request */ |
cotigac | 18:b02fc0e53df8 | 249 | typedef uint8_t aspFADThreshold_t; |
cotigac | 18:b02fc0e53df8 | 250 | /* AspSetLQIMode.Request */ |
cotigac | 18:b02fc0e53df8 | 251 | typedef uint8_t aspLQIMode_t; |
cotigac | 18:b02fc0e53df8 | 252 | |
cotigac | 18:b02fc0e53df8 | 253 | typedef PACKED_STRUCT aspXcvrReq_tag |
cotigac | 18:b02fc0e53df8 | 254 | { /* AspXcvrWrite.Request / AspXcvrRead.Request */ |
cotigac | 18:b02fc0e53df8 | 255 | uint8_t mode; |
cotigac | 18:b02fc0e53df8 | 256 | uint16_t addr; |
cotigac | 18:b02fc0e53df8 | 257 | uint8_t len; |
cotigac | 18:b02fc0e53df8 | 258 | uint8_t data[4]; /* more than 4 bytes can be read/written */ |
cotigac | 18:b02fc0e53df8 | 259 | } aspXcvrReq_t; |
cotigac | 18:b02fc0e53df8 | 260 | |
cotigac | 18:b02fc0e53df8 | 261 | |
cotigac | 18:b02fc0e53df8 | 262 | typedef PACKED_STRUCT AppToAspMessage_tag |
cotigac | 18:b02fc0e53df8 | 263 | { |
cotigac | 18:b02fc0e53df8 | 264 | AppAspMsgType_t msgType; |
cotigac | 18:b02fc0e53df8 | 265 | PACKED_UNION |
cotigac | 18:b02fc0e53df8 | 266 | { |
cotigac | 18:b02fc0e53df8 | 267 | aspEventReq_t aspEventReq; |
cotigac | 18:b02fc0e53df8 | 268 | aspGetTimeReq_t aspGetTimeReq; |
cotigac | 18:b02fc0e53df8 | 269 | aspSetPowerLevelReq_t aspSetPowerLevelReq; |
cotigac | 18:b02fc0e53df8 | 270 | aspGetPowerLevelReq_t aspGetPowerLevelReq; |
cotigac | 18:b02fc0e53df8 | 271 | aspTelecTest_t aspTelecTest; |
cotigac | 18:b02fc0e53df8 | 272 | aspTelecsetFreq_t aspTelecsetFreq; |
cotigac | 18:b02fc0e53df8 | 273 | aspTelecSendRawData_t aspTelecSendRawData; |
cotigac | 18:b02fc0e53df8 | 274 | aspFADThreshold_t aspFADThreshold; |
cotigac | 18:b02fc0e53df8 | 275 | bool_t aspFADState; |
cotigac | 18:b02fc0e53df8 | 276 | bool_t aspANTXState; |
cotigac | 18:b02fc0e53df8 | 277 | aspLQIMode_t aspLQIMode; |
cotigac | 18:b02fc0e53df8 | 278 | bool_t aspActivePromState; |
cotigac | 18:b02fc0e53df8 | 279 | aspXcvrReq_t aspXcvrData; |
cotigac | 18:b02fc0e53df8 | 280 | mpmConfig_t MpmConfig; |
cotigac | 18:b02fc0e53df8 | 281 | }msgData; |
cotigac | 18:b02fc0e53df8 | 282 | } AppToAspMessage_t; |
cotigac | 18:b02fc0e53df8 | 283 | |
cotigac | 18:b02fc0e53df8 | 284 | #ifdef __cplusplus |
cotigac | 18:b02fc0e53df8 | 285 | extern "C" { |
cotigac | 18:b02fc0e53df8 | 286 | #endif |
cotigac | 18:b02fc0e53df8 | 287 | |
cotigac | 18:b02fc0e53df8 | 288 | /************************************************************************************ |
cotigac | 18:b02fc0e53df8 | 289 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 290 | * Public memory declarations |
cotigac | 18:b02fc0e53df8 | 291 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 292 | ************************************************************************************/ |
cotigac | 18:b02fc0e53df8 | 293 | |
cotigac | 18:b02fc0e53df8 | 294 | /************************************************************************************ |
cotigac | 18:b02fc0e53df8 | 295 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 296 | * Public functions |
cotigac | 18:b02fc0e53df8 | 297 | ************************************************************************************* |
cotigac | 18:b02fc0e53df8 | 298 | ************************************************************************************/ |
cotigac | 18:b02fc0e53df8 | 299 | #if gAspCapability_d |
cotigac | 18:b02fc0e53df8 | 300 | |
cotigac | 18:b02fc0e53df8 | 301 | void ASP_Init( instanceId_t phyInstance, uint8_t interfaceId ); |
cotigac | 18:b02fc0e53df8 | 302 | |
cotigac | 18:b02fc0e53df8 | 303 | AspStatus_t APP_ASP_SapHandler(AppToAspMessage_t *pMsg, instanceId_t instanceId); |
cotigac | 18:b02fc0e53df8 | 304 | |
cotigac | 18:b02fc0e53df8 | 305 | void Asp_GetTimeReq(uint32_t *time); |
cotigac | 18:b02fc0e53df8 | 306 | |
cotigac | 18:b02fc0e53df8 | 307 | AspStatus_t Asp_XcvrWriteReq (uint8_t mode, uint16_t addr, uint8_t len, uint8_t* pData); |
cotigac | 18:b02fc0e53df8 | 308 | AspStatus_t Asp_XcvrReadReq (uint8_t mode, uint16_t addr, uint8_t len, uint8_t* pData); |
cotigac | 18:b02fc0e53df8 | 309 | |
cotigac | 18:b02fc0e53df8 | 310 | AspStatus_t Asp_SetPowerLevel(uint8_t powerLevel); |
cotigac | 18:b02fc0e53df8 | 311 | uint8_t Asp_GetPowerLevel(void); |
cotigac | 18:b02fc0e53df8 | 312 | |
cotigac | 18:b02fc0e53df8 | 313 | AspStatus_t Asp_SetActivePromState(bool_t state); |
cotigac | 18:b02fc0e53df8 | 314 | |
cotigac | 18:b02fc0e53df8 | 315 | AspStatus_t Asp_SetFADState(bool_t state); |
cotigac | 18:b02fc0e53df8 | 316 | AspStatus_t Asp_SetFADThreshold(uint8_t thresholdFAD); |
cotigac | 18:b02fc0e53df8 | 317 | |
cotigac | 18:b02fc0e53df8 | 318 | AspStatus_t Asp_SetANTXState(bool_t state); |
cotigac | 18:b02fc0e53df8 | 319 | uint8_t Asp_GetANTXState(void); |
cotigac | 18:b02fc0e53df8 | 320 | uint8_t Asp_SetANTPadStateRequest(bool_t antAB_on, bool_t rxtxSwitch_on); |
cotigac | 18:b02fc0e53df8 | 321 | uint8_t Asp_SetANTPadStrengthRequest(bool_t hiStrength); |
cotigac | 18:b02fc0e53df8 | 322 | uint8_t Asp_SetANTPadInvertedRequest(bool_t invAntA, bool_t invAntB, bool_t invTx, bool_t invRx); |
cotigac | 18:b02fc0e53df8 | 323 | |
cotigac | 18:b02fc0e53df8 | 324 | AspStatus_t Asp_SetLQIMode(bool_t mode); |
cotigac | 18:b02fc0e53df8 | 325 | uint8_t Asp_GetRSSILevel(void); |
cotigac | 18:b02fc0e53df8 | 326 | |
cotigac | 18:b02fc0e53df8 | 327 | AspStatus_t ASP_TelecSetFreq (uint8_t channel); |
cotigac | 18:b02fc0e53df8 | 328 | AspStatus_t ASP_TelecSendRawData(uint8_t* dataPtr); |
cotigac | 18:b02fc0e53df8 | 329 | AspStatus_t ASP_TelecTest (uint8_t mode); |
cotigac | 18:b02fc0e53df8 | 330 | |
cotigac | 18:b02fc0e53df8 | 331 | #else /* gAspCapability_d */ |
cotigac | 18:b02fc0e53df8 | 332 | |
cotigac | 18:b02fc0e53df8 | 333 | #define ASP_Init(phyInstance,interfaceId) |
cotigac | 18:b02fc0e53df8 | 334 | #define Asp_GetTimeReq(time) |
cotigac | 18:b02fc0e53df8 | 335 | |
cotigac | 18:b02fc0e53df8 | 336 | #define APP_ASP_SapHandler(pMsg) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 337 | #define Asp_XcvrWriteReq(mode, addr, len, pData) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 338 | #define Asp_XcvrReadReq(mode, addr, len, pData) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 339 | #define Asp_SetPowerLevel(powerLevel) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 340 | #define Asp_SetActivePromState(state) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 341 | #define Asp_SetFADState(state) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 342 | #define Asp_SetFADThreshold(thresholdFAD) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 343 | #define Asp_SetANTXState(state) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 344 | #define Asp_SetLQIMode(mode) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 345 | #define ASP_TelecSetFreq(channel) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 346 | #define ASP_TelecSendRawData(dataPtr) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 347 | #define ASP_TelecTest(mode) (gAspDenied_c) |
cotigac | 18:b02fc0e53df8 | 348 | |
cotigac | 18:b02fc0e53df8 | 349 | #define Asp_GetPowerLevel() (0) |
cotigac | 18:b02fc0e53df8 | 350 | #define Asp_GetANTXState() (0) |
cotigac | 18:b02fc0e53df8 | 351 | #define Asp_GetRSSILevel() (0) |
cotigac | 18:b02fc0e53df8 | 352 | #endif /* gAspCapability_d */ |
cotigac | 18:b02fc0e53df8 | 353 | |
cotigac | 18:b02fc0e53df8 | 354 | #ifdef __cplusplus |
cotigac | 18:b02fc0e53df8 | 355 | } |
cotigac | 18:b02fc0e53df8 | 356 | #endif |
cotigac | 18:b02fc0e53df8 | 357 | |
cotigac | 18:b02fc0e53df8 | 358 | #endif /*__ASP_H__ */ |