background image

Primitives

MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0

3-22

Freescale Semiconductor

 

If the result of the call of the function is different than gErrorNoError_c, the application should 
handle the error returned. For instance, if the result is gErrorBusy_c the application should wait for 
the radio to finish a previous operation.

uint8_t TxDataBuffer[gMaxSmacSDULe sizeof(txPacket_t)];
txPacket_t *TxPacket;
smacErrors_t smacError;
...
TxPacket = (txPacket_t*)TxDataBuffer;      
TxPacket->u8DataLength = payloadLength;
//Copy the data to send into the smacPdu of the packet
FLib_MemCpy(TxPacket->smacPdu.smacPdu, bufferToSend, payloadLength);
smacError = MCPSDataRequest(TxPacket);
...

Implementation

This MCPSDataRequest primitive creates a message for the PHY task and fills it in respect to the user 
configurations prior to this call and to the information contained in the packet.

3.2

MLMETXDisableRequest

This function places the radio into stand-by and the PHY and SMAC state machines into idle, if current 
operation is TX. It does not explicitly check if SMAC is in a transmitting state, but it clears the SMAC 
buffer containing the packet to be sent, which makes it ideal for using when application wants to switch 
from TX to idle.

Prototype

void MLMETXDisableRequest(void);

Arguments

None.

Returns

None:   The function will forcibly set the transceiver to standy by and the PHY and SMAC state machines 
to idle, so not return value is needed.

Usage

Call 

MLMETXDisableRequest().

Implementation

This primitive creates a message for PHY, sets message type as set transceiver state request, with value of 
force transceiver off. After passing the message to PHY, SMAC checks if a TX is in progress and clears 
the buffer containing the packet.

Summary of Contents for MKW01

Page 1: ...Document Number MKW01SMACRM Rev 0 0 3 2015 MKW01 Simple Media Access Controller SMAC Reference Manual...

Page 2: ...for each customer application by customer s technical experts Freescale Semiconductor does not convey any license under its patent rights nor the rights of others Freescale Semiconductor products are...

Page 3: ...t 11 2 2 4 rxStatus_t 12 2 2 5 smacPdu_t 12 2 2 6 txPacket_t 12 2 2 7 channels_t 13 2 2 8 smacErrors_t 14 2 2 9 txContextConfig_t 15 2 2 10 smacTestMode_t 15 2 2 11 packetConfig_t 15 2 2 12 smacRFMode...

Page 4: ...bleLength 30 3 14 MLMESetSyncWordSize 30 3 15 MLMESetSyncWordValue 30 3 16 MLMEPacketConfig 31 3 17 MLMESetAdditionalRFOffset 31 3 18 MLMEGetAdditionalRFOffset 32 3 19 SMACSetShortSrcAddress 32 3 20 S...

Page 5: ...ence This document is intended for application developers working on custom wireless applications that employ the MKW01 The latest version of the Freescale MKW01 SMAC is available in the Freescale web...

Page 6: ...Interface MAC Medium Access Control MCU MicroController Unit NVM Non Volatile Memory PC Personal Computer TERM Serial Port Terminal Application XCVR Transceiver PCB Printed Circuit Board OTA Over the...

Page 7: ...or externally connected to MCU GPIO and are capable of generating interrupt requests NOTE It is highly recommended the SMAC user be familiar with the MKW01 device Additional details can be found in t...

Page 8: ...uency bands are 863 870 MHz Europe 902 928 MHz US 920 928 MHz Japan 470 510 MHz China Easy to use sample applications included Light weight custom LBT algorithm Light weight custom AA mechanism which...

Page 9: ...SMAC Basic Initialization Before transmitting receiving or performing any other SMAC operation described in this manual the system protocol must be initialized to configure the transceiver with correc...

Page 10: ...eded by SMAC to allocate the received and transmitted OTA messages by declaring the buffers that must be of the size gMaxSmacSDULength_c sizeof packet type uint8_t RxDataBuffer gMaxSmacSDULength_c siz...

Page 11: ...mple communication applications 2 1 Block Diagram Figure 2 1 shows a simplified MKW01 SMAC based stack block diagram Figure 2 1 SMAC System Decomposition An application programming interface API is im...

Page 12: ..._t Signed 16 bit definition int32_t Signed 32 bit definition These data types are used in the MKW01 SMAC project as well as in the applications projects They are defined in the EmbeddedTypes h file 2...

Page 13: ...cket_t RxPacket RxPacket rxPacket_t RxDataBuffer RxPacket u8MaxDataLength gMaxSmacSDULength_c RxEnableResult MLMERXEnableRequest RxPacket 0 You can use a variable of the type smacErrors_t to store the...

Page 14: ...on functions rxTimeOutStatus_c This is another of the possible finish conditions for a timeout condition and could be checked by the indication functions rxAbortedStatus_c This status is set when SMAC...

Page 15: ...u8DataLength to the size in bytes of the payload 6 Use the pointer as the argument when calling MCPSDataRequest uint8_t TxDataBuffer gMaxSmacSDULength_c sizeof txPacket_t txPacket_t TxPacket TxPacket...

Page 16: ...e a data confirm field with this status Also this value is returned in the CCA confirm message if the scanned channel is found idle gErrorBusy_c This constant is returned when the MKW01 SMAC layer is...

Page 17: ...MAC will attempt to re transmitt a packet if AA is enabled and no acknowledgement message is received in the expected time frame 2 2 10 smacTestMode_t typedef enum smacTestMode_tag gTestModeForceIdle_...

Page 18: ...PhyMode4_c gRFMode5_c gPhyMode1ARIB_c ARIB mode 1 gRFMode6_c gPhyMode2ARIB_c ARIB mode 2 gRFMaxMode_c smacRFModes_t Members gRFModeX_c With X from 1 to 4 corresponds to PHY modes 1 to 4 User must chec...

Page 19: ...acMessageDefs_tag gMcpsDataCnf_c gMcpsDataInd_c gMlmeCcaCnf_c gMlmeEdCnf_c gMlmeTimeoutInd_c gMlme_UnexpectedRadioResetInd_c smacMessageDefs_t The above enumeration summarizes the types of messages pa...

Page 20: ...lers are function pointers of a special type When application specifies the functions to handle asynchronous responses the SAP handlers aquire the value of those functions Below are the definitions of...

Page 21: ...Architecture MKW01 Simple Media Access Controller SMAC Reference Manual Rev 0 0 Freescale Semiconductor 2 19 typedef smacErrors_t SMAC_APP_MLME_SapHandler_t smacToAppMlmeMessage_t pMsg instanceId_t in...

Page 22: ...Software Architecture MKW01 Simple Media Access Controller SMAC Reference Manual Rev 0 0 2 20 Freescale Semiconductor...

Page 23: ...Returns gErrorNoError_c Everything is ok and the transmission will be performed gErrorOutOfRange_c One of the members in the pTxMessage structure is out of range not valid buffer size or data buffer...

Page 24: ...d fills it in respect to the user configurations prior to this call and to the information contained in the packet 3 2 MLMETXDisableRequest This function places the radio into stand by and the PHY and...

Page 25: ...utOfRange_c The number of retries exceeds gMaxRetriesAllowed_c Usage Declare a structure of txContextConfig_t type Set the desired values to the members Call MLMEConfigureTxContext with the address of...

Page 26: ...orNoValidCondition_c The MKW01 SMAC has not been initialized gErrorNoResourcesAvailable_c The PHY cannot process a MKW01 SMAC request so the MKW01 SMAC cannot process it Usage SMAC must be initialized...

Page 27: ...ameter If this value is 0 SMAC will create a set PIB request asking PHY to enable the gPhyPibRxOnWhenIdle attribute 3 5 MLMERXDisableRequest Returns the radio to idle mode from receive mode Prototype...

Page 28: ...g the link quality value Returns the result in smacLastDataRxParams linkQuality Zero The MKW01 SMAC has not been initialized Usage Call the MLMELinkQuality Implementation This function reads the store...

Page 29: ...rototype channels_t MLMEGetChannelRequest void Arguments None Returns channels_t uint8_t The current RF channel Usage Call MLMEGetChannelRequest 3 9 MLMEPAOutputAdjust This function adjusts the output...

Page 30: ...rNoError_c If the action is performed gErrorNoValidCondition_c If the MKW01 SMAC is not initialized Usage Call MLMEPHYSoftReset Implementation This function creates a set transceiver state request mes...

Page 31: ...ved in a message passed through the SMAC to application management SAP Arguments None Returns gErrorNoValidCondition_c The MKW01 SMAC has not been initialized gErrorBusy_c Either SMAC or PHY is busy a...

Page 32: ...is gErrorBusy_c the application can wait on this value until SMAC becomes idle 3 14 MLMESetSyncWordSize This function updates the size of the synchronization word maximum 8 bytes Arguments uint8_t u8s...

Page 33: ...ed by address as the parameter Arguments packetConfig_t pPacketCfg Pointer to the packetConfig_t structure containing the new values for preamble length synchronization word size and values Returns gE...

Page 34: ...rorBusy_c the application can wait on this value until SMAC becomes idle 3 18 MLMEGetAdditionalRFOffset This function returns the latest stored frequency drift or 0 if the feature is not enabled Argum...

Page 35: ...message is passed succesfully to PHY SMAC will set it s own PAN address variable to the new value so that when SMACFillHeader is called the updated data is filled into the header Arguments uint16_t n...

Page 36: ...address must be changed uint8_t TxDataBuffer gMaxSmacSDULength_c sizeof txPacket_t txPacket_t TxPacket smacErrors_t smacError TxPacket txPacket_t TxDataBuffer SMACFillHeader TxPacket smacHeader gBroad...

Page 37: ...S_SapHandle Pointer to the function handler for data layer response to asynchronous requests SMAC_APP_MLME_SapHandler_t pSMAC_APP_MLME_SapHandler Pointer to the function handler for management layer r...

Page 38: ...e gMcpsDataCnf_c break default break MEM_BufferFree pMsg return gErrorNoError_c void InitApp Smac_RegisterSapHandlers SMAC_APP_MCPS_SapHandler_t smacToAppMcpsSap SMAC_APP_MLME_SapHandler_t smacToAppMl...

Reviews: