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
RNG/RNG_Interface.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 RNG_interface.h |
andreikovacs | 0:764779eedf2d | 6 | * RNG implementation header file for the ARM CORTEX-M4 processor |
andreikovacs | 0:764779eedf2d | 7 | * |
andreikovacs | 0:764779eedf2d | 8 | * Redistribution and use in source and binary forms, with or without modification, |
andreikovacs | 0:764779eedf2d | 9 | * are permitted provided that the following conditions are met: |
andreikovacs | 0:764779eedf2d | 10 | * |
andreikovacs | 0:764779eedf2d | 11 | * o Redistributions of source code must retain the above copyright notice, this list |
andreikovacs | 0:764779eedf2d | 12 | * of conditions and the following disclaimer. |
andreikovacs | 0:764779eedf2d | 13 | * |
andreikovacs | 0:764779eedf2d | 14 | * o Redistributions in binary form must reproduce the above copyright notice, this |
andreikovacs | 0:764779eedf2d | 15 | * list of conditions and the following disclaimer in the documentation and/or |
andreikovacs | 0:764779eedf2d | 16 | * other materials provided with the distribution. |
andreikovacs | 0:764779eedf2d | 17 | * |
andreikovacs | 0:764779eedf2d | 18 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
andreikovacs | 0:764779eedf2d | 19 | * contributors may be used to endorse or promote products derived from this |
andreikovacs | 0:764779eedf2d | 20 | * software without specific prior written permission. |
andreikovacs | 0:764779eedf2d | 21 | * |
andreikovacs | 0:764779eedf2d | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
andreikovacs | 0:764779eedf2d | 23 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
andreikovacs | 0:764779eedf2d | 24 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
andreikovacs | 0:764779eedf2d | 25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
andreikovacs | 0:764779eedf2d | 26 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
andreikovacs | 0:764779eedf2d | 27 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
andreikovacs | 0:764779eedf2d | 28 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
andreikovacs | 0:764779eedf2d | 29 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
andreikovacs | 0:764779eedf2d | 30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
andreikovacs | 0:764779eedf2d | 31 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
andreikovacs | 0:764779eedf2d | 32 | */ |
andreikovacs | 0:764779eedf2d | 33 | |
andreikovacs | 0:764779eedf2d | 34 | #ifndef _RNG_INTERFACE_H_ |
andreikovacs | 0:764779eedf2d | 35 | #define _RNG_INTERFACE_H_ |
andreikovacs | 0:764779eedf2d | 36 | |
andreikovacs | 0:764779eedf2d | 37 | #include "EmbeddedTypes.h" |
andreikovacs | 0:764779eedf2d | 38 | |
andreikovacs | 0:764779eedf2d | 39 | |
andreikovacs | 0:764779eedf2d | 40 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 41 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 42 | * Public macros |
andreikovacs | 0:764779eedf2d | 43 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 44 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 45 | #define gRNG_NoHWSupport_d 0 |
andreikovacs | 0:764779eedf2d | 46 | #define gRNG_RNGAHWSupport_d 1 |
andreikovacs | 0:764779eedf2d | 47 | #define gRNG_RNGBHWSupport_d 2 |
andreikovacs | 0:764779eedf2d | 48 | #define gRNG_TRNGHWSupport_d 3 |
andreikovacs | 0:764779eedf2d | 49 | |
andreikovacs | 0:764779eedf2d | 50 | #ifndef gRNG_HWSupport_d |
andreikovacs | 0:764779eedf2d | 51 | #define gRNG_HWSupport_d gRNG_NoHWSupport_d |
andreikovacs | 0:764779eedf2d | 52 | #endif |
andreikovacs | 0:764779eedf2d | 53 | |
andreikovacs | 0:764779eedf2d | 54 | #define gRngSuccess_d (0x00) |
andreikovacs | 0:764779eedf2d | 55 | #define gRngInternalError_d (0x01) |
andreikovacs | 0:764779eedf2d | 56 | #define gRngNullPointer_d (0x80) |
andreikovacs | 0:764779eedf2d | 57 | #define gRngMaxRequests_d (100000) |
andreikovacs | 0:764779eedf2d | 58 | |
andreikovacs | 0:764779eedf2d | 59 | |
andreikovacs | 0:764779eedf2d | 60 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 61 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 62 | * Public type definitions |
andreikovacs | 0:764779eedf2d | 63 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 64 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 65 | |
andreikovacs | 0:764779eedf2d | 66 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 67 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 68 | * Public memory declarations |
andreikovacs | 0:764779eedf2d | 69 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 70 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 71 | |
andreikovacs | 0:764779eedf2d | 72 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 73 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 74 | * Public function prototypes |
andreikovacs | 0:764779eedf2d | 75 | ******************************************************************************* |
andreikovacs | 0:764779eedf2d | 76 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 77 | |
andreikovacs | 0:764779eedf2d | 78 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 79 | * Name: RNG_Init() |
andreikovacs | 0:764779eedf2d | 80 | * Description: Initialize the RNG HW module |
andreikovacs | 0:764779eedf2d | 81 | * Parameter(s): - |
andreikovacs | 0:764779eedf2d | 82 | * Return: Status of the RNG module |
andreikovacs | 0:764779eedf2d | 83 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 84 | uint8_t RNG_Init(void); |
andreikovacs | 0:764779eedf2d | 85 | |
andreikovacs | 0:764779eedf2d | 86 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 87 | * Name: RNG_GetRandomNo() |
andreikovacs | 0:764779eedf2d | 88 | * Description: Reads a 32-bit statistically random number from the RNG module or from 802.15.4 PHY |
andreikovacs | 0:764779eedf2d | 89 | * Parameter(s): [OUT] pRandomNo - pointer to location where the RN will be stored |
andreikovacs | 0:764779eedf2d | 90 | * Return: none |
andreikovacs | 0:764779eedf2d | 91 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 92 | void RNG_GetRandomNo(uint32_t* pRandomNo); |
andreikovacs | 0:764779eedf2d | 93 | |
andreikovacs | 0:764779eedf2d | 94 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 95 | * Name: PRNG_SetSeed() |
andreikovacs | 0:764779eedf2d | 96 | * Description: Initialize seed for the PRNG algorithm. |
andreikovacs | 0:764779eedf2d | 97 | * Parameter(s): |
andreikovacs | 0:764779eedf2d | 98 | * pSeed - can be set using the RNG_GetRandomNo() function |
andreikovacs | 0:764779eedf2d | 99 | * Return: None |
andreikovacs | 0:764779eedf2d | 100 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 101 | void RNG_SetPseudoRandomNoSeed(uint8_t* pSeed); |
andreikovacs | 0:764779eedf2d | 102 | |
andreikovacs | 0:764779eedf2d | 103 | /****************************************************************************** |
andreikovacs | 0:764779eedf2d | 104 | * Name: PRNG_GetRandomNo() |
andreikovacs | 0:764779eedf2d | 105 | * Description: Generates a NIST FIPS Publication 186-2-compliant 160 bit pseudo-random number |
andreikovacs | 0:764779eedf2d | 106 | * Parameter(s): |
andreikovacs | 0:764779eedf2d | 107 | * pOut - pointer to the output buffer |
andreikovacs | 0:764779eedf2d | 108 | * outBytes - the number of bytes to be copyed (1-20) |
andreikovacs | 0:764779eedf2d | 109 | * pXSEED - optional user SEED. Should be NULL if not used. |
andreikovacs | 0:764779eedf2d | 110 | * Return: The number of bytes copied or -1 if reseed is needed |
andreikovacs | 0:764779eedf2d | 111 | ******************************************************************************/ |
andreikovacs | 0:764779eedf2d | 112 | int16_t RNG_GetPseudoRandomNo(uint8_t* pOut, uint8_t outBytes, uint8_t* pXSEED); |
andreikovacs | 0:764779eedf2d | 113 | |
andreikovacs | 0:764779eedf2d | 114 | #endif /* _RNG_INTERFACE_H_ */ |