A library implementing IEEE 802.15.4 PHY functionality for the MCR20A transceiver. The PHY sublayer provides two services: the PHY data service and the PHY management service interfacing to the PHY sublayer management entity (PLME) service access point (SAP) (known as PLME-SAP). The PHY data service enables the transmission and reception of PHY protocol data units (PSDUs) over the media (radio).
Fork of fsl_phy_mcr20a by
The Freescale PHY Layer deals with the physical burst which is to be sent and/or received. It performs modulation and demodulation, transmitter and receiver switching, fragmentation, scrambling, interleaving, and error correction coding. The communication to the upper protocol layers is carried out through the Layer 1 Interface.
The PHY Layer is capable of executing the following sequences:
- I (Idle)
- R (Receive Sequence conditionally followed by a TxAck)
- T (Transmit Sequence)
- C (Standalone CCA)
- CCCA (Continuous CCA)
- TR (Transmit/Receive Sequence - transmit unconditionally followed by either an R or RxAck)
In addition to these sequences the PHY Layer also integrates a packet processor which determines whether the packet is MAC-compliant, and if it is, whether it is addressed to the end device. Another feature of the packet processor is Source Address Matching which can be viewed as an extension of packet filtering; however its function is very specific to its intended application (data-polling and indirect queue management by a PAN Coordinator).
Documentation
PHY/PhyInterface.h@0:764779eedf2d, 2015-08-18 (annotated)
- Committer:
- andreikovacs
- Date:
- Tue Aug 18 12:41:42 2015 +0000
- Revision:
- 0:764779eedf2d
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andreikovacs | 0:764779eedf2d | 1 | /*! |
andreikovacs | 0:764779eedf2d | 2 | * Copyright (c) 2015, Freescale Semiconductor, Inc. |
andreikovacs | 0:764779eedf2d | 3 | * All rights reserved. |
andreikovacs | 0:764779eedf2d | 4 | * |
andreikovacs | 0:764779eedf2d | 5 | * \file PhyInterface.h |
andreikovacs | 0:764779eedf2d | 6 | * |
andreikovacs | 0:764779eedf2d | 7 | * Redistribution and use in source and binary forms, with or without modification, |
andreikovacs | 0:764779eedf2d | 8 | * are permitted provided that the following conditions are met: |
andreikovacs | 0:764779eedf2d | 9 | * |
andreikovacs | 0:764779eedf2d | 10 | * o Redistributions of source code must retain the above copyright notice, this list |
andreikovacs | 0:764779eedf2d | 11 | * of conditions and the following disclaimer. |
andreikovacs | 0:764779eedf2d | 12 | * |
andreikovacs | 0:764779eedf2d | 13 | * o Redistributions in binary form must reproduce the above copyright notice, this |
andreikovacs | 0:764779eedf2d | 14 | * list of conditions and the following disclaimer in the documentation and/or |
andreikovacs | 0:764779eedf2d | 15 | * other materials provided with the distribution. |
andreikovacs | 0:764779eedf2d | 16 | * |
andreikovacs | 0:764779eedf2d | 17 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
andreikovacs | 0:764779eedf2d | 18 | * contributors may be used to endorse or promote products derived from this |
andreikovacs | 0:764779eedf2d | 19 | * software without specific prior written permission. |
andreikovacs | 0:764779eedf2d | 20 | * |
andreikovacs | 0:764779eedf2d | 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
andreikovacs | 0:764779eedf2d | 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
andreikovacs | 0:764779eedf2d | 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
andreikovacs | 0:764779eedf2d | 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
andreikovacs | 0:764779eedf2d | 25 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
andreikovacs | 0:764779eedf2d | 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
andreikovacs | 0:764779eedf2d | 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
andreikovacs | 0:764779eedf2d | 28 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
andreikovacs | 0:764779eedf2d | 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
andreikovacs | 0:764779eedf2d | 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
andreikovacs | 0:764779eedf2d | 31 | */ |
andreikovacs | 0:764779eedf2d | 32 | |
andreikovacs | 0:764779eedf2d | 33 | #ifndef _PHY_INTERFACE_H |
andreikovacs | 0:764779eedf2d | 34 | #define _PHY_INTERFACE_H |
andreikovacs | 0:764779eedf2d | 35 | |
andreikovacs | 0:764779eedf2d | 36 | |
andreikovacs | 0:764779eedf2d | 37 | /************************************************************************************ |
andreikovacs | 0:764779eedf2d | 38 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 39 | * Include |
andreikovacs | 0:764779eedf2d | 40 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 41 | ************************************************************************************/ |
andreikovacs | 0:764779eedf2d | 42 | |
andreikovacs | 0:764779eedf2d | 43 | #include "PhyTypes.h" |
andreikovacs | 0:764779eedf2d | 44 | //#include "Messaging.h" |
andreikovacs | 0:764779eedf2d | 45 | #include "PhyConfig.h" |
andreikovacs | 0:764779eedf2d | 46 | |
andreikovacs | 0:764779eedf2d | 47 | /************************************************************************************ |
andreikovacs | 0:764779eedf2d | 48 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 49 | * Public macros |
andreikovacs | 0:764779eedf2d | 50 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 51 | ************************************************************************************/ |
andreikovacs | 0:764779eedf2d | 52 | |
andreikovacs | 0:764779eedf2d | 53 | /* Constants */ |
andreikovacs | 0:764779eedf2d | 54 | #ifndef gMaxPhyTimers_c |
andreikovacs | 0:764779eedf2d | 55 | #define gMaxPhyTimers_c (5) |
andreikovacs | 0:764779eedf2d | 56 | #endif |
andreikovacs | 0:764779eedf2d | 57 | |
andreikovacs | 0:764779eedf2d | 58 | #ifdef gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 59 | #define gPhySeqStartAsap_c (0xFFFFFFFFFFFFFFFF) |
andreikovacs | 0:764779eedf2d | 60 | #else |
andreikovacs | 0:764779eedf2d | 61 | #define gPhySeqStartAsap_c (0xFFFFFFFF) |
andreikovacs | 0:764779eedf2d | 62 | #endif |
andreikovacs | 0:764779eedf2d | 63 | |
andreikovacs | 0:764779eedf2d | 64 | /* XCVR active/idle power modes */ |
andreikovacs | 0:764779eedf2d | 65 | #define gPhyDefaultActivePwrMode_c gPhyPwrAutodoze_c /* Do not change! */ |
andreikovacs | 0:764779eedf2d | 66 | #define gPhyDefaultIdlePwrMode_c gPhyPwrAutodoze_c |
andreikovacs | 0:764779eedf2d | 67 | |
andreikovacs | 0:764779eedf2d | 68 | /************************************************************************************ |
andreikovacs | 0:764779eedf2d | 69 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 70 | * Public prototypes |
andreikovacs | 0:764779eedf2d | 71 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 72 | ************************************************************************************/ |
andreikovacs | 0:764779eedf2d | 73 | |
andreikovacs | 0:764779eedf2d | 74 | /************************************************************************************ |
andreikovacs | 0:764779eedf2d | 75 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 76 | * Public type definitions |
andreikovacs | 0:764779eedf2d | 77 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 78 | ************************************************************************************/ |
andreikovacs | 0:764779eedf2d | 79 | |
andreikovacs | 0:764779eedf2d | 80 | typedef enum |
andreikovacs | 0:764779eedf2d | 81 | { |
andreikovacs | 0:764779eedf2d | 82 | #include "PhyMessages.h" |
andreikovacs | 0:764779eedf2d | 83 | }phyMessageId_t; |
andreikovacs | 0:764779eedf2d | 84 | |
andreikovacs | 0:764779eedf2d | 85 | typedef enum{ |
andreikovacs | 0:764779eedf2d | 86 | gPhyPwrIdle_c, |
andreikovacs | 0:764779eedf2d | 87 | gPhyPwrAutodoze_c, |
andreikovacs | 0:764779eedf2d | 88 | gPhyPwrDoze_c, |
andreikovacs | 0:764779eedf2d | 89 | gPhyPwrHibernate_c, |
andreikovacs | 0:764779eedf2d | 90 | gPhyPwrReset_c |
andreikovacs | 0:764779eedf2d | 91 | }phyPwrMode_t; |
andreikovacs | 0:764779eedf2d | 92 | |
andreikovacs | 0:764779eedf2d | 93 | typedef struct pdDataReq_tag |
andreikovacs | 0:764779eedf2d | 94 | { |
andreikovacs | 0:764779eedf2d | 95 | phyTime_t startTime; // absolute |
andreikovacs | 0:764779eedf2d | 96 | uint32_t txDuration; // relative |
andreikovacs | 0:764779eedf2d | 97 | phySlottedMode_t slottedTx; |
andreikovacs | 0:764779eedf2d | 98 | phyCCAType_t CCABeforeTx; |
andreikovacs | 0:764779eedf2d | 99 | phyAckRequired_t ackRequired; |
andreikovacs | 0:764779eedf2d | 100 | uint8_t psduLength; |
andreikovacs | 0:764779eedf2d | 101 | #ifdef gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 102 | phyPHR_t phyHeader; |
andreikovacs | 0:764779eedf2d | 103 | uint8_t macDataIndex; |
andreikovacs | 0:764779eedf2d | 104 | uint8_t fillFifoBlockLength; |
andreikovacs | 0:764779eedf2d | 105 | #endif // gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 106 | uint8_t * pPsdu; |
andreikovacs | 0:764779eedf2d | 107 | } pdDataReq_t; |
andreikovacs | 0:764779eedf2d | 108 | |
andreikovacs | 0:764779eedf2d | 109 | typedef struct pdDataCnf_tag |
andreikovacs | 0:764779eedf2d | 110 | { |
andreikovacs | 0:764779eedf2d | 111 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 112 | } pdDataCnf_t; |
andreikovacs | 0:764779eedf2d | 113 | |
andreikovacs | 0:764779eedf2d | 114 | typedef struct pdDataInd_tag |
andreikovacs | 0:764779eedf2d | 115 | { |
andreikovacs | 0:764779eedf2d | 116 | phyTimeTimestamp_t timeStamp; |
andreikovacs | 0:764779eedf2d | 117 | uint8_t ppduLinkQuality; |
andreikovacs | 0:764779eedf2d | 118 | uint8_t psduLength; |
andreikovacs | 0:764779eedf2d | 119 | uint8_t * pPsdu; |
andreikovacs | 0:764779eedf2d | 120 | #ifdef gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 121 | uint32_t crcValue; |
andreikovacs | 0:764779eedf2d | 122 | bool_t crcValid; |
andreikovacs | 0:764779eedf2d | 123 | #endif |
andreikovacs | 0:764779eedf2d | 124 | } pdDataInd_t; |
andreikovacs | 0:764779eedf2d | 125 | |
andreikovacs | 0:764779eedf2d | 126 | typedef struct pdIndQueueInsertReq_tag |
andreikovacs | 0:764779eedf2d | 127 | { |
andreikovacs | 0:764779eedf2d | 128 | uint8_t index; |
andreikovacs | 0:764779eedf2d | 129 | uint16_t checksum; |
andreikovacs | 0:764779eedf2d | 130 | } pdIndQueueInsertReq_t; |
andreikovacs | 0:764779eedf2d | 131 | |
andreikovacs | 0:764779eedf2d | 132 | typedef struct pdIndQueueInsertCnf_tag |
andreikovacs | 0:764779eedf2d | 133 | { |
andreikovacs | 0:764779eedf2d | 134 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 135 | } pdIndQueueInsertCnf_t; |
andreikovacs | 0:764779eedf2d | 136 | |
andreikovacs | 0:764779eedf2d | 137 | typedef struct pdIndQueueRemoveReq_tag |
andreikovacs | 0:764779eedf2d | 138 | { |
andreikovacs | 0:764779eedf2d | 139 | uint8_t index; |
andreikovacs | 0:764779eedf2d | 140 | } pdIndQueueRemoveReq_t; |
andreikovacs | 0:764779eedf2d | 141 | |
andreikovacs | 0:764779eedf2d | 142 | typedef struct plmeEdReq_tag |
andreikovacs | 0:764779eedf2d | 143 | { |
andreikovacs | 0:764779eedf2d | 144 | phyTime_t startTime; // absolute |
andreikovacs | 0:764779eedf2d | 145 | } plmeEdReq_t; |
andreikovacs | 0:764779eedf2d | 146 | |
andreikovacs | 0:764779eedf2d | 147 | typedef struct plmeCcaReq_tag |
andreikovacs | 0:764779eedf2d | 148 | { |
andreikovacs | 0:764779eedf2d | 149 | phyCCAType_t ccaType; |
andreikovacs | 0:764779eedf2d | 150 | phyContCCAMode_t contCcaMode; |
andreikovacs | 0:764779eedf2d | 151 | } plmeCcaReq_t; |
andreikovacs | 0:764779eedf2d | 152 | |
andreikovacs | 0:764779eedf2d | 153 | typedef struct plmeCcaCnf_tag |
andreikovacs | 0:764779eedf2d | 154 | { |
andreikovacs | 0:764779eedf2d | 155 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 156 | } plmeCcaCnf_t; |
andreikovacs | 0:764779eedf2d | 157 | |
andreikovacs | 0:764779eedf2d | 158 | typedef struct plmeEdCnf_tag |
andreikovacs | 0:764779eedf2d | 159 | { |
andreikovacs | 0:764779eedf2d | 160 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 161 | uint8_t energyLevel; |
andreikovacs | 0:764779eedf2d | 162 | uint8_t energyLeveldB; |
andreikovacs | 0:764779eedf2d | 163 | } plmeEdCnf_t; |
andreikovacs | 0:764779eedf2d | 164 | |
andreikovacs | 0:764779eedf2d | 165 | typedef struct plmeSetTRxStateReq_tag |
andreikovacs | 0:764779eedf2d | 166 | { |
andreikovacs | 0:764779eedf2d | 167 | phyState_t state; |
andreikovacs | 0:764779eedf2d | 168 | phySlottedMode_t slottedMode; |
andreikovacs | 0:764779eedf2d | 169 | phyTime_t startTime; // absolute |
andreikovacs | 0:764779eedf2d | 170 | uint32_t rxDuration; // relative |
andreikovacs | 0:764779eedf2d | 171 | } plmeSetTRxStateReq_t; |
andreikovacs | 0:764779eedf2d | 172 | |
andreikovacs | 0:764779eedf2d | 173 | typedef struct phyTimeEvent_tag |
andreikovacs | 0:764779eedf2d | 174 | { |
andreikovacs | 0:764779eedf2d | 175 | phyTimeTimestamp_t timestamp; // absolute |
andreikovacs | 0:764779eedf2d | 176 | phyTimeCallback_t callback; |
andreikovacs | 0:764779eedf2d | 177 | uint32_t parameter; |
andreikovacs | 0:764779eedf2d | 178 | }phyTimeEvent_t; |
andreikovacs | 0:764779eedf2d | 179 | |
andreikovacs | 0:764779eedf2d | 180 | typedef struct plmeSetTRxStateCnf_tag |
andreikovacs | 0:764779eedf2d | 181 | { |
andreikovacs | 0:764779eedf2d | 182 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 183 | } plmeSetTRxStateCnf_t; |
andreikovacs | 0:764779eedf2d | 184 | |
andreikovacs | 0:764779eedf2d | 185 | typedef struct plmeSetReq_tag |
andreikovacs | 0:764779eedf2d | 186 | { |
andreikovacs | 0:764779eedf2d | 187 | phyPibId_t PibAttribute; |
andreikovacs | 0:764779eedf2d | 188 | uint64_t PibAttributeValue; |
andreikovacs | 0:764779eedf2d | 189 | } plmeSetReq_t; |
andreikovacs | 0:764779eedf2d | 190 | |
andreikovacs | 0:764779eedf2d | 191 | typedef struct plmeSetCnf_tag |
andreikovacs | 0:764779eedf2d | 192 | { |
andreikovacs | 0:764779eedf2d | 193 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 194 | phyPibId_t PibAttribute; |
andreikovacs | 0:764779eedf2d | 195 | } plmeSetCnf_t; |
andreikovacs | 0:764779eedf2d | 196 | |
andreikovacs | 0:764779eedf2d | 197 | typedef struct plmeGetReq_tag |
andreikovacs | 0:764779eedf2d | 198 | { |
andreikovacs | 0:764779eedf2d | 199 | phyPibId_t PibAttribute; |
andreikovacs | 0:764779eedf2d | 200 | uint64_t * pPibAttributeValue; |
andreikovacs | 0:764779eedf2d | 201 | } plmeGetReq_t; |
andreikovacs | 0:764779eedf2d | 202 | |
andreikovacs | 0:764779eedf2d | 203 | typedef struct plmeGetCnf_tag |
andreikovacs | 0:764779eedf2d | 204 | { |
andreikovacs | 0:764779eedf2d | 205 | phyStatus_t status; |
andreikovacs | 0:764779eedf2d | 206 | phyPibId_t PibAttribute; |
andreikovacs | 0:764779eedf2d | 207 | uint64_t PibAttributeValue; |
andreikovacs | 0:764779eedf2d | 208 | } plmeGetCnf_t; |
andreikovacs | 0:764779eedf2d | 209 | |
andreikovacs | 0:764779eedf2d | 210 | typedef struct macToPlmeMessage_tag |
andreikovacs | 0:764779eedf2d | 211 | { |
andreikovacs | 0:764779eedf2d | 212 | phyMessageId_t msgType; |
andreikovacs | 0:764779eedf2d | 213 | uint8_t macInstance; |
andreikovacs | 0:764779eedf2d | 214 | union |
andreikovacs | 0:764779eedf2d | 215 | { |
andreikovacs | 0:764779eedf2d | 216 | plmeEdReq_t edReq; |
andreikovacs | 0:764779eedf2d | 217 | plmeCcaReq_t ccaReq; |
andreikovacs | 0:764779eedf2d | 218 | plmeSetTRxStateReq_t setTRxStateReq; |
andreikovacs | 0:764779eedf2d | 219 | plmeSetReq_t setReq; |
andreikovacs | 0:764779eedf2d | 220 | plmeGetReq_t getReq; |
andreikovacs | 0:764779eedf2d | 221 | }msgData; |
andreikovacs | 0:764779eedf2d | 222 | } macToPlmeMessage_t; |
andreikovacs | 0:764779eedf2d | 223 | |
andreikovacs | 0:764779eedf2d | 224 | typedef struct macToPdDataMessage_tag |
andreikovacs | 0:764779eedf2d | 225 | { |
andreikovacs | 0:764779eedf2d | 226 | phyMessageId_t msgType; |
andreikovacs | 0:764779eedf2d | 227 | uint8_t macInstance; |
andreikovacs | 0:764779eedf2d | 228 | union |
andreikovacs | 0:764779eedf2d | 229 | { |
andreikovacs | 0:764779eedf2d | 230 | pdDataReq_t dataReq; |
andreikovacs | 0:764779eedf2d | 231 | pdIndQueueInsertReq_t indQueueInsertReq; |
andreikovacs | 0:764779eedf2d | 232 | pdIndQueueRemoveReq_t indQueueRemoveReq; |
andreikovacs | 0:764779eedf2d | 233 | }msgData; |
andreikovacs | 0:764779eedf2d | 234 | } macToPdDataMessage_t; |
andreikovacs | 0:764779eedf2d | 235 | |
andreikovacs | 0:764779eedf2d | 236 | typedef struct plmeToMacMessage_tag |
andreikovacs | 0:764779eedf2d | 237 | { |
andreikovacs | 0:764779eedf2d | 238 | phyMessageId_t msgType; |
andreikovacs | 0:764779eedf2d | 239 | uint8_t macInstance; |
andreikovacs | 0:764779eedf2d | 240 | union |
andreikovacs | 0:764779eedf2d | 241 | { |
andreikovacs | 0:764779eedf2d | 242 | plmeCcaCnf_t ccaCnf; |
andreikovacs | 0:764779eedf2d | 243 | plmeEdCnf_t edCnf; |
andreikovacs | 0:764779eedf2d | 244 | plmeSetTRxStateCnf_t setTRxStateCnf; |
andreikovacs | 0:764779eedf2d | 245 | plmeSetCnf_t setCnf; |
andreikovacs | 0:764779eedf2d | 246 | plmeGetCnf_t getCnf; |
andreikovacs | 0:764779eedf2d | 247 | }msgData; |
andreikovacs | 0:764779eedf2d | 248 | } plmeToMacMessage_t; |
andreikovacs | 0:764779eedf2d | 249 | |
andreikovacs | 0:764779eedf2d | 250 | typedef struct pdDataToMacMessage_tag |
andreikovacs | 0:764779eedf2d | 251 | { |
andreikovacs | 0:764779eedf2d | 252 | phyMessageId_t msgType; |
andreikovacs | 0:764779eedf2d | 253 | uint8_t macInstance; |
andreikovacs | 0:764779eedf2d | 254 | union |
andreikovacs | 0:764779eedf2d | 255 | { |
andreikovacs | 0:764779eedf2d | 256 | pdDataCnf_t dataCnf; |
andreikovacs | 0:764779eedf2d | 257 | pdDataInd_t dataInd; |
andreikovacs | 0:764779eedf2d | 258 | pdIndQueueInsertCnf_t indQueueInsertCnf; |
andreikovacs | 0:764779eedf2d | 259 | }msgData; |
andreikovacs | 0:764779eedf2d | 260 | } pdDataToMacMessage_t; |
andreikovacs | 0:764779eedf2d | 261 | |
andreikovacs | 0:764779eedf2d | 262 | typedef struct phyMessageHeader_tag |
andreikovacs | 0:764779eedf2d | 263 | { |
andreikovacs | 0:764779eedf2d | 264 | phyMessageId_t msgType; |
andreikovacs | 0:764779eedf2d | 265 | uint8_t macInstance; |
andreikovacs | 0:764779eedf2d | 266 | } phyMessageHeader_t; |
andreikovacs | 0:764779eedf2d | 267 | |
andreikovacs | 0:764779eedf2d | 268 | typedef struct phyRxParams_tag { |
andreikovacs | 0:764779eedf2d | 269 | phyTime_t timeStamp; |
andreikovacs | 0:764779eedf2d | 270 | uint8_t psduLength; |
andreikovacs | 0:764779eedf2d | 271 | uint8_t linkQuality; |
andreikovacs | 0:764779eedf2d | 272 | #ifdef gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 273 | uint8_t headerLength; |
andreikovacs | 0:764779eedf2d | 274 | uint8_t macDataIndex; |
andreikovacs | 0:764779eedf2d | 275 | uint8_t unfillFifoBlockLength; |
andreikovacs | 0:764779eedf2d | 276 | phyPHR_t phyHeader; |
andreikovacs | 0:764779eedf2d | 277 | #else |
andreikovacs | 0:764779eedf2d | 278 | phySlottedMode_t phyRxMode; |
andreikovacs | 0:764779eedf2d | 279 | pdDataToMacMessage_t *pRxData; |
andreikovacs | 0:764779eedf2d | 280 | #endif // gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 281 | } phyRxParams_t; |
andreikovacs | 0:764779eedf2d | 282 | |
andreikovacs | 0:764779eedf2d | 283 | typedef struct phyChannelParams_tag { |
andreikovacs | 0:764779eedf2d | 284 | union{ |
andreikovacs | 0:764779eedf2d | 285 | phyStatus_t channelStatus; |
andreikovacs | 0:764779eedf2d | 286 | uint8_t energyLeveldB; |
andreikovacs | 0:764779eedf2d | 287 | }; |
andreikovacs | 0:764779eedf2d | 288 | #ifdef gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 289 | uint8_t ccaThreshold; |
andreikovacs | 0:764779eedf2d | 290 | uint8_t ccaParam; |
andreikovacs | 0:764779eedf2d | 291 | #endif // gPHY_802_15_4g_d |
andreikovacs | 0:764779eedf2d | 292 | } phyChannelParams_t; |
andreikovacs | 0:764779eedf2d | 293 | |
andreikovacs | 0:764779eedf2d | 294 | typedef struct phyTxParams_tag { |
andreikovacs | 0:764779eedf2d | 295 | uint8_t numOfCca; |
andreikovacs | 0:764779eedf2d | 296 | phyAckRequired_t ackRequired; |
andreikovacs | 0:764779eedf2d | 297 | } phyTxParams_t; |
andreikovacs | 0:764779eedf2d | 298 | |
andreikovacs | 0:764779eedf2d | 299 | typedef phyStatus_t ( * PD_MAC_SapHandler_t)(pdDataToMacMessage_t * pMsg, instanceId_t instanceId); |
andreikovacs | 0:764779eedf2d | 300 | |
andreikovacs | 0:764779eedf2d | 301 | typedef phyStatus_t ( * PLME_MAC_SapHandler_t)(plmeToMacMessage_t * pMsg, instanceId_t instanceId); |
andreikovacs | 0:764779eedf2d | 302 | |
andreikovacs | 0:764779eedf2d | 303 | #ifdef __cplusplus |
andreikovacs | 0:764779eedf2d | 304 | extern "C" { |
andreikovacs | 0:764779eedf2d | 305 | #endif |
andreikovacs | 0:764779eedf2d | 306 | |
andreikovacs | 0:764779eedf2d | 307 | /************************************************************************************ |
andreikovacs | 0:764779eedf2d | 308 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 309 | * Public memory declarations |
andreikovacs | 0:764779eedf2d | 310 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 311 | ************************************************************************************/ |
andreikovacs | 0:764779eedf2d | 312 | extern const uint8_t gPhyIndirectQueueSize_c; |
andreikovacs | 0:764779eedf2d | 313 | |
andreikovacs | 0:764779eedf2d | 314 | /************************************************************************************ |
andreikovacs | 0:764779eedf2d | 315 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 316 | * Public functions |
andreikovacs | 0:764779eedf2d | 317 | ************************************************************************************* |
andreikovacs | 0:764779eedf2d | 318 | ************************************************************************************/ |
andreikovacs | 0:764779eedf2d | 319 | |
andreikovacs | 0:764779eedf2d | 320 | void Phy_Init( void ); |
andreikovacs | 0:764779eedf2d | 321 | |
andreikovacs | 0:764779eedf2d | 322 | instanceId_t BindToPHY( instanceId_t macInstance ); |
andreikovacs | 0:764779eedf2d | 323 | |
andreikovacs | 0:764779eedf2d | 324 | // SAPs |
andreikovacs | 0:764779eedf2d | 325 | void Phy_RegisterSapHandlers(PD_MAC_SapHandler_t pPD_MAC_SapHandler, PLME_MAC_SapHandler_t pPLME_MAC_SapHandler, instanceId_t instanceId); |
andreikovacs | 0:764779eedf2d | 326 | |
andreikovacs | 0:764779eedf2d | 327 | phyStatus_t MAC_PD_SapHandler(macToPdDataMessage_t * pMsg, instanceId_t phyInstance); |
andreikovacs | 0:764779eedf2d | 328 | |
andreikovacs | 0:764779eedf2d | 329 | phyStatus_t MAC_PLME_SapHandler(macToPlmeMessage_t * pMsg, instanceId_t phyInstance); |
andreikovacs | 0:764779eedf2d | 330 | |
andreikovacs | 0:764779eedf2d | 331 | // PHY Time |
andreikovacs | 0:764779eedf2d | 332 | void PhyTime_Maintenance ( void ); |
andreikovacs | 0:764779eedf2d | 333 | |
andreikovacs | 0:764779eedf2d | 334 | void PhyTime_RunCallback ( void ); |
andreikovacs | 0:764779eedf2d | 335 | |
andreikovacs | 0:764779eedf2d | 336 | void PhyTime_ISR ( void ); |
andreikovacs | 0:764779eedf2d | 337 | |
andreikovacs | 0:764779eedf2d | 338 | phyTimeStatus_t PhyTime_TimerInit ( void (*cb)(void) ); |
andreikovacs | 0:764779eedf2d | 339 | |
andreikovacs | 0:764779eedf2d | 340 | phyTimeTimestamp_t PhyTime_GetTimestamp ( void ); |
andreikovacs | 0:764779eedf2d | 341 | |
andreikovacs | 0:764779eedf2d | 342 | phyTimeTimerId_t PhyTime_ScheduleEvent( phyTimeEvent_t *pEvent ); |
andreikovacs | 0:764779eedf2d | 343 | |
andreikovacs | 0:764779eedf2d | 344 | phyTimeStatus_t PhyTime_CancelEvent ( phyTimeTimerId_t timerId ); |
andreikovacs | 0:764779eedf2d | 345 | |
andreikovacs | 0:764779eedf2d | 346 | phyTimeStatus_t PhyTime_CancelEventsWithParam ( uint32_t param ); |
andreikovacs | 0:764779eedf2d | 347 | |
andreikovacs | 0:764779eedf2d | 348 | #ifdef __cplusplus |
andreikovacs | 0:764779eedf2d | 349 | } |
andreikovacs | 0:764779eedf2d | 350 | #endif |
andreikovacs | 0:764779eedf2d | 351 | |
andreikovacs | 0:764779eedf2d | 352 | #endif /* _PHY_INTERFACE_H */ |