mirror of https://github.com/ARMmbed/mbed-os.git
Upgrade RAIL to v2.1.1
parent
4e222952d7
commit
76fd28c825
File diff suppressed because it is too large
Load Diff
|
@ -1,2 +0,0 @@
|
|||
Unless specifically indicated otherwise in a file, files are licensed
|
||||
under the Apache 2.0 license, as can be found in: apache-2.0.txt
|
|
@ -1,6 +1,6 @@
|
|||
# Example 802.15.4 RF driver for Silicon Labs EFR32 Wireless SoCs #
|
||||
|
||||
Support for:
|
||||
* EFR32MG1X
|
||||
* EFR32 Series 1 (EFR32xG1x)
|
||||
|
||||
This driver is used with the mbed 6LoWPAN stack.
|
|
@ -0,0 +1,113 @@
|
|||
END-USER LICENSE AGREEMENT
|
||||
IMPORTANT: READ CAREFULLY
|
||||
BEFORE AGREEING TO TERMS
|
||||
|
||||
THIS PRODUCT CONTAINS CERTAIN COMPUTER PROGRAMS AND OTHER THIRD PARTY
|
||||
PROPRIETARY MATERIAL ("LICENSED PRODUCT"), THE USE OF WHICH IS SUBJECT TO THIS
|
||||
END-USER LICENSE AGREEMENT. INDICATING YOUR AGREEMENT CONSTITUTES YOUR AND
|
||||
(IF APPLICABLE) YOUR COMPANY'S ASSENT TO AND ACCEPTANCE OF THIS END-USER LICENSE
|
||||
AGREEMENT (THE "LICENSE" OR "AGREEMENT"). IF YOU DO NOT AGREE WITH ALL OF THE
|
||||
TERMS, YOU MUST NOT USE THIS PRODUCT. WRITTEN APPROVAL IS NOT A PREREQUISITE TO
|
||||
THE VALIDITY OR ENFORCEABILITY OF THIS AGREEMENT, AND NO SOLICITATION OF SUCH
|
||||
WRITTEN APPROVAL BY OR ON BEHALF OF SILICON LABORATORIES, INC. ("SILICON LABS")
|
||||
SHALL BE CONSTRUED AS AN INFERENCE TO THE CONTRARY. IF THESE TERMS ARE
|
||||
CONSIDERED AN OFFER BY SILICON LABS, ACCEPTANCE IS EXPRESSLY LIMITED TO THESE
|
||||
TERMS.
|
||||
|
||||
LICENSE AND WARRANTY: The Licensed Product and the embedded Software which is
|
||||
made the subject of this License is either the property of SILICON LABS or a
|
||||
third party from whom SILICON LABS has the authorization to distribute to you
|
||||
subject to the terms of this Agreement. This Licensed Product is protected by
|
||||
state, federal, and international copyright law. Although SILICON LABS continues
|
||||
to own the Licensed Product and the right to distribute the embedded third party
|
||||
Software, you will have certain rights to use the Licensed Product and the
|
||||
embedded Software after your acceptance of this License. Except as may be
|
||||
modified by a license addendum which accompanies this License, your rights and
|
||||
obligations with respect to the use of this Product and the embedded software
|
||||
are as follows:
|
||||
|
||||
1. AS APPROPRIATE WITH RESPECT TO THE LICENSED PRODUCT, YOU MAY: Use, copy,
|
||||
distribute and make derivative works of the Software for any purpose,
|
||||
including commercial applications, subject to the following restrictions:
|
||||
(i) The origin of this software must not be misrepresented; (ii) you must
|
||||
not claim that you wrote the original software; (iii) altered source
|
||||
versions must be plainly marked as such, and must not be misrepresented as
|
||||
being the original software; and (iv) any notices contained in the Software
|
||||
may not be removed or altered, including notices in source code versions.
|
||||
|
||||
2. YOU MAY NOT: (A) Sublicense, assign, rent or lease any portion of the
|
||||
Licensed Product or the embedded Software; or (B) Remove any product
|
||||
identification, copyright or other notices that appear on the Licensed
|
||||
Product or embedded Software.
|
||||
|
||||
3. Limited Use: Use of any of the Software is strictly limited to use in
|
||||
systems containing one or more SILICON LABS products when the Software is
|
||||
enabled to be functional. Any unauthorized use is expressly prohibited and
|
||||
will constitute a breach of this Agreement.
|
||||
|
||||
4. Warranty: SILICON LABS does not warrant that the Licensed Product or
|
||||
embedded Software will meet your requirements or that operation of the
|
||||
Licensed Product will be uninterrupted or that the embedded Software will be
|
||||
error-free. You agree that the Licensed Product is provided "AS IS" and
|
||||
that SILICON LABS makes no warranty as to the Licensed Product or embedded
|
||||
Software. SILICON LABS DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
|
||||
INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT, RELATED TO THE
|
||||
SOFTWARE, ITS USE OR ANY INABILITY TO USE IT, THE RESULTS OF ITS USE AND
|
||||
THIS AGREEMENT.
|
||||
|
||||
YOU MAY HAVE OTHER RIGHTS, WHICH VARY FROM STATE TO STATE.
|
||||
|
||||
5. Disclaimer of Damages: IN NO EVENT WILL SILICON LABS BE LIABLE TO YOU FOR
|
||||
ANY SPECIAL, CONSEQUENTIAL, INDIRECT, OR SIMILAR DAMAGES, INCLUDING ANY LOST
|
||||
PROFITS OR LOST DATA ARISING OUT OF THE USE OR INABILITY TO USE THE LICENSED
|
||||
PRODUCT EVEN IF SILICON LABS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
SOME STATES DO NOT ALLOW THE LIMITATION OR EXCLUSION OF LIABILITY FOR
|
||||
INCIDENTAL OR CONSEQUENTIAL DAMAGES. SO THE ABOVE LIMITATION OR EXCLUSION
|
||||
MAY NOT APPLY TO YOU.
|
||||
|
||||
IN NO CASE SHALL SILICON LABS' LIABILITY EXCEED THE PURCHASE PRICE FOR THE
|
||||
LICENSED PRODUCT. The disclaimers and limitations set forth above will
|
||||
apply regardless of whether you accept the Licensed Software.
|
||||
|
||||
6. Term and Termination: The term of this Agreement and the License granted
|
||||
herein shall begin upon use of the Licensed Product and continue in
|
||||
perpetuity unless you breach any of the obligations set out under this
|
||||
Agreement. Upon your breach of this Agreement by you, the license granted
|
||||
hereunder shall terminate immediately and you shall cease all use of the
|
||||
Licensed Products and return same as well as any copies of the Licensed
|
||||
Product and/or embedded Software to SILICON LABS immediately. Termination
|
||||
of this License upon your breach is only one remedy available to SILICON
|
||||
LABS. In addition to termination of this Agreement upon your breach,
|
||||
SILICON LABS shall be entitled to seek any and all other available remedies,
|
||||
at law or at equity, arising from your breach.
|
||||
|
||||
7. Export: You shall comply with all applicable federal, provincial, state and
|
||||
local laws, regulations and ordinances including but not limited to
|
||||
applicable U.S. Export Administration Laws and Regulations. You shall not
|
||||
export or re-export, or allow the export or re-export of the Licensed
|
||||
Product, any component of the Licensed Product, or any copy of the embedded
|
||||
Software in violation of any such restrictions, laws or regulations, or to
|
||||
Cuba, Libya, North Korea, Iran, Iraq, or Rwanda or to any Group D:1 or E:2
|
||||
country (or any national of such country) specified in the then current
|
||||
Supplement No. 1 to Part 740, or, in violation of the embargo provisions in
|
||||
Part 746, of the U.S. Export Administration Regulations (or any successor
|
||||
regulations or supplement), except in compliance with and with all licenses
|
||||
and approvals required under applicable export laws and regulations,
|
||||
including without limitation, those of the U.S. Department of Commerce.
|
||||
|
||||
8. General: This Agreement will be governed by the laws of the State of Texas
|
||||
and any applicable federal laws or regulations. The waiver by either Party
|
||||
of any default or breach of this Agreement shall not constitute a waiver of
|
||||
any other or subsequent default or breach. This Agreement constitutes the
|
||||
complete and exclusive statement of the mutual understanding between you and
|
||||
SILICON LABS with respect to this subject matter herein. This Agreement may
|
||||
only be modified by a written addendum, which has been signed by both you
|
||||
and SILICON LABS. Should you have any questions concerning this Agreement,
|
||||
or if you desire to contact SILICON LABS for any reason, please write:
|
||||
|
||||
Silicon Laboratories, Inc.
|
||||
400 West Cesar Chavez
|
||||
Austin, Texas 78701, U.S.A.
|
|
@ -1,56 +0,0 @@
|
|||
|
||||
|
||||
Apache License
|
||||
|
||||
Version 2.0, January 2004
|
||||
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
|
@ -1,105 +0,0 @@
|
|||
/***************************************************************************//**
|
||||
* @file buffer_pool_allocator.c
|
||||
* @brief The source for a simple memory allocator that statically creates pools
|
||||
* of fixed size buffers to allocate from.
|
||||
* @copyright Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "buffer_pool_allocator.h"
|
||||
|
||||
#include "em_core.h"
|
||||
|
||||
#ifdef CONFIGURATION_HEADER
|
||||
#include CONFIGURATION_HEADER
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Configuration Macros
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#ifndef BUFFER_POOL_SIZE
|
||||
#define BUFFER_POOL_SIZE 8
|
||||
#endif
|
||||
#ifndef MAX_BUFFER_SIZE
|
||||
#define MAX_BUFFER_SIZE 160
|
||||
#endif
|
||||
|
||||
#define INVALID_BUFFER_OBJ ((void*)0xFFFFFFFF)
|
||||
|
||||
typedef struct {
|
||||
uint8_t refCount;
|
||||
uint8_t data[MAX_BUFFER_SIZE];
|
||||
} BufferPoolObj_t;
|
||||
|
||||
static BufferPoolObj_t memoryObjs[BUFFER_POOL_SIZE];
|
||||
|
||||
void* memoryAllocate(uint32_t size)
|
||||
{
|
||||
uint32_t i = 0;
|
||||
void *handle = INVALID_BUFFER_OBJ;
|
||||
|
||||
// We can't support sizes greater than the maximum heap buffer size
|
||||
if(size > MAX_BUFFER_SIZE) {
|
||||
return INVALID_BUFFER_OBJ;
|
||||
}
|
||||
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
for(i = 0; i < BUFFER_POOL_SIZE; i++)
|
||||
{
|
||||
if(memoryObjs[i].refCount == 0)
|
||||
{
|
||||
memoryObjs[i].refCount = 1;
|
||||
handle = (void*)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
CORE_EXIT_CRITICAL();
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
void *memoryPtrFromHandle(void *handle)
|
||||
{
|
||||
void *ptr = NULL;
|
||||
|
||||
// Make sure we were given a valid handle
|
||||
if((handle == INVALID_BUFFER_OBJ) || ((uint32_t)handle > BUFFER_POOL_SIZE))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
if(memoryObjs[(uint32_t)handle].refCount > 0)
|
||||
{
|
||||
ptr = memoryObjs[(uint32_t)handle].data;
|
||||
}
|
||||
CORE_EXIT_CRITICAL();
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void memoryFree(void *handle)
|
||||
{
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
if(memoryPtrFromHandle(handle) != NULL)
|
||||
{
|
||||
memoryObjs[(uint32_t)handle].refCount--;
|
||||
}
|
||||
CORE_EXIT_CRITICAL();
|
||||
}
|
||||
|
||||
void memoryTakeReference(void *handle)
|
||||
{
|
||||
CORE_DECLARE_IRQ_STATE;
|
||||
CORE_ENTER_CRITICAL();
|
||||
if(memoryPtrFromHandle(handle) != NULL)
|
||||
{
|
||||
memoryObjs[(uint32_t)handle].refCount++;
|
||||
}
|
||||
CORE_EXIT_CRITICAL();
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
/***************************************************************************//**
|
||||
* @file buffer_pool_allocator.h
|
||||
* @brief This is a simple memory allocator that uses a build time defined pool
|
||||
* of constant sized buffers. It's a very simple allocator, but one that can
|
||||
* be easily used in any application.
|
||||
*
|
||||
* @copyright Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef BUFFER_POOL_ALLOCATOR_H__
|
||||
#define BUFFER_POOL_ALLOCATOR_H__
|
||||
|
||||
// Get the standard include types
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Allocate a buffer with at least the number of bytes specified. If there is
|
||||
* not enough space then this function will return NULL.
|
||||
* @param size The number of bytes to allocate for this buffer
|
||||
* @return Returns a handle to a buffer at least size bytes long or NULL if no
|
||||
* buffer could be allocated.
|
||||
*/
|
||||
void* memoryAllocate(uint32_t size);
|
||||
|
||||
/**
|
||||
* Free the buffer pointed to by handle. This will only decrement the reference
|
||||
* counter for this buffer. The memory is not freed until the reference counter
|
||||
* reaches zero.
|
||||
* @param handle The handle to free. Must match the value returned by
|
||||
* the memoryAllocate() function.
|
||||
*/
|
||||
void memoryFree(void *handle);
|
||||
|
||||
/**
|
||||
* Take a memory handle and get the data pointer associated with it. This will
|
||||
* return NULL if passed an invalid or unallocated handle.
|
||||
* @param handle The handle to get the pointer for. Must match the value
|
||||
* returned by the memoryAllocate() function.
|
||||
*/
|
||||
void *memoryPtrFromHandle(void *handle);
|
||||
|
||||
/**
|
||||
* Increment the reference counter on the memory pointed to by handle. After
|
||||
* doing this there will have to be an additional call to memoryFree() to
|
||||
* release the memory.
|
||||
* @param handle The handle to the object which needs its reference count
|
||||
* increased. Must match the value returned by the memoryAllocate() function.
|
||||
*/
|
||||
void memoryTakeReference(void *handle);
|
||||
|
||||
#endif // BUFFER_POOL_ALLOCATOR_H__
|
|
@ -1,35 +0,0 @@
|
|||
/***************************************************************************//**
|
||||
* @file rail_integration.c
|
||||
* @brief Simple code to link this memory manager with a RAIL application by
|
||||
* implementing the appropriate callbacks.
|
||||
* @copyright Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include "rail.h"
|
||||
#include "buffer_pool_allocator.h"
|
||||
|
||||
/// Rely on the pool allocator's allocate function to get memory
|
||||
void *RAILCb_AllocateMemory(uint32_t size)
|
||||
{
|
||||
return memoryAllocate(size);
|
||||
}
|
||||
|
||||
/// Use the pool allocator's free function to return the memory to the pool
|
||||
void RAILCb_FreeMemory(void *ptr)
|
||||
{
|
||||
memoryFree(ptr);
|
||||
}
|
||||
|
||||
/// Get the memory pointer for this handle and offset into it as requested
|
||||
void *RAILCb_BeginWriteMemory(void *handle,
|
||||
uint32_t offset,
|
||||
uint32_t *available)
|
||||
{
|
||||
return ((uint8_t*)memoryPtrFromHandle(handle)) + offset;
|
||||
}
|
||||
|
||||
/// We don't need to track the completion of a memory write so do nothing
|
||||
void RAILCb_EndWriteMemory(void *handle, uint32_t offset, uint32_t size)
|
||||
{
|
||||
}
|
Binary file not shown.
Binary file not shown.
|
@ -1,18 +0,0 @@
|
|||
|
||||
/***************************************************************************//**
|
||||
* @file ieee802154_config.h
|
||||
* @brief IEEE802154 Configuration
|
||||
* @copyright Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __IEEE802154_EFR32XG1_CONFIGURATOR_OUT_H__
|
||||
#define __IEEE802154_EFR32XG1_CONFIGURATOR_OUT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern const uint32_t ieee802154_config_base[];
|
||||
extern const uint32_t ieee802154_config_base_min[];
|
||||
extern const uint32_t ieee802154_config_2415MHz_min[];
|
||||
extern const uint32_t ieee802154_config_2420MHz_min[];
|
||||
|
||||
#endif // __IEEE802154_EFR32XG1_CONFIGURATOR_OUT_H__
|
Binary file not shown.
|
@ -1,18 +0,0 @@
|
|||
|
||||
/***************************************************************************//**
|
||||
* @file ieee802154_config.h
|
||||
* @brief IEEE802154 Configuration
|
||||
* @copyright Copyright 2015 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __IEEE802154_EFR32XG12_CONFIGURATOR_OUT_H__
|
||||
#define __IEEE802154_EFR32XG12_CONFIGURATOR_OUT_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern const uint32_t ieee802154_config_base[];
|
||||
extern const uint32_t ieee802154_config_base_min[];
|
||||
extern const uint32_t ieee802154_config_2415MHz_min[];
|
||||
extern const uint32_t ieee802154_config_2420MHz_min[];
|
||||
|
||||
#endif // __IEEE802154_EFR32XG12_CONFIGURATOR_OUT_H__
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,218 @@
|
|||
/***************************************************************************//**
|
||||
* @file rail_ble.h
|
||||
* @brief The BLE specific header file for the RAIL library.
|
||||
* @copyright Copyright 2016 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __RAIL_BLE_H__
|
||||
#define __RAIL_BLE_H__
|
||||
|
||||
// Get the standard include types
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
// Get the RAIL specific structures and types
|
||||
#include "rail_types.h"
|
||||
|
||||
/**
|
||||
* @addtogroup BLE
|
||||
* @ingroup Protocol_Specific
|
||||
* Accelerator routines for Bluetooth Low Energy (BLE).
|
||||
*
|
||||
* The APIs in this module help take care of configuring the radio for BLE
|
||||
* operation and provide some additional helper routines necessary for
|
||||
* normal BLE send/receive that aren't available directly in RAIL. To initialize
|
||||
* the radio you will still have to call RAIL_Init(). However
|
||||
* RAIL_ConfigChannels(), and RAIL_ConfigRadio() will be taken care of for you.
|
||||
*
|
||||
* To implement a standard BLE link layer you will also need to handle tight
|
||||
* turnaround times and send packets at specific instants. This can all be
|
||||
* managed through general RAIL functions like RAIL_ScheduleTx(),
|
||||
* RAIL_ScheduleRx(), and RAIL_SetStateTiming(). See the full RAIL API for more
|
||||
* useful functions.
|
||||
*
|
||||
* A simple example of how to setup your application to be in BLE mode is shown
|
||||
* below. Note that this will put the radio on the first advertising channel
|
||||
* with the advertising Access Address. In any full featured BLE application you
|
||||
* will need to use the RAIL_BLE_ConfigChannelRadioParams() function to change
|
||||
* the sync word and other parameters as needed based on your connection.
|
||||
*
|
||||
* @code{.c}
|
||||
*
|
||||
* // Put the radio into receive on the first BLE advertising channel
|
||||
* int bleAdvertiseEnable(void)
|
||||
* {
|
||||
* // Call the BLE initialization function to load the right radio config
|
||||
* RAIL_BLE_Init();
|
||||
*
|
||||
* // Configure us for the first advertising channel (Physical: 0, Logical: 37)
|
||||
* // The CRC init value and Access Address come from the BLE specification.
|
||||
* RAIL_BLE_ConfigChannelRadioParams(0x555555, 0x8E89BED6, 37, false);
|
||||
*
|
||||
* // Start receiving on this channel (Physical: 0, Logical: 37)
|
||||
* RAIL_StartRx(0);
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @enum RAIL_BLE_Coding_t
|
||||
* @brief The variant of the BLE Coded PHY
|
||||
*/
|
||||
RAIL_ENUM(RAIL_BLE_Coding_t) {
|
||||
RAIL_BLE_Coding_125kbps = 0,
|
||||
RAIL_BLE_Coding_125kbps_DSA = 1,
|
||||
RAIL_BLE_Coding_500kbps = 2,
|
||||
RAIL_BLE_Coding_500kbps_DSA = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct RAIL_BLE_State_t
|
||||
* @brief State structure for BLE.
|
||||
*
|
||||
* This structure must be allocated in application global read-write memory
|
||||
* that persists for the duration of BLE usage. It cannot be allocated
|
||||
* in read-only memory or on the call stack.
|
||||
*/
|
||||
typedef struct RAIL_BLE_State {
|
||||
uint32_t crcInit; /**< The value used for CRC initialization. */
|
||||
uint32_t accessAddress; /**< The access address used for the connection. */
|
||||
uint16_t channel; /**< The logical channel used. */
|
||||
bool disableWhitening; /**< Whether the whitening engine should be off. */
|
||||
} RAIL_BLE_State_t;
|
||||
|
||||
/**
|
||||
* Configure RAIL to run in BLE mode.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* This function will change your radio and channel configuration and other
|
||||
* parameters to match what is needed for BLE. If you need to switch back to a
|
||||
* default RAIL mode then you must call RAIL_BLE_Deinit() first. This function
|
||||
* will configure the protocol output on PTI to \ref RAIL_PTI_PROTOCOL_BLE.
|
||||
*/
|
||||
void RAIL_BLE_Init(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Take RAIL out of BLE mode.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* This function will undo some of the configuration that happens when you call
|
||||
* RAIL_BLE_Init(). After this you can safely run your normal radio
|
||||
* initialization code to use a non-BLE configuration. This function will \b
|
||||
* not change back your radio or channel configurations so you must do this by
|
||||
* manually reinitializing. This also resets the protocol output on PTI to \ref
|
||||
* RAIL_PTI_PROTOCOL_CUSTOM.
|
||||
*/
|
||||
void RAIL_BLE_Deinit(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Determine whether BLE mode is enabled or not.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @return True if BLE mode is enabled and false otherwise.
|
||||
* This function returns the current status of RAIL's BLE mode. It is enabled by
|
||||
* a call to RAIL_BLE_Init() and disabled by a call to RAIL_BLE_Deinit().
|
||||
*/
|
||||
bool RAIL_BLE_IsEnabled(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Switch the Viterbi 1Mbps BLE PHY.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* You can use this function to switch back to the defualt BLE 1Mbps PHY if you
|
||||
* have switched to the 2Mbps or another configuration. You may only call this
|
||||
* function after initializing BLE and while the radio is idle.
|
||||
*/
|
||||
RAIL_Status_t RAIL_BLE_ConfigPhy1MbpsViterbi(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Switch the legacy non-Viterbi 1Mbps BLE PHY.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* You can use this function to switch back to the legacy BLE 1Mbps PHY if you
|
||||
* have switched to the 2Mbps or another configuration. You may only call this
|
||||
* function after initializing BLE and while the radio is idle.
|
||||
*/
|
||||
RAIL_Status_t RAIL_BLE_ConfigPhy1Mbps(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Switch the Viterbi 2Mbps BLE PHY.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* You can use this function to switch back to the BLE 2Mbps PHY from the
|
||||
* default 1Mbps option. You may only call this function after initializing BLE
|
||||
* and while the radio is idle.
|
||||
*
|
||||
* @note Not all chips support the 2Mbps PHY. Consult your part's reference
|
||||
* manual to be sure that it does before trying this.
|
||||
*/
|
||||
RAIL_Status_t RAIL_BLE_ConfigPhy2MbpsViterbi(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Switch the legacy non-Viterbi 2Mbps BLE PHY.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* You can use this function to switch back to legacy BLE 2Mbps PHY from the
|
||||
* default 1Mbps option. You may only call this function after initializing BLE
|
||||
* and while the radio is idle.
|
||||
*
|
||||
* @note Not all chips support the 2Mbps PHY. Consult your part's reference
|
||||
* manual to be sure that it does before trying this.
|
||||
*/
|
||||
RAIL_Status_t RAIL_BLE_ConfigPhy2Mbps(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Switch to the BLE Coded PHY.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @param[in] ble_coding The RAIL_BLE_Coding_t to use
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* You can use this function to switch back to BLE Coded PHY from the default
|
||||
* 1Mbps option. You may only call this function after initializing BLE and
|
||||
* while the radio is idle. When using a BLE Coded PHY, the subPhy in
|
||||
* RAIL_AppendedInfo_t marks the coding of the received packet. A subPhy of 0
|
||||
* marks a 500kbps packet, and a subPhy of 1 marks a 125kbps packet.
|
||||
*
|
||||
* @note Not all chips support the BLE Coded PHY. Consult your part's reference
|
||||
* manual to be sure that it does before trying this.
|
||||
*/
|
||||
RAIL_Status_t RAIL_BLE_ConfigPhyCoded(RAIL_Handle_t railHandle,
|
||||
RAIL_BLE_Coding_t ble_coding);
|
||||
|
||||
/**
|
||||
* Helper function to change BLE radio parameters.
|
||||
*
|
||||
* @param[in] railHandle Handle for RAIL instance.
|
||||
* @param[in] crcInit The value to use for CRC initialization.
|
||||
* @param[in] accessAddress The access address to use for the connection.
|
||||
* @param[in] channel The logical channel that you're changing to. This is used to
|
||||
* initialize the whitener if you're using whitening.
|
||||
* @param[in] disableWhitening This can turn off the whitening engine and is useful
|
||||
* for sending BLE test mode packets that don't have this turned on.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* This function can be used to switch radio parameters on every connection
|
||||
* and/or channel change. It is BLE-aware and will set the access address,
|
||||
* preamble, CRC initialization value, and whitening configuration without
|
||||
* requiring you to load a new radio config.
|
||||
*/
|
||||
RAIL_Status_t RAIL_BLE_ConfigChannelRadioParams(RAIL_Handle_t railHandle,
|
||||
uint32_t crcInit,
|
||||
uint32_t accessAddress,
|
||||
uint16_t channel,
|
||||
bool disableWhitening);
|
||||
|
||||
/** @} */ // end of BLE
|
||||
|
||||
#endif // __RAIL_BLE_H__
|
|
@ -7,13 +7,11 @@
|
|||
#ifndef __RAIL_IEEE802154_H__
|
||||
#define __RAIL_IEEE802154_H__
|
||||
|
||||
/**
|
||||
* @addtogroup Protocol_Specific
|
||||
* @{
|
||||
*/
|
||||
#include "rail_types.h"
|
||||
|
||||
/**
|
||||
* @addtogroup IEEE802_15_4
|
||||
* @addtogroup IEEE802_15_4 IEEE 802.15.4
|
||||
* @ingroup Protocol_Specific
|
||||
* @brief IEEE 802.15.4 configuration routines
|
||||
*
|
||||
* The functions in this group configure RAIL IEEE 802.15.4 hardware
|
||||
|
@ -21,14 +19,14 @@
|
|||
* RAIL_IEEE802154_Init(). Make note that this function calls many other RAIL
|
||||
* functions; the application is advised to not reconfigure any of these
|
||||
* functions. When using 802.15.4 functionality in the 2.4 GHz band, consider
|
||||
* using RAIL_IEEE802154_2p4GHzRadioConfig() instead of RAIL_RadioConfig() and
|
||||
* RAIL_ChannelConfig().
|
||||
* using RAIL_IEEE802154_Config2p4GHzRadio() instead of RAIL_ConfigRadio() and
|
||||
* RAIL_ConfigChannels().
|
||||
*
|
||||
* @code{.c}
|
||||
* RAIL_IEEE802154_Config_t config = { false, false,
|
||||
* RAIL_IEEE802154_Config_t config = { NULL, {100, 192, 894, RAIL_RF_STATE_RX},
|
||||
* RAIL_IEEE802154_ACCEPT_STANDARD_FRAMES,
|
||||
* RAIL_RF_STATE_RX, 100, 192, 894, NULL };
|
||||
* RAIL_IEEE802154_2p4GHzRadioConfig();
|
||||
* false, false };
|
||||
* RAIL_IEEE802154_Config2p4GHzRadio();
|
||||
* RAIL_IEEE802154_Init(&config);
|
||||
* @endcode
|
||||
*
|
||||
|
@ -40,24 +38,29 @@
|
|||
* configuration.
|
||||
*
|
||||
* @code{.c}
|
||||
* uint8_t longAddress[8] = { 0x11, 0x22, 0x33, 0x44,
|
||||
* 0x55, 0x66, 0x77, 0x88};
|
||||
* // PanID OTA value of 0x34 0x12
|
||||
* // Short Address OTA byte order of 0x78 0x56
|
||||
* // Long address with OTA byte order of 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
|
||||
* RAIL_IEEE802154_AddrConfig_t nodeAddress = { 0x1234, 0x5678,
|
||||
* &longAddress[0] };
|
||||
* RAIL_IEEE802154_AddrConfig_t nodeAddress = {
|
||||
* { 0x1234, 0xFFFF },
|
||||
* { 0x5678, 0xFFFF },
|
||||
* { { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88 },
|
||||
* { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } }
|
||||
* };
|
||||
*
|
||||
* bool status = RAIL_IEEE802154_SetAddresses(&nodeAddress);
|
||||
*
|
||||
* // Alternative methods:
|
||||
* status = RAIL_IEEE802154_SetPanId(nodeAddress.panId);
|
||||
* status = RAIL_IEEE802154_SetShortAddress(nodeAddress.shortAddr);
|
||||
* status = RAIL_IEEE802154_SetLongAddress(nodeAddress.longAddr);
|
||||
* status = RAIL_IEEE802154_SetPanId(nodeAddress.panId[0], 0);
|
||||
* status = RAIL_IEEE802154_SetPanId(nodeAddress.panId[1], 1);
|
||||
* status = RAIL_IEEE802154_SetShortAddress(nodeAddress.shortAddr[0], 0);
|
||||
* status = RAIL_IEEE802154_SetShortAddress(nodeAddress.shortAddr[1], 1);
|
||||
* status = RAIL_IEEE802154_SetLongAddress(nodeAddress.longAddr[0], 0);
|
||||
* status = RAIL_IEEE802154_SetLongAddress(nodeAddress.longAddr[1], 1);
|
||||
* @endcode
|
||||
*
|
||||
* Auto ack is initialized through RAIL_IEEE802154_Init(). It is not advised
|
||||
* to call RAIL_AutoAckConfig() while 802.15.4 hardware acceleration is
|
||||
* to call RAIL_ConfigAutoAck() while 802.15.4 hardware acceleration is
|
||||
* enabled. The default IEEE 802.15.4 ack will have a 5 byte length. The frame
|
||||
* type will be an ack. The frame pending bit will be set based on the
|
||||
* RAIL_IEEE802154_SetFramePending() function. The sequence number will be set to
|
||||
|
@ -72,11 +75,10 @@
|
|||
* @enum RAIL_IEEE802154_AddressLength_t
|
||||
* @brief Different lengths that an 802.15.4 address can have
|
||||
*/
|
||||
typedef enum RAIL_IEEE802154_AddressLength
|
||||
{
|
||||
RAIL_ENUM(RAIL_IEEE802154_AddressLength_t) {
|
||||
RAIL_IEEE802154_ShortAddress = 2, /**< 2 byte short address. */
|
||||
RAIL_IEEE802154_LongAddress = 3, /**< 8 byte extended address. */
|
||||
} RAIL_IEEE802154_AddressLength_t;
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct RAIL_IEEE802154_Address_t
|
||||
|
@ -84,30 +86,51 @@ typedef enum RAIL_IEEE802154_AddressLength
|
|||
* This structure is only used for a received address, which needs to be parsed
|
||||
* to discover the type.
|
||||
*/
|
||||
typedef struct RAIL_IEEE802154_Address
|
||||
{
|
||||
typedef struct RAIL_IEEE802154_Address{
|
||||
/** Convenient storage for different address types */
|
||||
union {
|
||||
uint16_t shortAddress; /**< Present for 2 byte addresses. */
|
||||
uint8_t longAddress[8]; /**< Present for 8 byte addresses. */
|
||||
};
|
||||
/**
|
||||
* Enum of the received address length
|
||||
*/
|
||||
RAIL_IEEE802154_AddressLength_t length;
|
||||
union
|
||||
{
|
||||
uint16_t shortAddress; /**< Present for 2 byte addresses. */
|
||||
uint8_t longAddress[8]; /**< Present for 8 byte addresses. */
|
||||
};
|
||||
} RAIL_IEEE802154_Address_t;
|
||||
|
||||
/** The maximum number of allowed addresses of each type. */
|
||||
#define RAIL_IEEE802154_MAX_ADDRESSES 3
|
||||
|
||||
/**
|
||||
* @struct RAIL_IEEE802154_AddrConfig_t
|
||||
* @brief Configuration structure for IEEE 802.15.4 Address Filtering. The
|
||||
* broadcast addresses are handled separately, and do not need to be specified
|
||||
* here. Any address which is NULL will be ignored.
|
||||
* here. Any address to be ignored should be set with all bits high.
|
||||
*
|
||||
* This structure allows configuration of dual-PAN functionality, by specifying
|
||||
* multiple PAN IDs and short addresses. A packet will be received if it
|
||||
* matches either PAN ID and the long address. The short addresses are specific
|
||||
* to a given PAN, so the first short address goes with the first PAN ID, and
|
||||
* not with the second PAN ID. The broadcast PAN ID and address will work with
|
||||
* any address or PAN ID, respectively.
|
||||
*/
|
||||
typedef struct RAIL_IEEE802154_AddrConfig
|
||||
{
|
||||
uint16_t panId; /**< PAN ID for destination filtering. */
|
||||
uint16_t shortAddr; /**< Network address for destination filtering. */
|
||||
uint8_t *longAddr; /**< 64 bit address for destination filtering. In OTA byte order.*/
|
||||
typedef struct RAIL_IEEE802154_AddrConfig{
|
||||
/**
|
||||
* PAN IDs for destination filtering. Both must be specified.
|
||||
* To disable a PAN ID, set it to the broadcast value, 0xFFFF.
|
||||
*/
|
||||
uint16_t panId[RAIL_IEEE802154_MAX_ADDRESSES];
|
||||
/**
|
||||
* Short network addresses for destination filtering. Both must be specified.
|
||||
* To disable a short address, set it to the broadcast value, 0xFFFF.
|
||||
*/
|
||||
uint16_t shortAddr[RAIL_IEEE802154_MAX_ADDRESSES];
|
||||
/**
|
||||
* 64 bit address for destination filtering. Both must be specified.
|
||||
* This field is parsed in over-the-air (OTA) byte order. To disable a long
|
||||
* address, set it to the reserved value of 0x00 00 00 00 00 00 00 00.
|
||||
*/
|
||||
uint8_t longAddr[RAIL_IEEE802154_MAX_ADDRESSES][8];
|
||||
} RAIL_IEEE802154_AddrConfig_t;
|
||||
|
||||
/**
|
||||
|
@ -115,6 +138,28 @@ typedef struct RAIL_IEEE802154_AddrConfig
|
|||
* @brief Configuration structure for IEEE 802.15.4 in RAIL
|
||||
*/
|
||||
typedef struct RAIL_IEEE802154_Config {
|
||||
/**
|
||||
* Configure the RAIL Address Filter to allow the given destination
|
||||
* addresses. If addresses is NULL, defer destination address configuration.
|
||||
* If a member of addresses is NULL, defer configuration of just that member.
|
||||
* This can be overridden via RAIL_IEEE802154_SetAddresses(), or the
|
||||
* individual members can be changed via RAIL_IEEE802154_SetPanId(),
|
||||
* RAIL_IEEE802154_SetShortAddress(), and RAIL_IEEE802154_SetLongAddress().
|
||||
*/
|
||||
const RAIL_IEEE802154_AddrConfig_t *addresses;
|
||||
/**
|
||||
* Defines the acking configuration for the IEEE 802.15.4 implementation
|
||||
*/
|
||||
RAIL_AutoAckConfig_t ackConfig;
|
||||
/**
|
||||
* Defines state timings for the IEEE 802.15.4 implementation
|
||||
*/
|
||||
RAIL_StateTiming_t timings;
|
||||
/**
|
||||
* Set which 802.15.4 frame types will be received, of Beacon, Data, Ack, and
|
||||
* Command. This setting can be overridden via RAIL_IEEE802154_AcceptFrames().
|
||||
*/
|
||||
uint8_t framesMask;
|
||||
/**
|
||||
* Enable promiscuous mode during configuration. This can be overridden via
|
||||
* RAIL_IEEE802154_SetPromiscuousMode() afterwards.
|
||||
|
@ -125,48 +170,14 @@ typedef struct RAIL_IEEE802154_Config {
|
|||
* be overridden via RAIL_IEEE802154_SetPanCoordinator() afterwards.
|
||||
*/
|
||||
bool isPanCoordinator;
|
||||
/**
|
||||
* Set which 802.15.4 frame types will be received, of Beacon, Data, Ack, and
|
||||
* Command. This setting can be overridden via RAIL_IEEE802154_AcceptFrames().
|
||||
*/
|
||||
uint8_t framesMask;
|
||||
/**
|
||||
* Defines the default radio state after a transmit operation (transmit
|
||||
* packet, wait for ack) or a receive operation (receive packet, transmit
|
||||
* ack) finishes.
|
||||
*/
|
||||
RAIL_RadioState_t defaultState;
|
||||
/**
|
||||
* Define the idleToRx and idleToTx time
|
||||
* This defines the time it takes for the radio to go into RX or TX from an
|
||||
* idle radio state
|
||||
*/
|
||||
uint16_t idleTime;
|
||||
/**
|
||||
* Define the turnaround time after receiving a packet and transmitting an
|
||||
* ack and vice versa
|
||||
*/
|
||||
uint16_t turnaroundTime;
|
||||
/**
|
||||
* Define the ack timeout time in microseconds
|
||||
*/
|
||||
uint16_t ackTimeout;
|
||||
/**
|
||||
* Configure the RAIL Address Filter to allow the given destination
|
||||
* addresses. If addresses is NULL, defer destination address configuration.
|
||||
* If a member of addresses is NULL, defer configuration of just that member.
|
||||
* This can be overridden via RAIL_IEEE802154_SetAddresses(), or the
|
||||
* individual members can be changed via RAIL_IEEE802154_SetPanId(),
|
||||
* RAIL_IEEE802154_SetShortAddress(), and RAIL_IEEE802154_SetLongAddress().
|
||||
*/
|
||||
RAIL_IEEE802154_AddrConfig_t *addresses;
|
||||
} RAIL_IEEE802154_Config_t;
|
||||
|
||||
/**
|
||||
* Initialize RAIL for IEEE802.15.4 features
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] config IEEE802154 configuration struct
|
||||
* @return \ref RAIL_STATUS_NO_ERROR if successfully configured.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* This function calls the following RAIL functions to configure the radio for
|
||||
* IEEE802.15.4 features.
|
||||
|
@ -177,128 +188,153 @@ typedef struct RAIL_IEEE802154_Config {
|
|||
* - Configures RAIL Address Filter for 802.15.4 address filtering
|
||||
*
|
||||
* It calls the following functions:
|
||||
* - RAIL_AutoAckConfig()
|
||||
* - RAIL_ConfigAutoAck()
|
||||
* - RAIL_SetRxTransitions()
|
||||
* - RAIL_SetTxTransitions()
|
||||
* - RAIL_SetStateTiming()
|
||||
* - RAIL_AddressFilterConfig()
|
||||
* - RAIL_AddressFilterEnable()
|
||||
* - RAIL_ConfigAddressFilter()
|
||||
* - RAIL_EnableAddressFilter()
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_Init(RAIL_IEEE802154_Config_t *config);
|
||||
RAIL_Status_t RAIL_IEEE802154_Init(RAIL_Handle_t railHandle,
|
||||
const RAIL_IEEE802154_Config_t *config);
|
||||
|
||||
/**
|
||||
* Configures the radio for 2.4GHz 802.15.4 operation
|
||||
*
|
||||
* @return \ref RAIL_STATUS_NO_ERROR if successfully configured.
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* This initializes the radio for 2.4GHz operation. It takes the place of
|
||||
* calling \ref RAIL_RadioConfig and \ref RAIL_ChannelConfig. After this call,
|
||||
* calling \ref RAIL_ConfigRadio and \ref RAIL_ConfigChannels. After this call,
|
||||
* channels 11-26 will be available, giving the frequencies of those channels
|
||||
* on channel page 0, as defined by IEEE 802.15.4-2011 section 8.1.2.2.
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_2p4GHzRadioConfig(void);
|
||||
RAIL_Status_t RAIL_IEEE802154_Config2p4GHzRadio(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* De-initializes IEEE802.15.4 hardware acceleration
|
||||
*
|
||||
* @return 0 if IEEE802.15.4 hardware acceleration is successfully
|
||||
* deinitialized. Error code on failure
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* Disables and resets all IEE802.15.4 hardware acceleration features. This
|
||||
* function should only be called when the radio is IDLE. This calls the
|
||||
* following:
|
||||
* - RAIL_AutoAckDisable(), which resets the state transitions to IDLE
|
||||
* - RAIL_SetStateTiming(), to reset all timings to 100 us
|
||||
* - RAIL_AddressFilterDisable()
|
||||
* - RAIL_AddressFilterReset()
|
||||
* - RAIL_EnableAddressFilter(false)
|
||||
* - RAIL_ResetAddressFilter()
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_Deinit(void);
|
||||
RAIL_Status_t RAIL_IEEE802154_Deinit(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Return whether IEEE802.15.4 hardware accelertion is currently enabled.
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @return True if IEEE802.15.4 hardware acceleration was enabled to start with
|
||||
* and false otherwise
|
||||
*/
|
||||
bool RAIL_IEEE802154_IsEnabled(void);
|
||||
bool RAIL_IEEE802154_IsEnabled(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* Configure the RAIL Address Filter for 802.15.4 filtering
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] addresses The address information that should be used
|
||||
* @return True if addresses were successfully set, false otherwise
|
||||
* @return Status code indicating success of the function call. If this returns
|
||||
* an error, then the 802.15.4 address filter is in an undefined state.
|
||||
*
|
||||
* Set up the 802.15.4 address filter to accept messages to the given
|
||||
* addresses. This will return true if at least one address was successfully
|
||||
* stored to be used.
|
||||
* addresses. This will return false if any of the addresses failed to be set.
|
||||
* If NULL is passed in for addresses, then all addresses will be set to their
|
||||
* reset value.
|
||||
*/
|
||||
bool RAIL_IEEE802154_SetAddresses(RAIL_IEEE802154_AddrConfig_t *addresses);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetAddresses(RAIL_Handle_t railHandle,
|
||||
const RAIL_IEEE802154_AddrConfig_t *addresses);
|
||||
|
||||
/**
|
||||
* Set a PAN ID for 802.15.4 address filtering
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] panId The 16-bit PAN ID information.
|
||||
* This will be matched against the destination PAN ID of incoming messages.
|
||||
* The PAN ID is sent little endian over the air meaning panId[7:0] is first in
|
||||
* the payload followed by panId[15:8].
|
||||
* @return True if the PAN ID was successfully set, false otherwise
|
||||
* @param[in] index Which PAN ID to set. Must be below
|
||||
* RAIL_IEEE802154_MAX_ADDRESSES.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* Set up the 802.15.4 address filter to accept messages to the given PAN ID.
|
||||
*/
|
||||
bool RAIL_IEEE802154_SetPanId(uint16_t panId);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetPanId(RAIL_Handle_t railHandle,
|
||||
uint16_t panId,
|
||||
uint8_t index);
|
||||
|
||||
/**
|
||||
* Set a short address for 802.15.4 address filtering
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] shortAddr 16 bit short address value. This will be matched against the
|
||||
* destination short address of incoming messages. The short address is sent
|
||||
* little endian over the air meaning shortAddr[7:0] is first in the payload
|
||||
* followed by shortAddr[15:8].
|
||||
* @return True if the short address was successfully set, false otherwise
|
||||
* @param[in] index Which short address to set. Must be below
|
||||
* RAIL_IEEE802154_MAX_ADDRESSES.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* Set up the 802.15.4 address filter to accept messages to the given short
|
||||
* address.
|
||||
*/
|
||||
bool RAIL_IEEE802154_SetShortAddress(uint16_t shortAddr);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetShortAddress(RAIL_Handle_t railHandle,
|
||||
uint16_t shortAddr,
|
||||
uint8_t index);
|
||||
|
||||
/**
|
||||
* Set a long address for 802.15.4 address filtering
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] longAddr Pointer to a 8 byte array containing the long address
|
||||
* information. The long address must be in over the air byte order. This will
|
||||
* be matched against the destination long address of incoming messages.
|
||||
* @return True if the long address was successfully set, false otherwise
|
||||
* @param[in] index Which long address to set. Must be below
|
||||
* RAIL_IEEE802154_MAX_ADDRESSES.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* Set up the 802.15.4 address filter to accept messages to the given long
|
||||
* address.
|
||||
*/
|
||||
bool RAIL_IEEE802154_SetLongAddress(uint8_t *longAddr);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetLongAddress(RAIL_Handle_t railHandle,
|
||||
const uint8_t *longAddr,
|
||||
uint8_t index);
|
||||
|
||||
/**
|
||||
* Set whether the current node is a PAN coordinator
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] isPanCoordinator True if this device is a PAN coordinator
|
||||
* @return Returns zero on success and an error code on error
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* If the device is a PAN Coordinator, then it will accept data and command
|
||||
* frames with no destination address. This function will fail if 802.15.4
|
||||
* hardware acceleration is not currently enabled. This setting may be changed
|
||||
* at any time when 802.15.4 hardwarea acceleration is enabled.
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_SetPanCoordinator(bool isPanCoordinator);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetPanCoordinator(RAIL_Handle_t railHandle,
|
||||
bool isPanCoordinator);
|
||||
|
||||
/**
|
||||
* Set whether to enable 802.15.4 promiscuous mode
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] enable True if all frames and addresses should be accepted
|
||||
* @return Returns zero on success and an error code on error
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* If promiscuous mode is enabled, then no frame or address filtering steps
|
||||
* will be performed, other than checking the CRC. This function will fail if
|
||||
* 802.15.4 hardware acceleration is not currently enabled. This setting may be
|
||||
* changed at any time when 802.15.4 hardware acceleration is enabled.
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_SetPromiscuousMode(bool enable);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetPromiscuousMode(RAIL_Handle_t railHandle,
|
||||
bool enable);
|
||||
|
||||
/// When receiving packets, accept 802.15.4 BEACON frame types
|
||||
#define RAIL_IEEE802154_ACCEPT_BEACON_FRAMES (0x01)
|
||||
|
@ -313,15 +349,16 @@ RAIL_Status_t RAIL_IEEE802154_SetPromiscuousMode(bool enable);
|
|||
|
||||
/// In standard operation, accept BEACON, DATA and COMMAND frames.
|
||||
/// Only receive ACK frames while waiting for ack
|
||||
#define RAIL_IEEE802154_ACCEPT_STANDARD_FRAMES (RAIL_IEEE802154_ACCEPT_BEACON_FRAMES | \
|
||||
RAIL_IEEE802154_ACCEPT_DATA_FRAMES | \
|
||||
RAIL_IEEE802154_ACCEPT_COMMAND_FRAMES)
|
||||
#define RAIL_IEEE802154_ACCEPT_STANDARD_FRAMES (RAIL_IEEE802154_ACCEPT_BEACON_FRAMES \
|
||||
| RAIL_IEEE802154_ACCEPT_DATA_FRAMES \
|
||||
| RAIL_IEEE802154_ACCEPT_COMMAND_FRAMES)
|
||||
|
||||
/**
|
||||
* Set which 802.15.4 frame types to accept
|
||||
*
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @param[in] framesMask Mask containing which 802.15.4 frame types to receive
|
||||
* @return Returns zero on success and an error code on error
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* This function will fail if 802.15.4 hardware acceleration is not currently
|
||||
* enabled. This setting may be changed at any time when 802.15.4 hardware
|
||||
|
@ -335,40 +372,36 @@ RAIL_Status_t RAIL_IEEE802154_SetPromiscuousMode(bool enable);
|
|||
* RAIL_IEEE802154_ACCEPT_ACK_FRAMES is not set, ACK frames will be filtered
|
||||
* unless the radio is waiting for an ACK.
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_AcceptFrames(uint8_t framesMask);
|
||||
|
||||
/**
|
||||
* Callback for when a Data Request is being received
|
||||
*
|
||||
* @param address The source address of the data request command
|
||||
*
|
||||
* This function is called when the command byte of an incoming frame is for a
|
||||
* data request, which requests an ACK. This callback will be called before the
|
||||
* packet is fully received, to allow the node to have more time to decide
|
||||
* whether to set frame pending in the outgoing ACK.
|
||||
*/
|
||||
void RAILCb_IEEE802154_DataRequestCommand(RAIL_IEEE802154_Address_t *address);
|
||||
RAIL_Status_t RAIL_IEEE802154_AcceptFrames(RAIL_Handle_t railHandle,
|
||||
uint8_t framesMask);
|
||||
|
||||
/**
|
||||
* Set the frame pending bit on the outgoing ACK
|
||||
*
|
||||
* @return Returns zero on success and an error code on error
|
||||
* @param[in] railHandle Handle of RAIL instance
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* This function should be called after receiving
|
||||
* RAILCb_IEEE802154_DataRequestCommand(), if the given source address has a
|
||||
* pending frame. This will return \ref RAIL_STATUS_INVALID_STATE if it is too
|
||||
* late to modify the ACK.
|
||||
* This function should be called after receiving \ref
|
||||
* RAIL_EVENT_IEEE802154_DATA_REQUEST_COMMAND, if the given source address has
|
||||
* a pending frame. This will return \ref RAIL_STATUS_INVALID_STATE if it is
|
||||
* too late to modify the ACK.
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_SetFramePending(void);
|
||||
RAIL_Status_t RAIL_IEEE802154_SetFramePending(RAIL_Handle_t railHandle);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* end of IEEE802.15.4
|
||||
* Get the source address of the incoming data request.
|
||||
*
|
||||
* @param[in] railHandle A RAIL instance handle.
|
||||
* @param[out] pAddress Pointer to \ref RAIL_IEEE802154_Address_t structure
|
||||
* to populate with address information.
|
||||
* @return Status code indicating success of the function call.
|
||||
*
|
||||
* This function should only be called when handling the \ref
|
||||
* RAIL_EVENT_IEEE802154_DATA_REQUEST_COMMAND event.
|
||||
*/
|
||||
RAIL_Status_t RAIL_IEEE802154_GetAddress(RAIL_Handle_t railHandle,
|
||||
RAIL_IEEE802154_Address_t *pAddress);
|
||||
|
||||
/**
|
||||
* @}
|
||||
* end of Protocol_Specific
|
||||
*/
|
||||
/** @} */ // end of IEEE802.15.4
|
||||
|
||||
#endif // __RAIL_IEEE802154_H__
|
||||
|
|
|
@ -34,6 +34,27 @@
|
|||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "timing_state.h"
|
||||
#include "rail_chip_specific.h"
|
||||
|
||||
// Once this is a RAIL API this code can be removed as rail-types.h does this
|
||||
#ifndef RAIL_ENUM
|
||||
#ifdef DOXYGEN_SHOULD_SKIP_THIS
|
||||
/// The RAIL library does not use actual enums because the ARM EABI leaves their
|
||||
/// size ambiguous. This ambiguity causes problems if the application is built
|
||||
/// with different flags than the library. To work around this we use uint8_t
|
||||
/// typedefs in compiled code for all enums. For documentation purposes this is
|
||||
/// converted to an actual enum since it's much easier to read in Doxygen.
|
||||
#define RAIL_ENUM(name) enum name
|
||||
#else
|
||||
/// Define used for the actual RAIL library which sets each enum to a uint8_t
|
||||
/// typedef and creates a named enum structure for the enumeration values.
|
||||
#define RAIL_ENUM(name) typedef uint8_t name; enum name##_enum
|
||||
// For debugging use the following define to turn this back into a proper enum
|
||||
// #define RAIL_ENUM(name) typedef enum name##_enum name; enum name##_enum
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -48,55 +69,6 @@ extern "C" {
|
|||
* @{
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
**************************** CONFIGURATION ********************************
|
||||
******************************************************************************/
|
||||
/** Scaling factor applied to all dBm power level inputs and outputs * */
|
||||
#define PA_SCALING_FACTOR 10
|
||||
|
||||
/**
|
||||
* @brief Selection of the rf power amplifier (PA) to use
|
||||
*/
|
||||
typedef enum RADIO_PASel
|
||||
{
|
||||
/** High power PA */
|
||||
PA_SEL_2P4_HP,
|
||||
/** Low power PA */
|
||||
PA_SEL_2P4_LP,
|
||||
/** SubGig PA*/
|
||||
PA_SEL_SUBGIG,
|
||||
/** Invalid PA Selection */
|
||||
PA_SEL_INVALID
|
||||
} RADIO_PASel_t;
|
||||
|
||||
/**
|
||||
* @brief Selection should match the configuration of the voltage on the vPa pin
|
||||
* of the chip.
|
||||
*/
|
||||
typedef enum RADIO_PAVoltMode
|
||||
{
|
||||
/** Vpa = Vbat = 3.3V */
|
||||
PA_VOLTMODE_VBAT,
|
||||
/** Vpa = DCDC Vout = 1.8V */
|
||||
PA_VOLTMODE_DCDC
|
||||
} RADIO_PAVoltMode_t;
|
||||
|
||||
/**
|
||||
* @brief Configuration structure for the rf power amplifier (PA)
|
||||
*/
|
||||
typedef struct RADIO_PAInit {
|
||||
/** Power Amplifier mode */
|
||||
RADIO_PASel_t paSel;
|
||||
/** Power Amplifier vPA Voltage mode */
|
||||
RADIO_PAVoltMode_t voltMode;
|
||||
/** Desired output power in dBm * \ref PA_SCALING_FACTOR */
|
||||
int16_t power;
|
||||
/** Output power offset in dBm * \ref PA_SCALING_FACTOR */
|
||||
int16_t offset;
|
||||
/** Desired ramp time in us */
|
||||
uint16_t rampTime;
|
||||
} RADIO_PAInit_t;
|
||||
|
||||
/*******************************************************************************
|
||||
****************************** PROTOTYPES *********************************
|
||||
******************************************************************************/
|
||||
|
@ -106,65 +78,38 @@ typedef struct RADIO_PAInit {
|
|||
* Initilize the PA settings based on the settings provided in the paInit
|
||||
* structure.
|
||||
*
|
||||
* @param[in] paInit
|
||||
* @param[in] paConfig
|
||||
* Pointer to a structure containing the desired PA configuration settings.
|
||||
*
|
||||
* @return
|
||||
* True if the settings were accepted.
|
||||
* False if settings were invalid.
|
||||
* RAIL_Status_t indicating success
|
||||
*
|
||||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
bool RADIO_PA_Init(RADIO_PAInit_t * paInit);
|
||||
*/
|
||||
RAIL_Status_t PA_Config(const RAIL_TxPowerConfig_t *paConfig);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Get the current PA settings in use
|
||||
*
|
||||
* @param[out] config
|
||||
* Pointer to memory location into which the configuration will be
|
||||
* copied
|
||||
*
|
||||
* @return
|
||||
* RAIL_Status_t indicating success
|
||||
*/
|
||||
RAIL_Status_t PA_GetTxPowerConfig(RAIL_TxPowerConfig_t *config);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Returns the current power level of transmit power
|
||||
*
|
||||
* @return
|
||||
* Current power level in dBm * \ref PA_SCALING_FACTOR
|
||||
* Current power level in deci-dBm
|
||||
*/
|
||||
int32_t PA_OutputPowerGet(void);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Sets the output power of the PA.
|
||||
*
|
||||
* Each PA has distinct maximum power, minimum power, and power step sizes.
|
||||
* This API will calculate the best pa output power level setting to acheieve
|
||||
* the desired output power.
|
||||
*
|
||||
* @note
|
||||
* Board and chip variations will affect the accuracy of this API. Use
|
||||
* of the RADIO_PAInit_t.offset paramter can help account for this variation.
|
||||
*
|
||||
* @param[in] power
|
||||
* Power value in dBm * \ref PA_SCALING_FACTOR
|
||||
*
|
||||
* Examples with \ref PA_SCALING_FACTOR of 10:
|
||||
* - 10 dBm --> 100
|
||||
* - 5.5 dBm --> 55
|
||||
*
|
||||
* @return
|
||||
* Returns the actual power that was set in dBm * \ref PA_SCALING_FACTOR
|
||||
*
|
||||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
int32_t PA_OutputPowerSet(int32_t power);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Set the maximum possible output power for the selected PA.
|
||||
*
|
||||
* @return
|
||||
* Returns the actual power that was set in dBm * \ref PA_SCALING_FACTOR
|
||||
*
|
||||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
int32_t PA_MaxOutputPowerSet(void);
|
||||
RAIL_TxPowerLevel_t PA_GetPowerLevel(void);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -173,7 +118,7 @@ int32_t PA_MaxOutputPowerSet(void);
|
|||
* @return
|
||||
* Current ramp time in microseconds
|
||||
*/
|
||||
uint32_t PA_RampTimeGet(void);
|
||||
uint32_t PA_GetRampTime(void);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -193,7 +138,18 @@ uint32_t PA_RampTimeGet(void);
|
|||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
uint32_t PA_RampTimeSet(uint32_t ramptime);
|
||||
uint32_t PA_SetRampTime(uint32_t ramptime, StateTimings_t *timings);
|
||||
|
||||
/**
|
||||
* Enable/Disable PA calibration
|
||||
*
|
||||
* @param[in] enable Enables/Disables PA calibration
|
||||
* @return void
|
||||
*
|
||||
* Enabling this will ensure that the PA power remains constant chip to chip.
|
||||
* By default this feature is disabled after reset.
|
||||
*/
|
||||
void PA_EnableCal(bool enable);
|
||||
|
||||
/***************************************************************************//**
|
||||
* @addtogroup EFR32xG1x_PA_Advanced
|
||||
|
@ -211,13 +167,13 @@ uint32_t PA_RampTimeSet(uint32_t ramptime);
|
|||
* @param[in] rxPaCtuneValue
|
||||
* Receive value for pa ctune
|
||||
*
|
||||
* @note PACTUNE will reset to default values when RADIO_PA_Init() or
|
||||
* RAIL_RadioConfig() are called.
|
||||
* @note PACTUNE will reset to default values when PA_Config() or
|
||||
* RAIL_ConfigRadio() are called.
|
||||
*
|
||||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
void PA_CTuneSet(uint8_t txPaCtuneValue, uint8_t rxPaCtuneValue);
|
||||
void PA_SetCTune(uint8_t txPaCtuneValue, uint8_t rxPaCtuneValue);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
|
@ -231,43 +187,50 @@ void PA_CTuneSet(uint8_t txPaCtuneValue, uint8_t rxPaCtuneValue);
|
|||
* @param[in] pwrLevel
|
||||
* Output power level. Note that the maximum power level will change
|
||||
* depending on PA selection.
|
||||
* @param[in] boostMode
|
||||
* Output boost mode. Some PA selections have a mode that will increase the
|
||||
* output power for each step if this is enabled.
|
||||
*
|
||||
* @return
|
||||
* MSB Configured boost mode. \n
|
||||
* LSB Configured power level
|
||||
* Power level set in the current PA.
|
||||
*
|
||||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
uint16_t PA_PowerLevelSet(uint8_t pwrLevel, uint8_t boostMode);
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Optimize the PA settings based on expected output power level.
|
||||
*
|
||||
* @details
|
||||
* This API optimizes the current consumption of the radio based on the
|
||||
* provided output power. This is only necessary when output power is
|
||||
* controlled by PA_PowerLevelSet().
|
||||
*
|
||||
* @param[in] power
|
||||
* Power value in dBm * \ref PA_SCALING_FACTOR
|
||||
*
|
||||
* @warning
|
||||
* The radio should not be transmitting when this function is called!
|
||||
*/
|
||||
void PA_PowerLevelOptimize(int32_t power);
|
||||
RAIL_TxPowerLevel_t PA_SetPowerLevel(RAIL_TxPowerLevel_t pwrLevel);
|
||||
|
||||
/** @} (end addtogroup EFR32xG1x_PA_Advanced) */
|
||||
/** @} (end addtogroup EFR32xG1x_PA) */
|
||||
/** @} (end addtogroup Chip_Specific) */
|
||||
|
||||
/**
|
||||
* Non RAIL functions.
|
||||
*
|
||||
* The following functions can only be safely used by customers not yet on the
|
||||
* RAIL platform yet. For those on RAIL, please see RAIL_ConvertDbmToRaw and
|
||||
* RAIL_ConvertRawToDbm.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Function used to convert deci-dBm values to raw values that can be used in
|
||||
* SetTxPower.
|
||||
*
|
||||
* @param[in] power deci-dBm value that should be converted to the appropriate
|
||||
* raw power for the current PA
|
||||
* @return equivalent raw power for the deci-dBm value supplied, for the active
|
||||
* PA.
|
||||
*/
|
||||
RAIL_TxPowerLevel_t PA_ConvertDbmToRaw(RAIL_TxPower_t power);
|
||||
|
||||
/**
|
||||
* Function to convert the raw power levels returned from GetTxPower to
|
||||
* the equivalent deci-dBm value for the current PA.
|
||||
*
|
||||
* @param[in] powerLevel Raw PA power level that should be converted into
|
||||
* the equivalent deci-dBm value for the active PA
|
||||
* @return equivalent deci-dBm value for the raw power level passed in.
|
||||
*/
|
||||
RAIL_TxPower_t PA_ConvertRawToDbm(RAIL_TxPowerLevel_t powerLevel);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __RADIO_PA_H */
|
||||
|
|
|
@ -13,60 +13,76 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "em_gpio.h"
|
||||
|
||||
/******************************** TYPEDEFS *********************************/
|
||||
#include "rail_chip_specific.h"
|
||||
|
||||
/** Channel type enumeration. */
|
||||
typedef enum RADIO_PTIMode
|
||||
{
|
||||
/** SPI mode. */
|
||||
RADIO_PTI_MODE_SPI = 0U,
|
||||
/** UART mode. */
|
||||
RADIO_PTI_MODE_UART = 1U,
|
||||
/** 9bit UART mode. */
|
||||
RADIO_PTI_MODE_UART_ONEWIRE = 2U,
|
||||
/** Turn PTI off entirely */
|
||||
RADIO_PTI_MODE_DISABLED = 3U,
|
||||
} RADIO_PTIMode_t;
|
||||
// Once this is a RAIL API this code can be removed as rail-types.h does this
|
||||
#ifndef RAIL_ENUM
|
||||
#ifdef DOXYGEN_SHOULD_SKIP_THIS
|
||||
/// The RAIL library does not use actual enums because the ARM EABI leaves their
|
||||
/// size ambiguous. This ambiguity causes problems if the application is built
|
||||
/// with different flags than the library. To work around this we use uint8_t
|
||||
/// typedefs in compiled code for all enums. For documentation purposes this is
|
||||
/// converted to an actual enum since it's much easier to read in Doxygen.
|
||||
#define RAIL_ENUM(name) enum name
|
||||
#else
|
||||
/// Define used for the actual RAIL library which sets each enum to a uint8_t
|
||||
/// typedef and creates a named enum structure for the enumeration values.
|
||||
#define RAIL_ENUM(name) typedef uint8_t name; enum name##_enum
|
||||
// For debugging use the following define to turn this back into a proper enum
|
||||
// #define RAIL_ENUM(name) typedef enum name##_enum name; enum name##_enum
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @struct RADIO_PTIInit_t
|
||||
* @brief Configuration structure for the packet trace interface (PTI)
|
||||
*/
|
||||
typedef struct RADIO_PTIInit {
|
||||
/** Packet Trace mode (UART or SPI) */
|
||||
RADIO_PTIMode_t mode;
|
||||
/***************************************************************************//**
|
||||
* @addtogroup Chip_Specific
|
||||
* @{
|
||||
******************************************************************************/
|
||||
|
||||
/** Output baudrate for PTI in Hz */
|
||||
uint32_t baud;
|
||||
|
||||
/** Data output (DOUT) location for pin/port */
|
||||
uint8_t doutLoc;
|
||||
/** Data output (DOUT) GPIO port */
|
||||
GPIO_Port_TypeDef doutPort;
|
||||
/** Data output (DOUT) GPIO pin */
|
||||
uint8_t doutPin;
|
||||
|
||||
/** Data clock (DCLK) location for pin/port. Only used in SPI mode */
|
||||
uint8_t dclkLoc;
|
||||
/** Data clock (DCLK) GPIO port. Only used in SPI mode */
|
||||
GPIO_Port_TypeDef dclkPort;
|
||||
/** Data clock (DCLK) GPIO pin. Only used in SPI mode */
|
||||
uint8_t dclkPin;
|
||||
|
||||
/** Data frame (DFRAME) location for pin/port. Only used for */
|
||||
uint8_t dframeLoc;
|
||||
/** Data frame (DFRAME) GPIO port */
|
||||
GPIO_Port_TypeDef dframePort;
|
||||
/** Data frame (DFRAME) GPIO pin */
|
||||
uint8_t dframePin;
|
||||
} RADIO_PTIInit_t;
|
||||
/***************************************************************************//**
|
||||
* @addtogroup EFR32xG1x_PTI
|
||||
* @{
|
||||
* @brief EFR32 Packet Trace Interface (PTI) setup and configuration
|
||||
******************************************************************************/
|
||||
|
||||
/************************* FUNCTION PROTOTYPES *****************************/
|
||||
void RADIO_PTI_Init(RADIO_PTIInit_t *pitInit);
|
||||
void RADIO_PTI_Enable(void);
|
||||
void RADIO_PTI_Disable(void);
|
||||
|
||||
/**
|
||||
* Initialize the PTI interface
|
||||
*
|
||||
* @param ptiInit The structure that defines what pins and modes to use for
|
||||
* packet trace.
|
||||
*
|
||||
* This API will initialize the packet trace interface. It allows you to
|
||||
* configure what mode and pins to use for packet trace output. You must call
|
||||
* this API either before RAIL initialization or before an explicit call to
|
||||
* \ref PTI_Enable() to properly initialize PTI.
|
||||
*/
|
||||
RAIL_Status_t PTI_Config(const RAIL_PtiConfig_t *config);
|
||||
|
||||
/**
|
||||
* Enable or disable the PTI interface
|
||||
*
|
||||
* This API will turn on or off the packet trace interface (PTI). By default
|
||||
* this is turned on already during init time. Note that you must call \ref
|
||||
* RADIO_PTI_Init() with a valid initialization structure before calling this
|
||||
* API or PTI will not actually turn on.
|
||||
*/
|
||||
RAIL_Status_t PTI_Enable(bool enable);
|
||||
|
||||
/**
|
||||
* Get the current state of the PTI
|
||||
*
|
||||
* This function will return a pointer to a copy of the PTI state. If you
|
||||
* actually want to change the settings, the referenced structure must be
|
||||
* updated and then passed back to \ref RADIO_PTI_Config
|
||||
*/
|
||||
RAIL_Status_t PTI_GetConfig(RAIL_PtiConfig_t *ptiConfig);
|
||||
|
||||
/** @} (end addtogroup EFR32xG1x_PTI) */
|
||||
/** @} (end addtogroup Chip_Specific) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,145 @@
|
|||
/***************************************************************************//**
|
||||
* @file rail_assert_error_codes.h
|
||||
* @brief Definition of error codes that occur in rail for use in
|
||||
RAILCb_AssertFailed. This file is purely informational and optional -
|
||||
it need not be included even if rail_assert libraries are included.
|
||||
|
||||
* @copyright Copyright 2017 Silicon Laboratories, Inc. http://www.silabs.com
|
||||
******************************************************************************/
|
||||
|
||||
#include "rail_types.h"
|
||||
|
||||
/**
|
||||
* @addtogroup Assertions
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef _RAIL_ASSERT_ERROR_CODES_
|
||||
|
||||
#define _RAIL_ASSERT_ERROR_CODES_
|
||||
|
||||
/**
|
||||
* Enumeration of all possible error codes from RAIL_ASSERT
|
||||
*/
|
||||
RAIL_ENUM(RAIL_AssertErrorCodes_t)
|
||||
{
|
||||
RAIL_ASSERT_FAILED_APPENDED_INFO_MISSING,
|
||||
RAIL_ASSERT_FAILED_RX_FIFO_BYTES,
|
||||
RAIL_ASSERT_FAILED_RX_FIFO_ZERO_BYTES_READ,
|
||||
RAIL_ASSERT_FAILED_ILLEGAL_RXLEN_ENTRY_STATUS,
|
||||
RAIL_ASSERT_FAILED_BAD_PACKET_LENGTH,
|
||||
RAIL_ASSERT_FAILED_SYNTH_DIVCTRL_ENUM_CONVERSION_ERROR, //5
|
||||
RAIL_ASSERT_FAILED_UNEXPECTED_STATE_RX_FIFO,
|
||||
RAIL_ASSERT_FAILED_UNEXPECTED_STATE_RXLEN_FIFO,
|
||||
RAIL_ASSERT_FAILED_UNEXPECTED_STATE_TX_FIFO,
|
||||
RAIL_ASSERT_FAILED_UNEXPECTED_STATE_TXACK_FIFO,
|
||||
RAIL_ASSERT_FAILED_PBUFFER_NOT_DEFINED, //10
|
||||
RAIL_ASSERT_FAILED_INSUFFICIENT_BYTES_IN_RX_PACKET,
|
||||
RAIL_ASSERT_FAILED_CLOCK_PRESCALER,
|
||||
RAIL_ASSERT_FAILED_RTCC_POST_WAKEUP,
|
||||
RAIL_ASSERT_FAILED_SYNTH_VCO_FREQUENCY,
|
||||
RAIL_ASSERT_FAILED_RAC_STATE, //15
|
||||
RAIL_ASSERT_FAILED_RETIME_LIMIT,
|
||||
RAIL_ASSERT_FAILED_NESTED_SEQUENCER_LOCK,
|
||||
RAIL_ASSERT_FAILED_RSSI_AVERAGE_DONE,
|
||||
RAIL_ASSERT_FAILED_DFL_BITS_SIZE,
|
||||
RAIL_ASSERT_FAILED_PROTIMER_RANDOM_SEED, //20
|
||||
RAIL_ASSERT_FAILED_EFR32XG1_REGISTER_SIZE,
|
||||
RAIL_ASSERT_FAILED_PROTIMER_CHANNEL,
|
||||
RAIL_ASSERT_FAILED_TIMER_REQUIRES_WRAP,
|
||||
RAIL_ASSERT_FAILED_BASECNTTOP,
|
||||
RAIL_ASSERT_FAILED_DEPRECATED_LBTRETRY, //25
|
||||
RAIL_ASSERT_FAILED_RTCC_SYNC_MISSED,
|
||||
RAIL_ASSERT_FAILED_CLOCK_SOURCE_NOT_READY,
|
||||
RAIL_ASSERT_FAILED_TIMINGS_INVALID,
|
||||
RAIL_ASSERT_NULL_HANDLE,
|
||||
RAIL_ASSERT_FAILED_TMRDRV_SCHED_TIMER_NOT_RUNNING, //30
|
||||
RAIL_ASSERT_FAILED_NO_ACTIVE_CONFIG,
|
||||
RAIL_ASSERT_FAILED_NO_ACTIVE_HANDLE_SWITCH,
|
||||
RAIL_ASSERT_FAILED_RFINIT,
|
||||
RAIL_ASSERT_FAILED_NO_ACTIVE_HANDLE_SCHEDRX,
|
||||
RAIL_ASSERT_FAILED_INVALID_HANDLE_SCHEDTX, //35
|
||||
RAIL_ASSERT_FAILED_INACTIVE_HANDLE_SCHEDTX,
|
||||
RAIL_ASSERT_FAILED_CONFIG_INDEX_INVALID,
|
||||
RAIL_ASSERT_FAILED_NO_ACTIVE_HANDLE_SINGLEPROTOCOL,
|
||||
RAIL_ASSERT_DEPRECATED_FUNCTION,
|
||||
RAIL_ASSERT_MULTIPROTOCOL_NO_EVENT, //40
|
||||
RAIL_ASSERT_FAILED_INVALID_INTERRUPT_ENABLED,
|
||||
RAIL_ASSERT_CONVERSION_CURVES_NOT_INITIALIZED,
|
||||
};
|
||||
|
||||
/**
|
||||
* Use this define to create an array of error messages that map to the codes
|
||||
* in \ref RAIL_AssertErrorCodes_t. You can use these to print slightly more
|
||||
* detailed error strings related to a particular assert error code if desired.
|
||||
* For example, you could implement your assert failed callback as follows to
|
||||
* make use of this.
|
||||
*
|
||||
* @code{.c}
|
||||
* void RAILCb_AssertFailed(RAIL_Handle_t railHandle, uint32_t errorCode)
|
||||
* {
|
||||
* static const char* railErrorMessages[] = RAIL_ASSERT_ERROR_MESSAGES;
|
||||
* const char *errorMessage = "Unknown";
|
||||
*
|
||||
* // If this error code is within the range of known error messages then use
|
||||
* // the appropriate error message.
|
||||
* if (errorCode < (sizeof(railErrorMessages) / sizeof(char*))) {
|
||||
* errorMessage = railErrorMessages[errorCode];
|
||||
* }
|
||||
* printf(errorMessage);
|
||||
*
|
||||
* // Reset the chip since an assert is a fatal error
|
||||
* NVIC_SystemReset();
|
||||
* }
|
||||
* @endcode
|
||||
*/
|
||||
#define RAIL_ASSERT_ERROR_MESSAGES { \
|
||||
"Appended info missing from Rx packet", \
|
||||
"Payload bytes missing from Rx packet", \
|
||||
"Error reading back packet payload", \
|
||||
"Receive fifo entry has invalid status", \
|
||||
"Receive fifo entry bad packet length", \
|
||||
"Unable to configure radio for IR calibration", \
|
||||
"Reached unexpected state while handling Rx fifo events", \
|
||||
"Reached unexpected state while handling RXLEN fifo events", \
|
||||
"Reached unexpected state while handling Tx fifo events", \
|
||||
"Reached unexpected state while handling Tx ACK fifo events", \
|
||||
"No memory to store receive packet", \
|
||||
"Packet length longer than the receive FIFO size", \
|
||||
"Invalid radio clock prescaler", \
|
||||
"Error synchronizing the RAIL timebase after sleep", \
|
||||
"VCO frequency outside supported range", \
|
||||
"Radio active while changing channels", \
|
||||
"Unable to configure DCDC retiming", \
|
||||
"Nested attempt to lock the sequencer", \
|
||||
"RSSI averaging enabled without a valid callback", \
|
||||
"Invalid dynamic frame length setting provided (dflBits)", \
|
||||
"Unable to seed radio pseudo random number generator", \
|
||||
"Timeout exceeds EFR32XG1 register size", \
|
||||
"Invalid timer channel specified", \
|
||||
"Timer value larger than RAIL timebase", \
|
||||
"LBT config exceeds EFR32XG1 register size", \
|
||||
"Deprecated CSMA/LBT retry callback unexpectedly called", \
|
||||
"Could not synchronize RAIL timebase with the RTC", \
|
||||
"Clock source not ready", \
|
||||
"Attempted to set RAIL timings to invalid value", \
|
||||
"NULL was supplied as a RAIL_Handle_t argument", \
|
||||
"Scheduled timer not running", \
|
||||
"No active config to switch from", \
|
||||
"No active handle after switch", \
|
||||
"RfInit failed to configure active state", \
|
||||
"No active handle for scheduled rx", \
|
||||
"Invalid handle for scheduled tx", \
|
||||
"Inactive handle for scheduled tx", \
|
||||
"Invalid config index to switch to", \
|
||||
"No active handle for single protocol", \
|
||||
"This function is deprecated and must not be called", \
|
||||
"Multiprotocol task started with no event to run", \
|
||||
"Invalid interrupt enabled", \
|
||||
"Power conversion functions called before curves were initialized", \
|
||||
}
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @}
|
||||
*/
|
|
@ -13,18 +13,36 @@
|
|||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "em_gpio.h"
|
||||
|
||||
#include "rail_types.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Multiprotocol
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* @addtogroup Multiprotocol_EFR32 EFR32
|
||||
* @{
|
||||
* @brief EFR32 Specific multiprotocol support defines
|
||||
* @ingroup Multiprotocol
|
||||
*/
|
||||
|
||||
/**
|
||||
* Placeholder for a chip specific RAIL handle. Using NULL as a RAIL handle is
|
||||
* frowned upon, so we use another value that can't be de-referenced.
|
||||
*/
|
||||
#define RAIL_EFR32_HANDLE ((RAIL_Handle_t)0xFFFFFFFFUL)
|
||||
|
||||
/** @} */ // end of group Multiprotocol_EFR32
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Calibration
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* @addtogroup Calibration
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup EFR32
|
||||
* @addtogroup Calibration_EFR32 EFR32
|
||||
* @{
|
||||
* @brief EFR32 Specific Calibrations
|
||||
* @ingroup Calibration
|
||||
*
|
||||
* The EFR32 has two supported calibrations. There is the Image Rejection (IR)
|
||||
* calibration and a temperature dependent calibration. The IR calibration is
|
||||
|
@ -38,11 +56,31 @@
|
|||
* calibration exceeds 70C while sitting in receive. RAIL will run VCO
|
||||
* calibration automatically upon entering receive state so the application can
|
||||
* omit this calibration if the stack will re-enter receive with enough
|
||||
* frequency to not hit this temperature delta. If the application does not
|
||||
* frequency to not hit this temperature delta. If the application does not
|
||||
* calibrate for temperature, it's possible to miss receive packets due to
|
||||
* drift in the carrier frequency.
|
||||
*/
|
||||
|
||||
/** EFR32 specific temperature calibration bit */
|
||||
#define RAIL_CAL_TEMP_VCO (0x00000001)
|
||||
/** EFR32 specific IR calibration bit */
|
||||
#define RAIL_CAL_ONETIME_IRCAL (0x00010000)
|
||||
|
||||
/** Mask to run temperature dependent calibrations */
|
||||
#define RAIL_CAL_TEMP (RAIL_CAL_TEMP_VCO)
|
||||
/** Mask to run one time calibrations */
|
||||
#define RAIL_CAL_ONETIME (RAIL_CAL_ONETIME_IRCAL)
|
||||
/** Mask to run optional performance calibrations */
|
||||
#define RAIL_CAL_PERF (0)
|
||||
/** Mask for calibrations that require the radio to be off */
|
||||
#define RAIL_CAL_OFFLINE (RAIL_CAL_ONETIME_IRCAL)
|
||||
/** Mask to run all possible calibrations for this chip */
|
||||
#define RAIL_CAL_ALL (RAIL_CAL_TEMP | RAIL_CAL_ONETIME)
|
||||
/** Mask to run all pending calibrations */
|
||||
#define RAIL_CAL_ALL_PENDING (0x00000000)
|
||||
/** Invalid calibration value */
|
||||
#define RAIL_CAL_INVALID_VALUE (0xFFFFFFFF)
|
||||
|
||||
/**
|
||||
* @struct RAIL_CalValues_t
|
||||
* @brief Calibration value structure
|
||||
|
@ -56,40 +94,221 @@ typedef struct RAIL_CalValues {
|
|||
uint32_t imageRejection; /**< Image Rejection (IR) calibration value */
|
||||
} RAIL_CalValues_t;
|
||||
|
||||
/** Invalid calibration value */
|
||||
#define RAIL_CAL_INVALID_VALUE (0xFFFFFFFF)
|
||||
|
||||
/**
|
||||
* A define to set all RAIL_CalValues_t values to uninitialized.
|
||||
*
|
||||
* This define can be used when you have no data to pass to the calibration
|
||||
* routines but wish to compute and save all possible calibrations.
|
||||
*/
|
||||
#define RAIL_CALVALUES_UNINIT { \
|
||||
RAIL_CAL_INVALID_VALUE, \
|
||||
#define RAIL_CALVALUES_UNINIT (RAIL_CalValues_t){ \
|
||||
RAIL_CAL_INVALID_VALUE, \
|
||||
}
|
||||
|
||||
/** EFR32 specific temperature calibration bit */
|
||||
#define RAIL_CAL_TEMP_VCO (0x00000001)
|
||||
/** EFR32 specific IR calibration bit */
|
||||
#define RAIL_CAL_ONETIME_IRCAL (0x00010000)
|
||||
|
||||
/** Mask to run temperature dependent calibrations */
|
||||
#define RAIL_CAL_TEMP (RAIL_CAL_TEMP_VCO)
|
||||
/** Mask to run one time calibrations */
|
||||
#define RAIL_CAL_ONETIME (RAIL_CAL_ONETIME_IRCAL)
|
||||
/** Mask to run optional performance calibrations */
|
||||
#define RAIL_CAL_PERF ()
|
||||
/** Mask for calibrations that require the radio to be off */
|
||||
#define RAIL_CAL_OFFLINE (RAIL_CAL_ONETIME_IRCAL)
|
||||
/** Mask to run all possible calibrations for this chip */
|
||||
#define RAIL_CAL_ALL (RAIL_CAL_TEMP | RAIL_CAL_ONETIME)
|
||||
/** Mask to run all pending calibrations */
|
||||
#define RAIL_CAL_ALL_PENDING (0x00000000)
|
||||
/** @} */ // end of group Calibration_EFR32
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Diagnostic
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
* @addtogroup Diagnostic_EFR32 EFR32
|
||||
* @{
|
||||
* @brief Types specific to the EFR32 for the diagnostic routines.
|
||||
* @ingroup Diagnostic
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef RAIL_FrequencyOffset_t
|
||||
* @brief Chip-specific type that represents the number of Frequency Offset
|
||||
* units. It is used with \ref RAIL_GetRxFreqOffset() and
|
||||
* \ref RAIL_SetFreqOffset().
|
||||
*
|
||||
* The units on this chip are radio synthesizer resolution steps (synthTicks).
|
||||
* On EFR32 (at least for now), the frequency offset is limited to 15 bits
|
||||
* (size of SYNTH_CALOFFSET). A value of \ref RAIL_FREQUENCY_OFFSET_INVALID
|
||||
* means that this value is invalid.
|
||||
*/
|
||||
typedef int16_t RAIL_FrequencyOffset_t;
|
||||
|
||||
/**
|
||||
* Specifies an invalid frequency offset value. This will be returned if you
|
||||
* call \ref RAIL_GetRxFreqOffset() at an invalid time.
|
||||
*/
|
||||
#define RAIL_FREQUENCY_OFFSET_INVALID ((int16_t)0xFFFF)
|
||||
|
||||
/** @} */ // end of group Diagnostic_EFR32
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Radio Configuration
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* @addtogroup Radio_Configuration_EFR32 EFR32
|
||||
* @{
|
||||
* @ingroup Radio_Configuration
|
||||
* @brief Types specific to the EFR32 for radio configuration.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Radio Configuration structure
|
||||
*
|
||||
* The radio configuration is generated in order to properly configure the
|
||||
* radio for operation on a protocol. These configurations should not be
|
||||
* created or edited by hand.
|
||||
*/
|
||||
typedef const uint32_t *RAIL_RadioConfig_t;
|
||||
|
||||
/** @} */ // end of group Radio_Configuration_EFR32
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Transmit
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* @addtogroup PA_EFR32 EFR32
|
||||
* @{
|
||||
* @ingroup PA
|
||||
* @brief Types specific to the EFR32 for dealing with the on chip PAs.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Raw power levels used directly by the RAIL_Get/SetTxPower API where a higher
|
||||
* numerical value corresponds to a higher output power. These are referred to
|
||||
* as 'raw (values/units)'. On the EFR32 they can range from one of \ref
|
||||
* RAIL_TX_POWER_LEVEL_LP_MIN, \ref RAIL_TX_POWER_LEVEL_HP_MIN, or
|
||||
* \ref RAIL_TX_POWER_LEVEL_SUBGIG_MIN to one of \ref
|
||||
* RAIL_TX_POWER_LEVEL_LP_MAX, \ref RAIL_TX_POWER_LEVEL_HP_MAX, and \ref
|
||||
* RAIL_TX_POWER_LEVEL_SUBGIG_MAX, respectively, depending on the selected \ref
|
||||
* RAIL_TxPowerMode_t.
|
||||
*/
|
||||
typedef uint8_t RAIL_TxPowerLevel_t;
|
||||
|
||||
/**
|
||||
* The maximum valid value for the \ref RAIL_TxPowerLevel_t when in \ref
|
||||
* RAIL_TX_POWER_MODE_2P4_LP mode.
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_LP_MAX 7
|
||||
/**
|
||||
* The maximum valid value for the \ref RAIL_TxPowerLevel_t when in \ref
|
||||
* RAIL_TX_POWER_MODE_2P4_HP mode.
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_HP_MAX 252
|
||||
/**
|
||||
* The maximum valid value for the \ref RAIL_TxPowerLevel_t when in \ref
|
||||
* RAIL_TX_POWER_MODE_SUBGIG mode.
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_SUBGIG_MAX 248
|
||||
/**
|
||||
* The minimum valid value for the \ref RAIL_TxPowerLevel_t when in \ref
|
||||
* RAIL_TX_POWER_MODE_2P4_LP mode.
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_HP_MIN 0
|
||||
/**
|
||||
* The minimum valid value for the \ref RAIL_TxPowerLevel_t when in \ref
|
||||
* RAIL_TX_POWER_MODE_2P4_HP mode.
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_LP_MIN 1
|
||||
/**
|
||||
* The minimum valid value for the \ref RAIL_TxPowerLevel_t when in \ref
|
||||
* RAIL_TX_POWER_MODE_SUBGIG mode.
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_SUBGIG_MIN 0
|
||||
/**
|
||||
* Invalid RAIL_TxPowerLevel_t value returned when there is an error
|
||||
* with RAIL_GetTxPower
|
||||
*/
|
||||
#define RAIL_TX_POWER_LEVEL_INVALID 255
|
||||
|
||||
/**
|
||||
* @enum RAIL_TxPowerMode_t
|
||||
* @brief Enumeration of the EFR32 power modes.
|
||||
*
|
||||
* The power modes on the EFR32 correspond to the different on-chip PA's that
|
||||
* are available. For more information about the power and performance
|
||||
* characteristics of a given amplifier, please consult the data sheet.
|
||||
*/
|
||||
RAIL_ENUM(RAIL_TxPowerMode_t) {
|
||||
/** High power amplifier, up to 20dBm, raw values: 0-252 */
|
||||
RAIL_TX_POWER_MODE_2P4_HP,
|
||||
/** Low power amplifier, up to 0dBm, raw values: 1-7 */
|
||||
RAIL_TX_POWER_MODE_2P4_LP,
|
||||
/** SubGig amplifier, up to 20dBm, raw values: 0-248 */
|
||||
RAIL_TX_POWER_MODE_SUBGIG,
|
||||
/** Invalid amplifier Selection */
|
||||
RAIL_TX_POWER_MODE_NONE
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct RAIL_TxPowerConfig_t
|
||||
*
|
||||
* @brief Structure containing values used to initialize the power amplifiers.
|
||||
*/
|
||||
typedef struct RAIL_TxPowerConfig {
|
||||
/** Tx power mode */
|
||||
RAIL_TxPowerMode_t mode;
|
||||
/** Power amplifier supply voltage in mV, generally:
|
||||
* DCDC supply ~ 1800mV (1.8V)
|
||||
* Battery supply ~ 3300mV (3.3V)
|
||||
*/
|
||||
uint16_t voltage;
|
||||
/** The amount of time to spend ramping for Tx in uS. */
|
||||
uint16_t rampTime;
|
||||
} RAIL_TxPowerConfig_t;
|
||||
|
||||
/** @} */ // end of group PA_EFR32
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// PTI
|
||||
// -----------------------------------------------------------------------------
|
||||
/**
|
||||
* @addtogroup PTI_EFR32 EFR32
|
||||
* @{
|
||||
* @brief EFR32 PTI functionality
|
||||
* @ingroup PTI
|
||||
*
|
||||
* These enums and structures are used with RAIL PTI API. EFR32 supports
|
||||
* SPI and UART PTI, and is configurable in terms of baud rates and pin PTI
|
||||
* pin locations.
|
||||
*/
|
||||
|
||||
/** Channel type enumeration. */
|
||||
RAIL_ENUM(RAIL_PtiMode_t) {
|
||||
/** Turn PTI off entirely */
|
||||
RAIL_PTI_MODE_DISABLED,
|
||||
/** SPI mode. */
|
||||
RAIL_PTI_MODE_SPI,
|
||||
/** UART mode. */
|
||||
RAIL_PTI_MODE_UART,
|
||||
/** 9bit UART mode. */
|
||||
RAIL_PTI_MODE_UART_ONEWIRE
|
||||
};
|
||||
|
||||
/**
|
||||
* @struct RAIL_PtiConfig_t
|
||||
* @brief Configuration for PTI.
|
||||
*/
|
||||
typedef struct RAIL_PtiConfig {
|
||||
/** Packet Trace mode (UART or SPI) */
|
||||
RAIL_PtiMode_t mode;
|
||||
/** Output baudrate for PTI in Hz */
|
||||
uint32_t baud;
|
||||
/** Data output (DOUT) location for pin/port */
|
||||
uint8_t doutLoc;
|
||||
/** Data output (DOUT) GPIO port */
|
||||
GPIO_Port_TypeDef doutPort;
|
||||
/** Data output (DOUT) GPIO pin */
|
||||
uint8_t doutPin;
|
||||
/** Data clock (DCLK) location for pin/port. Only used in SPI mode */
|
||||
uint8_t dclkLoc;
|
||||
/** Data clock (DCLK) GPIO port. Only used in SPI mode */
|
||||
GPIO_Port_TypeDef dclkPort;
|
||||
/** Data clock (DCLK) GPIO pin. Only used in SPI mode */
|
||||
uint8_t dclkPin;
|
||||
/** Data frame (DFRAME) location for pin/port. Only used for */
|
||||
uint8_t dframeLoc;
|
||||
/** Data frame (DFRAME) GPIO port */
|
||||
GPIO_Port_TypeDef dframePort;
|
||||
/** Data frame (DFRAME) GPIO pin */
|
||||
uint8_t dframePin;
|
||||
} RAIL_PtiConfig_t;
|
||||
|
||||
/** @} */ // end of group PTI_EFR32
|
||||
|
||||
#endif
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,56 @@
|
|||
/***************************************************************************//**
|
||||
* @file timing_state.h
|
||||
* @brief RADIO API Abstraction layer for setting state timing information
|
||||
* @version INTERNAL
|
||||
*******************************************************************************
|
||||
* @section License
|
||||
* <b>(C) Copyright 2017 Silicon Labs, http://silabs.com</b>
|
||||
******************************************************************************/
|
||||
#ifndef __TIMING_STATE_H
|
||||
#define __TIMING_STATE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "em_device.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
******************************* STRUCTS ***********************************
|
||||
******************************************************************************/
|
||||
|
||||
// All the timing information for state transitions
|
||||
typedef struct StateTimings {
|
||||
int32_t rxChainDelayNs;
|
||||
#if (_SILICON_LABS_32B_SERIES_1_CONFIG == 1) \
|
||||
|| (_SILICON_LABS_32B_SERIES_1_CONFIG == 4)
|
||||
// On Dumbo the RX2TX time is based on the RXDONE time, which is stable enough
|
||||
// for our purposes. However, the timestamp is still based on FRAMEDET, so we
|
||||
// need two delays, one for the chain delay (FRAMEDET delay), and the second
|
||||
// for the RXDONE delay, which we use for RX2TX transitions only.
|
||||
|
||||
// On Nixi the RX2TX time and the timestamp are based on RXDONE. The chain
|
||||
// delay for RX only calculates how long we need to stay in RX to get SYNC,
|
||||
// which does not need to be precise. (And hard to measure.)
|
||||
int32_t rxDoneDelayNs;
|
||||
#endif
|
||||
int32_t txChainDelayNs;
|
||||
uint16_t rxSearch;
|
||||
uint16_t txToRxSearch;
|
||||
uint16_t rxWarm;
|
||||
uint16_t rxToTx;
|
||||
uint16_t rxFrameToTx;
|
||||
uint16_t txWarm;
|
||||
uint16_t txToRx;
|
||||
uint16_t txToTx;
|
||||
} StateTimings_t;
|
||||
|
||||
/** @} (end addtogroup TIMING) */
|
||||
/** @} (end addtogroup RF_Library) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __TIMING_STATE_H */
|
|
@ -8,7 +8,7 @@
|
|||
"PTI": true,
|
||||
"has-2p4": false,
|
||||
"has-subgig": false,
|
||||
"pti-mode": "RADIO_PTI_MODE_UART",
|
||||
"pti-mode": "RAIL_PTI_MODE_UART",
|
||||
"pti-baudrate" : 1600000,
|
||||
"pti-dout-location": 6,
|
||||
"pti-dout-port": "gpioPortB",
|
||||
|
|
|
@ -2760,7 +2760,7 @@
|
|||
},
|
||||
"EFR32MG1P132F256GM48": {
|
||||
"inherits": ["EFM32"],
|
||||
"extra_labels_add": ["EFR32MG1", "256K", "SL_RAIL", "SL_CRYPTO"],
|
||||
"extra_labels_add": ["EFR32MG1", "EFR32_1", "256K", "SL_RAIL", "SL_CRYPTO"],
|
||||
"core": "Cortex-M4F",
|
||||
"macros_add": ["EFR32MG1P132F256GM48", "TRANSACTION_QUEUE_SIZE_SPI=4"],
|
||||
"supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"],
|
||||
|
@ -2771,7 +2771,7 @@
|
|||
},
|
||||
"EFR32MG1P233F256GM48": {
|
||||
"inherits": ["EFM32"],
|
||||
"extra_labels_add": ["EFR32MG1", "256K", "SL_RAIL", "SL_CRYPTO"],
|
||||
"extra_labels_add": ["EFR32MG1", "EFR32_1", "256K", "SL_RAIL", "SL_CRYPTO"],
|
||||
"core": "Cortex-M4F",
|
||||
"macros_add": ["EFR32MG1P233F256GM48", "TRANSACTION_QUEUE_SIZE_SPI=4"],
|
||||
"supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"],
|
||||
|
@ -2913,7 +2913,7 @@
|
|||
},
|
||||
"EFR32MG12P332F1024GL125": {
|
||||
"inherits": ["EFM32"],
|
||||
"extra_labels_add": ["EFR32MG12", "1024K", "SL_RAIL", "SL_CRYPTO"],
|
||||
"extra_labels_add": ["EFR32MG12", "EFR32_12", "1024K", "SL_RAIL", "SL_CRYPTO"],
|
||||
"core": "Cortex-M4F",
|
||||
"macros_add": ["EFR32MG12P332F1024GL125", "TRANSACTION_QUEUE_SIZE_SPI=4"],
|
||||
"supported_toolchains": ["GCC_ARM", "ARM", "uARM", "IAR"],
|
||||
|
|
Loading…
Reference in New Issue