Version of easy-connect with the u-blox cellular platforms C027 and C030 added.

Dependents:   HelloMQTT

Embed: (wiki syntax)

« Back to documentation index

SPIRIT_PktBasic.h File Reference

SPIRIT_PktBasic.h File Reference

Configuration and management of SPIRIT Basic packets. More...

Go to the source code of this file.


Detailed Description

Configuration and management of SPIRIT Basic packets.

Author:
VMA division - AMS
Version:
3.2.2
Date:
08-July-2015

This module can be used to manage the configuration of Spirit Basic packets. The user can obtain a packet configuration filling the structure PktBasicInit, defining in it some general parameters for the Spirit Basic packet format. Another structure the user can fill is PktBasicAddressesInit to define the addresses which will be used during the communication. Moreover, functions to set the payload length and the destination address are provided.

Example:

 PktBasicInit basicInit={
   PKT_PREAMBLE_LENGTH_08BYTES,       // preamble length in bytes
   PKT_SYNC_LENGTH_4BYTES,            // sync word length in bytes
   0x1A2635A8,                        // sync word
   PKT_LENGTH_VAR,                    // variable or fixed payload length
   7,                                 // length field width in bits (used only for variable length)
   PKT_NO_CRC,                        // CRC mode
   PKT_CONTROL_LENGTH_0BYTES,         // control field length
   S_ENABLE,                          // address field
   S_DISABLE,                         // FEC
   S_ENABLE                           // whitening
 };

 PktBasicAddressesInit addressInit={
   S_ENABLE,                          // enable/disable filtering on my address
   0x34,                              // my address (address of the current node)
   S_DISABLE,                         // enable/disable filtering on multicast address
   0xEE,                              // multicast address
   S_DISABLE,                         // enable/disable filtering on broadcast address
   0xFF                               // broadcast address
 };

 ...

 SpiritPktBasicInit(&basicInit);
 SpiritPktBasicAddressesInit(&addressInit);

 ...

 SpiritPktBasicSetPayloadLength(20);
 SpiritPktBasicSetDestinationAddress(0x44);

 ...

The module provides some other functions that can be used to modify or read only some configuration parameters.

Attention:

© COPYRIGHT(c) 2015 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file SPIRIT_PktBasic.h.