Freescale / fsl_smac

Dependents:   mcr20_RPS_GameController mcr20_RPS_Coordinator mcr20_wireless_uart mcr20_connectivity_test

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SMAC.h Source File

SMAC.h

00001 /**************************************************************************************************
00002 * SMAC implementation.
00003 * 
00004 * Freescale Semiconductor Inc.
00005 * (c) Copyright 2004-2010 Freescale Semiconductor, Inc.
00006 * ALL RIGHTS RESERVED.
00007 *
00008 ***************************************************************************************************
00009 *
00010 * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR 
00011 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 
00012 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
00013 * IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
00014 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
00015 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00016 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
00017 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
00018 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
00019 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
00020 * THE POSSIBILITY OF SUCH DAMAGE.
00021 *
00022 ***********************************************************************************************//*!
00023 **************************************************************************************************/
00024 
00025 #ifndef SMAC_H_
00026 #define SMAC_H_
00027 
00028 /************************************************************************************
00029 *************************************************************************************
00030 * Includes
00031 *************************************************************************************
00032 ************************************************************************************/
00033 
00034 #include "SMAC_Interface.h"
00035 #include "Phy.h"
00036 #include "PhyInterface.h"
00037 //#include "TimersManager.h"
00038 #include "RNG_Interface.h"
00039 
00040 #if defined (gPHY_802_15_4g_d)
00041 #include "PhyPib.h"
00042 #include "PhyExtended.h"
00043 #include "PhyTime.h"
00044 #endif
00045 /************************************************************************************
00046 *************************************************************************************
00047 * Private Prototypes
00048 *************************************************************************************
00049 ************************************************************************************/
00050 void SmacSetRxTimeout(smacTime_t timeoutSymbols);
00051 
00052 #if defined (gPHY_802_15_4g_d)
00053 
00054 #define smacPreambleSizeOf16_c          (16)
00055 #define smacPreambleSizeOf3_c           (3)
00056 
00057 #endif
00058 /*smacParametersValidation_d:
00059 TRUE :  SMAC primitives validate their incoming parameters.
00060 FALSE:  SMAC primitives do their stuff without validating their incoming 
00061 parameters
00062 *Note: Setting this as FALSE will compile a smaller foot print SMAC.
00063 */
00064 #define smacParametersValidation_d          TRUE
00065 
00066 /*smacInitializationValidation_d:
00067 TRUE :  SMAC primitives validate whether SMAC is initialized or not.
00068 FALSE:  SMAC primitives don't care about SMAC's initialization.
00069 *Note: Setting this as FALSE will compile a smaller foot print SMAC.
00070 */
00071 #define smacInitializationValidation_d      TRUE
00072 
00073 #define FRAME_CTRL_ACK_FIELD_SET                (1 << 5)
00074 /************************************************************************************
00075 *************************************************************************************
00076 * Module Type definitions
00077 *************************************************************************************
00078 ************************************************************************************/
00079 typedef enum smacStates_tag {
00080   mSmacStateIdle_c,
00081   mSmacStateTransmitting_c,
00082   mSmacStateReceiving_c,
00083   mSmacStateScanningChannels_c,
00084   mSmacStatePerformingCca_c,
00085   mSmacStatePerformingEd_c,
00086   mSmacStatePerformingTest_c,
00087   mSmacStateHibernate_c, 
00088   mSmacStateDoze_c    
00089 } smacStates_t;
00090 
00091 typedef union prssPacketPtr_tag
00092 {
00093   uint8_t*    smacScanResultsPointer;     
00094   rxPacket_t  *smacRxPacketPointer;
00095   pdDataReq_t *smacTxPacketPointer;
00096 }prssPacketPtr_t;
00097 
00098 /***********************************************************************************
00099 * Phy to SMAC SAP prototype
00100 ************************************************************************************/
00101 typedef phyStatus_t ( * PD_SMAC_SapHandler_t)(pdDataToMacMessage_t * pMsg, instanceId_t instanceId);
00102 
00103 typedef phyStatus_t ( * PLME_SMAC_SapHandler_t)(plmeToMacMessage_t * pMsg, instanceId_t instanceId);
00104 
00105 /***********************************************************************************
00106 * SMAC to App SAP handlers
00107 ************************************************************************************/
00108 static SMAC_APP_MCPS_SapHandler_t gSMAC_APP_MCPS_SapHandler;
00109 static SMAC_APP_MLME_SapHandler_t gSMAC_APP_MLME_SapHandler;
00110 /************************************************************************************
00111 *************************************************************************************
00112 * Private definitions
00113 *************************************************************************************
00114 ************************************************************************************/
00115  
00116 #define smacInstance 0
00117 
00118 #endif /* SMAC_H_ */