NXP Semiconductors MKW01 Reference Manual
NXP Semiconductors MKW01 Reference Manual

NXP Semiconductors MKW01 Reference Manual

Simple media access controller (smac)

Advertisement

Quick Links

MKW01 Simple Media Access
Controller (SMAC)
Reference Manual
Document Number: MKW01SMACRM
Rev. 0.0
3/2015

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MKW01 and is the answer not in the manual?

Questions and answers

Summary of Contents for NXP Semiconductors MKW01

  • Page 1 MKW01 Simple Media Access Controller (SMAC) Reference Manual Document Number: MKW01SMACRM Rev. 0.0 3/2015...
  • Page 2 How to Reach Us: Information in this document is provided solely to enable system and software implementers to use Freescale Semiconductor products. There are no express or implied copyright licenses granted Home Page: hereunder to design or fabricate any integrated circuits or integrated circuits based on the information www.freescale.com in this document.
  • Page 3: Table Of Contents

    1.2. Platform Requirements ......................7 1.3. MCU Resources Used by SMAC ....................7 1.4. SMAC Basic Initialization .......................7 Chapter 2. Software Architecture 2.1. Block Diagram .........................9 2.2. MKW01 SMAC Data Types and Structures ................10 2.2.1 Fundamental Data Types ....................10 2.2.2 rxPacket_t ........................10 2.2.3 smacHeader_t........................
  • Page 4 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. SMACSetPanID ........................33 3.21. SMACFillHeader .........................34 3.22. SMAC_SetIVKey ........................34 3.23. Smac_RegisterSapHandlers ....................35 MKW01 Simple Media Access Controller (SMAC), Rev. 0.0 Freescale Semiconductor...
  • Page 5 MHz, 433 MHz, 470 MHz, 868 MHz, 915 MHz, 928 MHz, and 955 MHz in the license-free Industrial, Scientific, and Medical (ISM) frequency bands. The MKW01 SMAC software is pre-defined to operate in the 470–510 MHz , 863–870 MHz, 902–928 MHz and 920–928 MHz bands.
  • Page 6 Automatic ACK Listen Before Talk Receive(r) Transmit(ter) Clear Channel Assessment Energy Detect References The following sources were referenced to produce this book: 1. Freescale MKW01 Reference Manual (MKW01xxRM.pdf) MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 7: Mkw01 Smac Introduction

    Freescale’s MKW01 sub-1 GHz transceiver plus microcontroller. The MKW01 is a system-in-package (SIP) device that includes an ARM Cortex M0+ based microcontroller and a sub-GHz ISM band radio front-end device in an LGA-56 package. Features of the MKW01 include: •...
  • Page 8: Mkw01 Smac-Based Demonstration Applications

    MKW01 SMAC Introduction • Broadcast communication • Unicast communication — MKW01 SMAC includes a Node Address 16-bit field. This allows SMAC to perform unicast transmissions. To change the address of a node, modify this constant: gNodeAddress_c inside the or call SMAC_Config.h file,...
  • Page 9: Platform Requirements

    MCU Resources Used by SMAC As stated, the MKW01 contains an MCU and a transceiver in a single package. The SMAC does not use MCU resources directly. All accesses to the MCU resources are performed using the framework, drivers and PHY.
  • Page 10 + sizeof(packet gMaxSmacSDULength_c type): uint8_t RxDataBuffer[gMaxSmacSDULength_c + sizeof(rxPacket_t)]; rxPacket_t *RxPacket; uint8_t TxDataBuffer[gMaxSmacSDULength_c + sizeof(txPacket_t)]; txPacket_t *TxPacket; RxPacket = (rxPacket_t*)RxDataBuffer; TxPacket = (txPacket_t*)TxDataBuffer; MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 11: Software Architecture

    MKW01 SMAC based stack block diagram. Figure 2-1. SMAC System Decomposition An application programming interface (API) is implemented in the MKW01 SMAC as a C header file ( that allows access to the code. The code includes the API to specific functions. Thus, the application...
  • Page 12: Mkw01 Smac Data Types And Structures

    Signed 8-bit definition int16_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 file. EmbeddedTypes.h 2.2.2 rxPacket_t This structure defines the variable used for MKW01 SMAC received data buffer:...
  • Page 13: Smacheader_T

    RxEnableResult = MLMERXEnableRequest(RxPacket, 0); You can use a variable of the type smacErrors_t to store the result of executing MLMERXEnableRequest function. 2.2.3 smacHeader_t This structure defines the variable used for MKW01 SMAC header: typedef PACKED_STRUCT rxPacket_tag{ uint16_t frameControl; uint8_t seqNo;...
  • Page 14: Rxstatus_T

    Starting position of the buffer where TX or RX data is stored. 2.2.6 txPacket_t This structure defines the type of variable to be transmitted by the MKW01 SMAC. It is located in the file and is defined as follows: SMAC_Interface.h typedef struct txPacket_tag uint8_t u8DataLength;...
  • Page 15: Channels_T

    } channels_t; Each application derives the minimun and maximum channel values from the enumeration above. SMAC only keeps an enumeration of all the possible channel numbers. Members None MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 2-13...
  • Page 16: Smacerrors_T

    Software Architecture 2.2.8 smacErrors_t This enumeration is used as the set of possible return values on most of the MKW01 SMAC API functions and is located in the . Also, some of the messages sent by SMAC to the application use SMAC_Interface.h...
  • Page 17: Txcontextconfig_T

    “LBT” mechanism. autoAck bool_t value to enable/disable the “AA” mechanism. retryCountCCAFail This value specifies the number of times the MKW01 SMAC will attempt to re-transmitt a packet if “LBT” is enabled and channel is found busy. retryCountAckFail This value specifies the number of times the MKW01 SMAC will attempt to re-transmitt a packet if “AA”...
  • Page 18: Smacrfmodes_T

    IV[16]; uint8_t KEY[16]; }smacEncryptionKeyIV_t; Members The initial vector used by the CBC mode of AES. The encryption / decryption key used by the CBC mode of AES. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 2-16 Freescale Semiconductor...
  • Page 19: Mkw01 Smac To Application Messaging

    RSSI obtained during the reception pRxPacket pointer to the packet passed as parameter to MLMERXEnableRequest. smacCcaCnf_t Contains a smacErrors_t element. See gMlmeCcaCnf_c Section 2.2.8, “smacErrors_t” MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 2-17...
  • Page 20 SAP handlers aquire the value of those functions. Below are the definitions of the handlers. typedef smacErrors_t ( * SMAC_APP_MCPS_SapHandler_t)(smacToAppDataMessage_t * pMsg, instanceId_t instanceId); MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 2-18 Freescale Semiconductor...
  • Page 21 Software Architecture typedef smacErrors_t ( * SMAC_APP_MLME_SapHandler_t)(smacToAppMlmeMessage_t * pMsg, instanceId_t instanceId); MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 2-19...
  • Page 22 Software Architecture MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 2-20 Freescale Semiconductor...
  • Page 23: Chapter 3. Primitives

    MKW01 SMAC application API. MCPSDataRequest This data primitive is used to send an over-the-air (OTA) packet. This is an asynchronous function, which means it asks the MKW01 SMAC to transmit an OTA packet, but transmission could continue after the function returns. Prototype smacErrors_t MCPSDataRequest(txPacket_t *psTxPacket);...
  • Page 24: Mlmetxdisablerequest

    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. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 3-22 Freescale Semiconductor...
  • Page 25: Mlmeconfiguretxcontext

    This primitive configures the way SMAC will handle data requests and responses from PHY according to the parameters described by the txContextConfig_t structure. Also, requests forwarded by SMAC to PHY depend on addressing and txContextConfig_t information. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 3-23...
  • Page 26: Mlmerxenablerequest

    The radio is performing another action and could not attend this request. gErrorNoValidCondition_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 before calling this function.
  • Page 27: Mlmerxdisablerequest

    PIB request, requiring the gPhyPibRxOnWhenIdle to be set to 0. If the timeout value is greater than 0, the message is filled as a set transceiver state request, disabling the receiver. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 28: Mlmelinkquality

    Returns gErrorNoError_c The channel set has been performed. gErrorBusy_c The MKW01 SMAC is busy in other radio activity like transmitting/receiving data or performing a channel scan. gErrorOutOfRange_c The requested channel is not valid. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0...
  • Page 29: Mlmegetchannelrequest

    8-bit value for the output power desired. Values 1– 31 are required. Returns gErrorOutOfRange_c u8Power exceeds the maximum power value gMaxOutputPower_c (0x1F). gErrorBusy_c The MKW01 SMAC is busy or PHY is busy. gErrorNoError_c The action is performed. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 3-27...
  • Page 30: Mlmephysoftreset

    Call MLMEPAOutputAdjust(u8PaValue); NOTE Be sure to enter a valid value for the PA output adjust. 3.10 MLMEPhySoftReset The MLMEPhySoftReset function is called to perform a software reset to the PHY and MKW01 SMAC state machines. Prototype smacErrors_t MLMEPHYSoftReset(void); Arguments None...
  • Page 31: Mlmeccarequest

    This function creates a message for PHY requesting a CCA on the currently selected channel. After passing the message through the SAP, SMAC changes it’s state to mSmacStatePerformingCca_c MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 3-29...
  • Page 32: Mlmesetpreamblelength

    For example, if the return value is gErrorBusy_c, the application can wait on this value until SMAC becomes idle. 3.15 MLMESetSyncWordValue This function updates the value of the synchronization word. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 3-30 Freescale Semiconductor...
  • Page 33: Mlmepacketconfig

    This function sets the frequency drift in number of Fsteps (57 Hz on 30MHz platforms, 61 Hz on 32MHz platforms) passed as parameter to fine tune the central frequency of the channel on MKW01 platforms. The frequency is updated at the next MLMESetChannelRequest call.
  • Page 34: Mlmegetadditionalrfoffset

    The PHY layer can not handle this request. gErrorBusy_c PHY is busy and can not process the request. gErrorNoError_c Everything is normal and the request was processed. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 3-32 Freescale Semiconductor...
  • Page 35: Smacsetpanid

    This function creates a message for PHY requesting to set the PAN address pib to the value passed as parameter. If the request is processed, the value is also stored in the SMAC layer for fast processing in case a call to SMACFillHeader is performed. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 3-33...
  • Page 36: Smacfillheader

    This function sets the initial vector and encryption key for the encryption process if gSmacUseSecurity_c is defined. Arguments uint8_t* KEY Pointer to a 16 byte buffer containing the key. uint8_t* IV Pointer to a 16 byte buffer containing the initial vector. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 3-34 Freescale Semiconductor...
  • Page 37: Smac_Registersaphandlers

    Implement two functions that meet the constraints of the function pointers. Then call with the names of the functions. Smac_RegisterSapHandlers smacErrors_t smacToAppMlmeSap(smacToAppMlmeMessage_t* pMsg, instanceId_t instance) switch(pMsg->msgType) case gMlmeEdCnf_c: break; case gMlmeCcaCnf_c: break; case gMlmeTimeoutInd_c: break; MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 Freescale Semiconductor 3-35...
  • Page 38 Whenever an asynchronous response needs to be passed from SMAC to application, the internal handlers are called, which in turn call the ones defined by the application. MKW01 Simple Media Access Controller (SMAC) Reference Manual, Rev. 0.0 3-36 Freescale Semiconductor...

Table of Contents