Extracted TX Power settings to its own file
This commit is contained in:
parent
ca2e82a459
commit
66005c9232
@ -79,15 +79,15 @@ CONTIKI_CPU_SOURCEFILES += ieee-addr.c ble-addr.c
|
||||
CONTIKI_CPU_SOURCEFILES += ble-beacond.c
|
||||
|
||||
ifeq ($(SUPPORTS_PROP_MODE),1)
|
||||
CONTIKI_CPU_SOURCEFILES += prop-mode.c prop-settings.c
|
||||
CONTIKI_CPU_SOURCEFILES += prop-mode.c prop-settings.c prop-tx-power.c
|
||||
endif
|
||||
|
||||
ifeq ($(SUPPORTS_IEEE_MODE),1)
|
||||
CONTIKI_CPU_SOURCEFILES += ieee-mode.c ieee-settings.c
|
||||
CONTIKI_CPU_SOURCEFILES += ieee-mode.c ieee-settings.c ieee-tx-power.c
|
||||
endif
|
||||
|
||||
ifeq ($(SUPPORTS_BLE_BEACON),1)
|
||||
CONTIKI_CPU_SOURCEFILES += ble-settings.c
|
||||
CONTIKI_CPU_SOURCEFILES += ble-settings.c ble-tx-power.c
|
||||
endif
|
||||
|
||||
### CPU-dependent debug source files
|
||||
|
@ -45,12 +45,20 @@
|
||||
|
||||
#include "rf/rf.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name Board Configuration.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Configure that a board has sensors for the dev/sensors.h API. */
|
||||
#ifndef BOARD_CONF_HAS_SENSORS
|
||||
#define BOARD_CONF_HAS_SENSORS 0
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_CONF_SENSORS_ENABLE
|
||||
#define BOARD_CONF_SENSORS_ENABLE BOARD_CONF_HAS_SENSORS
|
||||
/* Enable/disable the dev/sensors.h API for the given board. */
|
||||
#ifndef BOARD_CONF_SENSORS_DISABLE
|
||||
#define BOARD_CONF_SENSORS_DISABLE 0
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
@ -128,24 +136,18 @@
|
||||
#endif /* RF_CONF_MODE */
|
||||
|
||||
/* Number of RX buffers. */
|
||||
#ifdef RF_CONF_RX_BUF_CNT
|
||||
#define RF_RX_BUF_CNT RF_CONF_RX_BUF_CNT
|
||||
#else
|
||||
#define RF_RX_BUF_CNT 4
|
||||
#ifndef RF_CONF_RX_BUF_CNT
|
||||
#define RF_CONF_RX_BUF_CNT 4
|
||||
#endif
|
||||
|
||||
/* Size of each RX buffer in bytes. */
|
||||
#ifdef RF_CONF_RX_BUF_SIZE
|
||||
#define RF_RX_BUF_SIZE RF_CONF_RX_BUF_SIZE
|
||||
#else
|
||||
#define RF_RX_BUF_SIZE 144
|
||||
#ifndef RF_CONF_RX_BUF_SIZE
|
||||
#define RF_CONF_RX_BUF_SIZE 144
|
||||
#endif
|
||||
|
||||
/* Enable/disable BLE beacon. */
|
||||
#ifdef RF_CONF_BLE_BEACON_ENABLE
|
||||
#define RF_BLE_BEACON_ENABLE RF_CONF_BLE_BEACON_ENABLE
|
||||
#else
|
||||
#define RF_BLE_BEACON_ENABLE 0
|
||||
#ifndef RF_CONF_BLE_BEACON_ENABLE
|
||||
#define RF_CONF_BLE_BEACON_ENABLE 0
|
||||
#endif
|
||||
|
||||
#if (RF_BLE_BEACON_ENABLE) && !(SUPPORTS_BLE_BEACON)
|
||||
@ -245,31 +247,73 @@
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name IEEE-mode configuration.
|
||||
* \name IEEE-mode configuration.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Configure auto-ACK for IEEE-mode, which is ACK generated by the
|
||||
* radio.
|
||||
* \brief Configuration to enable/disable auto ACKs in IEEE-mode.
|
||||
* 0 => ACK generated by software
|
||||
* 1 => ACK generated by the radio.
|
||||
*/
|
||||
#ifndef IEEE_MODE_CONF_AUTOACK
|
||||
#define IEEE_MODE_CONF_AUTOACK 1 /**< RF H/W generates ACKs */
|
||||
#define IEEE_MODE_CONF_AUTOACK 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Configure promiscouos mode for IEEE-mode.
|
||||
* \brief Configuration to enable/disable frame filtering in IEEE-mode.
|
||||
* 0 => Disable promiscous mode.
|
||||
* 1 => Enable promiscous mode.
|
||||
*/
|
||||
#ifndef IEEE_MODE_CONF_PROMISCOUS
|
||||
#define IEEE_MODE_CONF_PROMISCOUS 0 /**< 1 to enable promiscous mode */
|
||||
#define IEEE_MODE_CONF_PROMISCOUS 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Configuration to set the RSSI threshold in dBm in IEEE-mode.
|
||||
* Defaults to -90 dBm.
|
||||
*/
|
||||
#ifndef IEEE_MODE_CONF_CCA_RSSI_THRESHOLD
|
||||
#define IEEE_MODE_CONF_CCA_RSSI_THRESHOLD 0xA6
|
||||
#endif
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name TI Drivers Configuration.
|
||||
* \name Prop-mode configuration.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Configuration to set whitener in Prop-mode.
|
||||
* 0 => No whitener
|
||||
* 1 => Whitener.
|
||||
*/
|
||||
#ifndef PROP_MODE_CONF_DW
|
||||
#define PROP_MODE_CONF_DW 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Use 16-bit or 32-bit CRC in Prop-mode.
|
||||
* 0 => 32-bit CRC.
|
||||
* 1 => 16-bit CRC.
|
||||
*/
|
||||
#ifndef PROP_MODE_CONF_USE_CRC16
|
||||
#define PROP_MODE_CONF_USE_CRC16 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \brief Configuration to set the RSSI threshold in dBm in Prop-mode.
|
||||
* Defaults to -90 dBm.
|
||||
*/
|
||||
#ifndef PROP_MODE_CONF_CCA_RSSI_THRESHOLD
|
||||
#define PROP_MODE_CONF_CCA_RSSI_THRESHOLD 0xA6
|
||||
#endif
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name TI Drivers Configuration.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
@ -1,93 +1,77 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Texas Instruments Incorporated
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Check if compiler is GNU Compiler
|
||||
//
|
||||
//*****************************************************************************
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-cpu
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Startup file for GCC for CC13xx/CC26xx.
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Check if compiler is GNU Compiler. */
|
||||
#if !(defined(__GNUC__))
|
||||
#error "startup_cc13xx_cc26xx_gcc.c: Unsupported compiler!"
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <string.h>
|
||||
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#include DeviceFamily_constructPath(inc/hw_types.h)
|
||||
#include DeviceFamily_constructPath(driverlib/interrupt.h)
|
||||
#include DeviceFamily_constructPath(driverlib/setup.h)
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Forward declaration of the default fault handlers.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Forward declaration of the default fault handlers. */
|
||||
void resetISR(void);
|
||||
static void nmiISR(void);
|
||||
static void faultISR(void);
|
||||
static void defaultHandler(void);
|
||||
static void busFaultHandler(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// External declaration for the reset handler that is to be called when the
|
||||
// processor is started
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* External declaration for the reset handler that is to be called when the
|
||||
* processor is started.
|
||||
*/
|
||||
extern void _c_int00(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The entry point for the application.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/* The entry point for the application. */
|
||||
extern int main(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// linker variable that marks the top of stack.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Linker variable that marks the top of stack. */
|
||||
extern unsigned long _stack_end;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The vector table. Note that the proper constructs must be placed on this to
|
||||
// ensure that it ends up at physical address 0x0000.0000.
|
||||
//
|
||||
//*****************************************************************************
|
||||
__attribute__ ((section(".resetVecs"))) __attribute__ ((used))
|
||||
static void(*const resetVectors[16]) (void) =
|
||||
/*
|
||||
* The vector table. Note that the proper constructs must be placed on this to
|
||||
* ensure that it ends up at physical address 0x0000.0000.
|
||||
*/
|
||||
__attribute__((section(".resetVecs"))) __attribute__((used))
|
||||
static void(*const resetVectors[16])(void) =
|
||||
{
|
||||
(void (*)(void))((uint32_t)&_stack_end),
|
||||
/* The initial stack pointer */
|
||||
@ -107,45 +91,35 @@ static void(*const resetVectors[16]) (void) =
|
||||
defaultHandler, /* The PendSV handler */
|
||||
defaultHandler /* The SysTick handler */
|
||||
};
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are arrays of pointers to constructor functions that need to
|
||||
// be called during startup to initialize global objects.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* The following are arrays of pointers to constructor functions that need to
|
||||
* be called during startup to initialize global objects.
|
||||
*/
|
||||
extern void (*__init_array_start[])(void);
|
||||
extern void (*__init_array_end[])(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following global variable is required for C++ support.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/* The following global variable is required for C++ support. */
|
||||
void *__dso_handle = (void *)&__dso_handle;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// The following are constructs created by the linker, indicating where the
|
||||
// the "data" and "bss" segments reside in memory. The initializers for the
|
||||
// for the "data" segment resides immediately following the "text" segment.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* The following are constructs created by the linker, indicating where the
|
||||
* the "data" and "bss" segments reside in memory. The initializers for the
|
||||
* for the "data" segment resides immediately following the "text" segment.
|
||||
*/
|
||||
extern uint32_t __bss_start__;
|
||||
extern uint32_t __bss_end__;
|
||||
extern uint32_t __data_load__;
|
||||
extern uint32_t __data_start__;
|
||||
extern uint32_t __data_end__;
|
||||
|
||||
//
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Initialize the .data and .bss sections and copy the first 16 vectors from
|
||||
// the read-only/reset table to the runtime RAM table. Fill the remaining
|
||||
// vectors with a stub. This vector table will be updated at runtime.
|
||||
//
|
||||
//*****************************************************************************
|
||||
//
|
||||
void localProgramStart(void)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Entry point of the startup code.
|
||||
*
|
||||
* Initialize the .data and .bss sections, and call main.
|
||||
*/
|
||||
void
|
||||
localProgramStart(void)
|
||||
{
|
||||
uint32_t *bs;
|
||||
uint32_t *be;
|
||||
@ -199,18 +173,19 @@ void localProgramStart(void)
|
||||
/* If we ever return signal Error */
|
||||
faultISR();
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor first starts execution
|
||||
// following a reset event. Only the absolutely necessary set is performed,
|
||||
// after which the application supplied entry() routine is called. Any fancy
|
||||
// actions (such as making decisions based on the reset cause register, and
|
||||
// resetting the bits in that register) are left solely in the hands of the
|
||||
// application.
|
||||
//
|
||||
//*****************************************************************************
|
||||
void __attribute__((naked)) resetISR(void)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Reset ISR.
|
||||
*
|
||||
* This is the code that gets called when the processor first starts execution
|
||||
* following a reset event. Only the absolutely necessary set is performed,
|
||||
* after which the application supplied entry() routine is called. Any fancy
|
||||
* actions (such as making decisions based on the reset cause register, and
|
||||
* resetting the bits in that register) are left solely in the hands of the
|
||||
* application.
|
||||
*/
|
||||
void __attribute__((naked))
|
||||
resetISR(void)
|
||||
{
|
||||
__asm__ __volatile__
|
||||
(
|
||||
@ -221,40 +196,38 @@ void __attribute__((naked)) resetISR(void)
|
||||
"bl localProgramStart \n"
|
||||
);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor receives a NMI. This
|
||||
// simply enters an infinite loop, preserving the system state for examination
|
||||
// by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Non-Maskable Interrupt (NMI) ISR.
|
||||
*
|
||||
* This is the code that gets called when the processor receives a NMI. This
|
||||
* simply enters an infinite loop, preserving the system state for examination
|
||||
* by a debugger.
|
||||
*/
|
||||
static void
|
||||
nmiISR(void)
|
||||
{
|
||||
/* Enter an infinite loop. */
|
||||
while(1) {
|
||||
}
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor receives a fault
|
||||
// interrupt. This simply enters an infinite loop, preserving the system state
|
||||
// for examination by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Debug stack pointer.
|
||||
* \param sp Stack pointer.
|
||||
*
|
||||
* Provide a view into the CPU state from the provided stack pointer.
|
||||
*/
|
||||
void
|
||||
debugHardfault(uint32_t *sp)
|
||||
{
|
||||
volatile uint32_t r0;
|
||||
volatile uint32_t r1;
|
||||
volatile uint32_t r2;
|
||||
volatile uint32_t r3;
|
||||
volatile uint32_t r12;
|
||||
volatile uint32_t lr;
|
||||
volatile uint32_t pc;
|
||||
volatile uint32_t psr;
|
||||
volatile uint32_t r0; /**< R0 register */
|
||||
volatile uint32_t r1; /**< R1 register */
|
||||
volatile uint32_t r2; /**< R2 register */
|
||||
volatile uint32_t r3; /**< R3 register */
|
||||
volatile uint32_t r12; /**< R12 register */
|
||||
volatile uint32_t lr; /**< LR register */
|
||||
volatile uint32_t pc; /**< PC register */
|
||||
volatile uint32_t psr; /**< PSR register */
|
||||
|
||||
(void)(r0 = sp[0]);
|
||||
(void)(r1 = sp[1]);
|
||||
@ -265,9 +238,18 @@ debugHardfault(uint32_t *sp)
|
||||
(void)(pc = sp[6]);
|
||||
(void)(psr = sp[7]);
|
||||
|
||||
while(1);
|
||||
/* Enter an infinite loop. */
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief CPU Fault ISR.
|
||||
*
|
||||
* This is the code that gets called when the processor receives a fault
|
||||
* interrupt. Setup a call to debugStackPointer with the current stack pointer.
|
||||
* The stack pointer in this case would be the CPU state which caused the CPU
|
||||
* fault.
|
||||
*/
|
||||
static void
|
||||
faultISR(void)
|
||||
{
|
||||
@ -280,48 +262,50 @@ faultISR(void)
|
||||
"b debugHardfault \n"
|
||||
);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor receives an unexpected
|
||||
// interrupt. This simply enters an infinite loop, preserving the system state
|
||||
// for examination by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Dummy variable */
|
||||
volatile int x__;
|
||||
|
||||
/*
|
||||
* \brief Bus Fault Handler.
|
||||
*
|
||||
* This is the code that gets called when the processor receives an unexpected
|
||||
* interrupt. This simply enters an infinite loop, preserving the system state
|
||||
* for examination by a debugger.
|
||||
*/
|
||||
static void
|
||||
busFaultHandler(void)
|
||||
{
|
||||
x__ = 0;
|
||||
/* Enter an infinite loop. */
|
||||
while(1) {
|
||||
}
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This is the code that gets called when the processor receives an unexpected
|
||||
// interrupt. This simply enters an infinite loop, preserving the system state
|
||||
// for examination by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/* Enter an infinite loop. */
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Default Handler.
|
||||
*
|
||||
* This is the code that gets called when the processor receives an unexpected
|
||||
* interrupt. This simply enters an infinite loop, preserving the system state
|
||||
* for examination by a debugger.
|
||||
*/
|
||||
static void
|
||||
defaultHandler(void)
|
||||
{
|
||||
/* Enter an infinite loop. */
|
||||
while(1) {
|
||||
}
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This function is called by __libc_fini_array which gets called when exit()
|
||||
// is called. In order to support exit(), an empty _fini() stub function is
|
||||
// required.
|
||||
//
|
||||
//*****************************************************************************
|
||||
void _fini(void)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Finalize object function.
|
||||
*
|
||||
* This function is called by __libc_fini_array which gets called when exit()
|
||||
* is called. In order to support exit(), an empty _fini() stub function is
|
||||
* required.
|
||||
*/
|
||||
void
|
||||
_fini(void)
|
||||
{
|
||||
/* Function body left empty intentionally */
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -1,57 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Texas Instruments Incorporated
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Texas Instruments Incorporated nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// Check if compiler is IAR
|
||||
//
|
||||
//*****************************************************************************
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-cpu
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Startup file for IAR for CC13xx/CC26xx.
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Check if compiler is IAR. */
|
||||
#if !(defined(__IAR_SYSTEMS_ICC__))
|
||||
#error "startup_cc13xx_cc26xx_iar.c: Unsupported compiler!"
|
||||
#endif
|
||||
|
||||
/* We need intrinsic functions for IAR (if used in source code) */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* We need intrinsic functions for IAR (if used in source code). */
|
||||
#include <intrinsics.h>
|
||||
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#include DeviceFamily_constructPath(inc/hw_types.h)
|
||||
#include DeviceFamily_constructPath(driverlib/setup.h)
|
||||
#include DeviceFamily_constructPath(driverlib/interrupt.h)
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! Forward declaration of the reset ISR and the default fault handlers.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Forward declaration of the reset ISR and the default fault handlers. */
|
||||
static void nmiISR( void );
|
||||
static void faultISR( void );
|
||||
static void intDefaultHandler( void );
|
||||
@ -139,167 +136,182 @@ extern void TRNGIntHandler(void);
|
||||
#pragma weak AUXCompAIntHandler = intDefaultHandler
|
||||
#pragma weak AUXADCIntHandler = intDefaultHandler
|
||||
#pragma weak TRNGIntHandler = intDefaultHandler
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! The entry point for the application startup code.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* The entry point for the application startup code. */
|
||||
extern void __iar_program_start(void);
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! Get stack start (highest address) symbol from linker file.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/* Get stack start (highest address) symbol from linker file. */
|
||||
extern const void* STACK_TOP;
|
||||
|
||||
// It is required to place something in the CSTACK segment to get the stack
|
||||
// check feature in IAR to work as expected
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* It is required to place something in the CSTACK segment to get the stack
|
||||
* check feature in IAR to work as expected
|
||||
*/
|
||||
__root static void* dummy_stack @ ".stack";
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! The vector table. Note that the proper constructs must be placed on this to
|
||||
//! ensure that it ends up at physical address 0x0000.0000 or at the start of
|
||||
//! the program if located at a start address other than 0.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*
|
||||
* The vector table. Note that the proper constructs must be placed on this to
|
||||
* ensure that it ends up at physical address 0x0000.0000 or at the start of
|
||||
* the program if located at a start address other than 0.
|
||||
*/
|
||||
__root void (* const __vector_table[])(void) @ ".intvec" =
|
||||
{
|
||||
(void (*)(void))&STACK_TOP, // 0 The initial stack pointer
|
||||
__iar_program_start, // 1 The reset handler
|
||||
nmiISR, // 2 The NMI handler
|
||||
faultISR, // 3 The hard fault handler
|
||||
MPUFaultIntHandler, // 4 The MPU fault handler
|
||||
BusFaultIntHandler, // 5 The bus fault handler
|
||||
UsageFaultIntHandler, // 6 The usage fault handler
|
||||
0, // 7 Reserved
|
||||
0, // 8 Reserved
|
||||
0, // 9 Reserved
|
||||
0, // 10 Reserved
|
||||
SVCallIntHandler, // 11 SVCall handler
|
||||
DebugMonIntHandler, // 12 Debug monitor handler
|
||||
0, // 13 Reserved
|
||||
PendSVIntHandler, // 14 The PendSV handler
|
||||
SysTickIntHandler, // 15 The SysTick handler
|
||||
//--- External interrupts ---
|
||||
GPIOIntHandler, // 16 AON edge detect
|
||||
I2CIntHandler, // 17 I2C
|
||||
RFCCPE1IntHandler, // 18 RF Core Command & Packet Engine 1
|
||||
intDefaultHandler, // 19 Reserved
|
||||
AONRTCIntHandler, // 20 AON RTC
|
||||
UART0IntHandler, // 21 UART0 Rx and Tx
|
||||
AUXSWEvent0IntHandler, // 22 AUX software event 0
|
||||
SSI0IntHandler, // 23 SSI0 Rx and Tx
|
||||
SSI1IntHandler, // 24 SSI1 Rx and Tx
|
||||
RFCCPE0IntHandler, // 25 RF Core Command & Packet Engine 0
|
||||
RFCHardwareIntHandler, // 26 RF Core Hardware
|
||||
RFCCmdAckIntHandler, // 27 RF Core Command Acknowledge
|
||||
I2SIntHandler, // 28 I2S
|
||||
AUXSWEvent1IntHandler, // 29 AUX software event 1
|
||||
WatchdogIntHandler, // 30 Watchdog timer
|
||||
Timer0AIntHandler, // 31 Timer 0 subtimer A
|
||||
Timer0BIntHandler, // 32 Timer 0 subtimer B
|
||||
Timer1AIntHandler, // 33 Timer 1 subtimer A
|
||||
Timer1BIntHandler, // 34 Timer 1 subtimer B
|
||||
Timer2AIntHandler, // 35 Timer 2 subtimer A
|
||||
Timer2BIntHandler, // 36 Timer 2 subtimer B
|
||||
Timer3AIntHandler, // 37 Timer 3 subtimer A
|
||||
Timer3BIntHandler, // 38 Timer 3 subtimer B
|
||||
CryptoIntHandler, // 39 Crypto Core Result available
|
||||
uDMAIntHandler, // 40 uDMA Software
|
||||
uDMAErrIntHandler, // 41 uDMA Error
|
||||
FlashIntHandler, // 42 Flash controller
|
||||
SWEvent0IntHandler, // 43 Software Event 0
|
||||
AUXCombEventIntHandler, // 44 AUX combined event
|
||||
AONProgIntHandler, // 45 AON programmable 0
|
||||
DynProgIntHandler, // 46 Dynamic Programmable interrupt
|
||||
// source (Default: PRCM)
|
||||
AUXCompAIntHandler, // 47 AUX Comparator A
|
||||
AUXADCIntHandler, // 48 AUX ADC new sample or ADC DMA
|
||||
// done, ADC underflow, ADC overflow
|
||||
TRNGIntHandler // 49 TRNG event
|
||||
(void (*)(void))&STACK_TOP, /* 0 The initial stack pointer */
|
||||
__iar_program_start, /* 1 The reset handler */
|
||||
nmiISR, /* 2 The NMI handler */
|
||||
faultISR, /* 3 The hard fault handler */
|
||||
MPUFaultIntHandler, /* 4 The MPU fault handler */
|
||||
BusFaultIntHandler, /* 5 The bus fault handler */
|
||||
UsageFaultIntHandler, /* 6 The usage fault handler */
|
||||
0, /* 7 Reserved */
|
||||
0, /* 8 Reserved */
|
||||
0, /* 9 Reserved */
|
||||
0, /* 10 Reserved */
|
||||
SVCallIntHandler, /* 11 SVCall handler */
|
||||
DebugMonIntHandler, /* 12 Debug monitor handler */
|
||||
0, /* 13 Reserved */
|
||||
PendSVIntHandler, /* 14 The PendSV handler */
|
||||
SysTickIntHandler, /* 15 The SysTick handler */
|
||||
/* --- External interrupts --- */
|
||||
GPIOIntHandler, /* 16 AON edge detect */
|
||||
I2CIntHandler, /* 17 I2C */
|
||||
RFCCPE1IntHandler, /* 18 RF Core Command & Packet Engine 1 */
|
||||
intDefaultHandler, /* 19 Reserved */
|
||||
AONRTCIntHandler, /* 20 AON RTC */
|
||||
UART0IntHandler, /* 21 UART0 Rx and Tx */
|
||||
AUXSWEvent0IntHandler, /* 22 AUX software event 0 */
|
||||
SSI0IntHandler, /* 23 SSI0 Rx and Tx */
|
||||
SSI1IntHandler, /* 24 SSI1 Rx and Tx */
|
||||
RFCCPE0IntHandler, /* 25 RF Core Command & Packet Engine 0 */
|
||||
RFCHardwareIntHandler, /* 26 RF Core Hardware */
|
||||
RFCCmdAckIntHandler, /* 27 RF Core Command Acknowledge */
|
||||
I2SIntHandler, /* 28 I2S */
|
||||
AUXSWEvent1IntHandler, /* 29 AUX software event 1 */
|
||||
WatchdogIntHandler, /* 30 Watchdog timer */
|
||||
Timer0AIntHandler, /* 31 Timer 0 subtimer A */
|
||||
Timer0BIntHandler, /* 32 Timer 0 subtimer B */
|
||||
Timer1AIntHandler, /* 33 Timer 1 subtimer A */
|
||||
Timer1BIntHandler, /* 34 Timer 1 subtimer B */
|
||||
Timer2AIntHandler, /* 35 Timer 2 subtimer A */
|
||||
Timer2BIntHandler, /* 36 Timer 2 subtimer B */
|
||||
Timer3AIntHandler, /* 37 Timer 3 subtimer A */
|
||||
Timer3BIntHandler, /* 38 Timer 3 subtimer B */
|
||||
CryptoIntHandler, /* 39 Crypto Core Result available */
|
||||
uDMAIntHandler, /* 40 uDMA Software */
|
||||
uDMAErrIntHandler, /* 41 uDMA Error */
|
||||
FlashIntHandler, /* 42 Flash controller */
|
||||
SWEvent0IntHandler, /* 43 Software Event 0 */
|
||||
AUXCombEventIntHandler, /* 44 AUX combined event */
|
||||
AONProgIntHandler, /* 45 AON programmable 0 */
|
||||
DynProgIntHandler, /* 46 Dynamic Programmable interrupt */
|
||||
/* source (Default: PRCM) */
|
||||
AUXCompAIntHandler, /* 47 AUX Comparator A */
|
||||
AUXADCIntHandler, /* 48 AUX ADC new sample or ADC DMA */
|
||||
/* done, ADC underflow, ADC overflow */
|
||||
TRNGIntHandler /* 49 TRNG event */
|
||||
};
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
// This function is called by __iar_program_start() early in the boot sequence.
|
||||
// Copy the first 16 vectors from the read-only/reset table to the runtime
|
||||
// RAM table. Fill the remaining vectors with a stub. This vector table will
|
||||
// be updated at runtime.
|
||||
//
|
||||
//*****************************************************************************
|
||||
int __low_level_init(void)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Setup trim device.
|
||||
* \return Return value determines whether to omit seg_init or not.
|
||||
* 0 => omit seg_init
|
||||
* 1 => run seg_init
|
||||
*
|
||||
* This function is called by __iar_program_start() early in the boot sequence.
|
||||
* Copy the first 16 vectors from the read-only/reset table to the runtime
|
||||
* RAM table. Fill the remaining vectors with a stub. This vector table will
|
||||
* be updated at runtime.
|
||||
*/
|
||||
int
|
||||
__low_level_init(void)
|
||||
{
|
||||
IntMasterDisable();
|
||||
|
||||
//
|
||||
// Final trim of device
|
||||
//
|
||||
/* Final trim of device */
|
||||
SetupTrimDevice();
|
||||
|
||||
/*==================================*/
|
||||
/* Choose if segment initialization */
|
||||
/* should be done or not. */
|
||||
/* Return: 0 to omit seg_init */
|
||||
/* 1 to run seg_init */
|
||||
/*==================================*/
|
||||
/* Run seg_init */
|
||||
return 1;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! This is the code that gets called when the processor receives a NMI. This
|
||||
//! simply enters an infinite loop, preserving the system state for examination
|
||||
//! by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Non-Maskable Interrupt (NMI) ISR.
|
||||
*
|
||||
* This is the code that gets called when the processor receives a NMI. This
|
||||
* simply enters an infinite loop, preserving the system state for examination
|
||||
* by a debugger.
|
||||
*/
|
||||
static void
|
||||
nmiISR(void)
|
||||
{
|
||||
//
|
||||
// Enter an infinite loop.
|
||||
//
|
||||
while(1)
|
||||
{
|
||||
}
|
||||
/* Enter an infinite loop. */
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Debug stack pointer.
|
||||
* \param sp Stack pointer.
|
||||
*
|
||||
* Provide a view into the CPU state from the provided stack pointer.
|
||||
*/
|
||||
void
|
||||
debugStackPointer(uint32_t *sp)
|
||||
{
|
||||
volatile uint32_t r0; /**< R0 register */
|
||||
volatile uint32_t r1; /**< R1 register */
|
||||
volatile uint32_t r2; /**< R2 register */
|
||||
volatile uint32_t r3; /**< R3 register */
|
||||
volatile uint32_t r12; /**< R12 register */
|
||||
volatile uint32_t lr; /**< LR register */
|
||||
volatile uint32_t pc; /**< PC register */
|
||||
volatile uint32_t psr; /**< PSR register */
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! This is the code that gets called when the processor receives a fault
|
||||
//! interrupt. This simply enters an infinite loop, preserving the system state
|
||||
//! for examination by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/* Cast to void to disable warnings of unused variables */
|
||||
(void)(r0 = sp[0]);
|
||||
(void)(r1 = sp[1]);
|
||||
(void)(r2 = sp[2]);
|
||||
(void)(r3 = sp[3]);
|
||||
(void)(r12 = sp[4]);
|
||||
(void)(lr = sp[5]);
|
||||
(void)(pc = sp[6]);
|
||||
(void)(psr = sp[7]);
|
||||
|
||||
/* Enter an infinite loop. */
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief CPU Fault ISR.
|
||||
*
|
||||
* This is the code that gets called when the processor receives a fault
|
||||
* interrupt. Setup a call to debugStackPointer with the current stack pointer.
|
||||
* The stack pointer in this case would be the CPU state which caused the CPU
|
||||
* fault.
|
||||
*/
|
||||
static void
|
||||
faultISR(void)
|
||||
{
|
||||
//
|
||||
// Enter an infinite loop.
|
||||
//
|
||||
while(1)
|
||||
{
|
||||
}
|
||||
__asm__ __volatile__
|
||||
(
|
||||
"tst lr, #4 \n"
|
||||
"ite eq \n"
|
||||
"mrseq r0, msp \n"
|
||||
"mrsne r0, psp \n"
|
||||
"b debugStackPointer \n"
|
||||
);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! This is the code that gets called when the processor receives an unexpected
|
||||
//! interrupt. This simply enters an infinite loop, preserving the system state
|
||||
//! for examination by a debugger.
|
||||
//
|
||||
//*****************************************************************************
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* \brief Interrupt Default Handler.
|
||||
*
|
||||
* This is the code that gets called when the processor receives an unexpected
|
||||
* interrupt. This simply enters an infinite loop, preserving the system state
|
||||
* for examination by a debugger.
|
||||
*/
|
||||
static void
|
||||
intDefaultHandler(void)
|
||||
{
|
||||
//
|
||||
// Go into an infinite loop.
|
||||
//
|
||||
while(1)
|
||||
{
|
||||
}
|
||||
/* Enter an infinite loop. */
|
||||
for(;;) { /* hang */ }
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -62,37 +62,6 @@ RF_Mode rf_ble_mode =
|
||||
.rfePatchFxn = &rf_patch_rfe_ble,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power table */
|
||||
/* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments: */
|
||||
/* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient) */
|
||||
/* See the Technical Reference Manual for further details about the "txPower" Command field. */
|
||||
/* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise. */
|
||||
RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 1, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 1, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 1, 10) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 1, 12) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 1, 14) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 3, 1, 18) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(47, 3, 1, 22) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 0, 1, 45) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 0, 1, 49) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(38, 0, 1, 55) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(44, 0, 1, 63) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(52, 0, 1, 59) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(60, 0, 1, 47) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY(38, 0, 1, 49) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(46, 0, 1, 59) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(55, 0, 1, 51) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 30) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Overrides for CMD_RADIO_SETUP */
|
||||
uint32_t rf_ble_overrides[] CC_ALIGN(4) =
|
||||
{
|
||||
|
@ -38,22 +38,16 @@
|
||||
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power table size definition */
|
||||
#define RF_BLE_TX_POWER_TABLE_SIZE 17
|
||||
|
||||
/* TX Power Table Object */
|
||||
extern RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ble_mode;
|
||||
extern RF_Mode rf_ble_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_ble_cmd_radio_setup;
|
||||
extern rfc_bleAdvPar_t rf_ble_adv_par;
|
||||
extern rfc_CMD_BLE_ADV_NC_t rf_ble_cmd_ble_adv_nc;
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_ble_cmd_radio_setup;
|
||||
extern rfc_bleAdvPar_t rf_ble_adv_par;
|
||||
extern rfc_CMD_BLE_ADV_NC_t rf_ble_cmd_ble_adv_nc;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API Overrides */
|
||||
extern uint32_t rf_ble_overrides[];
|
||||
extern uint32_t rf_ble_overrides[];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BLE_SETTINGS_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
98
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ble-tx-power.c
Normal file
98
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ble-tx-power.c
Normal file
@ -0,0 +1,98 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for BLE Beacon TX power tables for CC13x0.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1350
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ble_tx_power_table_cc1350[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 1, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 1, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 1, 10) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 3, 1, 12) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 1, 14) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(35, 3, 1, 18) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(47, 3, 1, 22) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(29, 0, 1, 45) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 0, 1, 49) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(38, 0, 1, 55) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(44, 0, 1, 63) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(52, 0, 1, 59) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(60, 0, 1, 47) },
|
||||
#if RF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY(38, 0, 1, 49) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(46, 0, 1, 59) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(55, 0, 1, 51) },
|
||||
/* This setting requires CCFG_FORCE_VDDR_HH = 1. */
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 30) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ble_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#elif defined(DEVICE_CC1350) || defined(DEVICE_CC1350_4)
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_cc1350
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const ble_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t ble_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
@ -63,44 +63,11 @@ RF_Mode rf_ieee_mode =
|
||||
.rfePatchFxn = 0,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ieee_tx_power_table[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_ieee_tx_power_table_size =
|
||||
(sizeof(rf_ieee_tx_power_table) / sizeof(rf_ieee_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_RADIO_SETUP must be configured with default TX power value
|
||||
* in the .txPower field.
|
||||
*/
|
||||
#define DEFAULT_TX_POWER 0x9330 /* 5 dBm */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Overrides for CMD_RADIO_SETUP */
|
||||
uint32_t rf_ieee_overrides[] CC_ALIGN(4) =
|
||||
|
@ -48,10 +48,6 @@
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ieee_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power Table */
|
||||
extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[];
|
||||
extern const size_t rf_ieee_tx_power_table_size;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup;
|
||||
extern rfc_CMD_FS_t rf_cmd_ieee_fs;
|
||||
|
93
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-tx-power.c
Normal file
93
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/ieee-tx-power.c
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for IEEE-mode TX power tables for CC13x0.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1350
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc1350[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Only define the symbols if Prop-mode is selected */
|
||||
#if (RF_MODE == RF_MODE_2_4_GHZ)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC1350) || defined(DEVICE_CC1350_4)
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc1350
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const rf_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t rf_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
@ -75,45 +75,6 @@ RF_Mode rf_prop_mode =
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if defined(DEVICE_CC1310)
|
||||
/*
|
||||
* TX Power table for CC1310
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_prop_tx_power_table[] =
|
||||
{
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 4) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 1, 0, 0) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 8) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 1, 0, 8) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 10) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY( 5, 3, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 3, 0, 12) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 18) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 22) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 3, 0, 28) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 0, 40) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 92) },
|
||||
/* The original PA value (12.5 dBm) have been rounded to an integer value. */
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 83) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 83) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_prop_tx_power_table_size =
|
||||
(sizeof(rf_prop_tx_power_table) / sizeof(rf_prop_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. This depends on whether RF_CONF_TXPOWER_BOOST_MODE
|
||||
@ -128,43 +89,6 @@ const size_t rf_prop_tx_power_table_size =
|
||||
#endif /* defined(DEVICE_CC1310) */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if defined(DEVICE_CC1350)
|
||||
/*
|
||||
* TX Power table for CC1350
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_prop_tx_power_table[] =
|
||||
{
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 9) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 11) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 5, 3, 0, 12) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 3, 0, 14) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 1, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 0, 16) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 18) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 21) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 25) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 3, 0, 32) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 3, 0, 44) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(37, 3, 0, 72) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(43, 0, 0, 94) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 85) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_prop_tx_power_table_size =
|
||||
(sizeof(rf_prop_tx_power_table) / sizeof(rf_prop_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. This depends on whether RF_CONF_TXPOWER_BOOST_MODE
|
||||
@ -179,45 +103,6 @@ const size_t rf_prop_tx_power_table_size =
|
||||
#endif /* defined(DEVICE_CC1350) */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if defined(DEVICE_CC1350_4)
|
||||
/*
|
||||
* TX Power table for CC1350_433
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_prop_tx_power_table[] =
|
||||
{
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 7) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 3, 0, 11) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 3, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 16) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 18) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY( 5, 3, 0, 21) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 3, 0, 23) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 0, 28) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 35) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 1, 0, 39) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 60) },
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 0, 0, 108) },
|
||||
/* The original PA value (13.7 dBm) have been rounded to an integer value. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 92) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 15, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 72) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_prop_tx_power_table_size =
|
||||
(sizeof(rf_prop_tx_power_table) / sizeof(rf_prop_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. This depends on whether RF_CONF_TXPOWER_BOOST_MODE
|
||||
|
168
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-tx-power.c
Normal file
168
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x0/prop-tx-power.c
Normal file
@ -0,0 +1,168 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for Prop-mode TX power tables for CC13x0.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1310
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1310[] =
|
||||
{
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 4) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 1, 0, 0) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 8) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 1, 0, 8) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 10) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY( 5, 3, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 3, 0, 12) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 18) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 3, 0, 22) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(19, 3, 0, 28) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 0, 40) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 92) },
|
||||
/* The original PA value (12.5 dBm) have been rounded to an integer value. */
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 83) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 83) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1350
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1350[] =
|
||||
{
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 9) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 11) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 5, 3, 0, 12) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 3, 0, 14) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 1, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 0, 16) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 18) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 21) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 25) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 3, 0, 32) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 3, 0, 44) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(37, 3, 0, 72) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(43, 0, 0, 94) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 85) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1350_433
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1350_4[] =
|
||||
{
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 7) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 3, 0, 11) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 3, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 3, 3, 0, 16) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 18) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY( 5, 3, 0, 21) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 3, 0, 23) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 0, 28) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 35) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 1, 0, 39) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 60) },
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(15, 0, 0, 108) },
|
||||
/* The original PA value (13.7 dBm) have been rounded to an integer value. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 92) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 15, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 72) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_prop_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Only define the symbols if Prop-mode is selected */
|
||||
#if (RF_MODE == RF_MODE_SUB_1_GHZ)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC1310)
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1310
|
||||
|
||||
#elif defined(DEVICE_CC1350)
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1350
|
||||
|
||||
#elif defined(DEVICE_CC1350_4)
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1350_4
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const rf_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t rf_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
@ -64,33 +64,6 @@ RF_Mode rf_ble_mode =
|
||||
.rfePatchFxn = &rf_patch_rfe_bt5,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Overrides for CMD_BLE5_RADIO_SETUP */
|
||||
uint32_t rf_ble_overrides_common[] CC_ALIGN(4) =
|
||||
{
|
||||
|
@ -38,25 +38,19 @@
|
||||
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power table size definition */
|
||||
#define RF_BLE_TX_POWER_TABLE_SIZE 15
|
||||
|
||||
/* TX Power Table Object */
|
||||
extern RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ble_mode;
|
||||
extern RF_Mode rf_ble_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_BLE5_RADIO_SETUP_t rf_cmd_ble5_radio_setup;
|
||||
extern rfc_ble5AdvAuxPar_t rf_ble5_adv_aux_par;
|
||||
extern rfc_CMD_BLE5_ADV_AUX_t rf_cmd_ble5_adv_aux;
|
||||
extern rfc_CMD_BLE5_RADIO_SETUP_t rf_cmd_ble5_radio_setup;
|
||||
extern rfc_ble5AdvAuxPar_t rf_ble5_adv_aux_par;
|
||||
extern rfc_CMD_BLE5_ADV_AUX_t rf_cmd_ble5_adv_aux;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API Overrides */
|
||||
extern uint32_t rf_ble_overrides_common[];
|
||||
extern uint32_t rf_ble_overrides_1mbps[];
|
||||
extern uint32_t rf_ble_overrides_2mbps[];
|
||||
extern uint32_t rf_ble_overrides_coded[];
|
||||
extern uint32_t rf_ble_overrides_common[];
|
||||
extern uint32_t rf_ble_overrides_1mbps[];
|
||||
extern uint32_t rf_ble_overrides_2mbps[];
|
||||
extern uint32_t rf_ble_overrides_coded[];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BLE_SETTINGS_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
151
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ble-tx-power.c
Normal file
151
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ble-tx-power.c
Normal file
@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for ble-mode TX power tables for CC13x2.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ble_tx_power_table_cc1352r[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352P with default PA
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ble_tx_power_table_cc1352p_dpa[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352P with high PA
|
||||
* The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ble_tx_power_table_cc1352p_hpa[] =
|
||||
{
|
||||
{ 0, RF_TxPowerTable_HIGH_PA_ENTRY(29, 0, 1, 17, 1) },
|
||||
{ 3, RF_TxPowerTable_HIGH_PA_ENTRY(39, 0, 1, 20, 1) },
|
||||
{ 6, RF_TxPowerTable_HIGH_PA_ENTRY(46, 0, 1, 26, 7) },
|
||||
{ 9, RF_TxPowerTable_HIGH_PA_ENTRY(40, 0, 1, 39, 41) },
|
||||
{ 10, RF_TxPowerTable_HIGH_PA_ENTRY(23, 2, 1, 65, 5) },
|
||||
{ 11, RF_TxPowerTable_HIGH_PA_ENTRY(24, 2, 1, 29, 7) },
|
||||
{ 12, RF_TxPowerTable_HIGH_PA_ENTRY(19, 2, 1, 16, 25) },
|
||||
{ 13, RF_TxPowerTable_HIGH_PA_ENTRY(27, 2, 1, 19, 13) },
|
||||
{ 14, RF_TxPowerTable_HIGH_PA_ENTRY(24, 2, 1, 19, 27) },
|
||||
{ 15, RF_TxPowerTable_HIGH_PA_ENTRY(23, 2, 1, 20, 39) },
|
||||
{ 16, RF_TxPowerTable_HIGH_PA_ENTRY(34, 2, 1, 26, 23) },
|
||||
{ 17, RF_TxPowerTable_HIGH_PA_ENTRY(38, 2, 1, 33, 25) },
|
||||
{ 18, RF_TxPowerTable_HIGH_PA_ENTRY(30, 2, 1, 37, 53) },
|
||||
{ 19, RF_TxPowerTable_HIGH_PA_ENTRY(36, 2, 1, 57, 59) },
|
||||
{ 20, RF_TxPowerTable_HIGH_PA_ENTRY(56, 2, 1, 45, 63) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ble_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC1352R)
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_cc1352r
|
||||
|
||||
#elif defined(DEVICE_CC1352P)
|
||||
#if RF_TXPOWER_HIGH_PA
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_cc1352p_hpa
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_cc1352p_dpa
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const ble_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t ble_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
@ -68,40 +68,6 @@ RF_Mode rf_ieee_mode =
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if defined(DEVICE_CC1352R)
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ieee_tx_power_table[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_ieee_tx_power_table_size =
|
||||
(sizeof(rf_ieee_tx_power_table) / sizeof(rf_ieee_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_RADIO_SETUP must be configured with default TX power value
|
||||
* in the .txPower field.
|
||||
@ -135,40 +101,6 @@ uint32_t rf_ieee_overrides[] CC_ALIGN(4) =
|
||||
#if defined(DEVICE_CC1352P)
|
||||
|
||||
#if RF_CONF_TXPOWER_HIGH_PA
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ieee_tx_power_table[] =
|
||||
{
|
||||
{ 0, RF_TxPowerTable_HIGH_PA_ENTRY(29, 0, 1, 17, 1) },
|
||||
{ 3, RF_TxPowerTable_HIGH_PA_ENTRY(39, 0, 1, 20, 1) },
|
||||
{ 6, RF_TxPowerTable_HIGH_PA_ENTRY(46, 0, 1, 26, 7) },
|
||||
{ 9, RF_TxPowerTable_HIGH_PA_ENTRY(40, 0, 1, 39, 41) },
|
||||
{ 10, RF_TxPowerTable_HIGH_PA_ENTRY(23, 2, 1, 65, 5) },
|
||||
{ 11, RF_TxPowerTable_HIGH_PA_ENTRY(24, 2, 1, 29, 7) },
|
||||
{ 12, RF_TxPowerTable_HIGH_PA_ENTRY(19, 2, 1, 16, 25) },
|
||||
{ 13, RF_TxPowerTable_HIGH_PA_ENTRY(27, 2, 1, 19, 13) },
|
||||
{ 14, RF_TxPowerTable_HIGH_PA_ENTRY(24, 2, 1, 19, 27) },
|
||||
{ 15, RF_TxPowerTable_HIGH_PA_ENTRY(23, 2, 1, 20, 39) },
|
||||
{ 16, RF_TxPowerTable_HIGH_PA_ENTRY(34, 2, 1, 26, 23) },
|
||||
{ 17, RF_TxPowerTable_HIGH_PA_ENTRY(38, 2, 1, 33, 25) },
|
||||
{ 18, RF_TxPowerTable_HIGH_PA_ENTRY(30, 2, 1, 37, 53) },
|
||||
{ 19, RF_TxPowerTable_HIGH_PA_ENTRY(36, 2, 1, 57, 59) },
|
||||
{ 20, RF_TxPowerTable_HIGH_PA_ENTRY(56, 2, 1, 45, 63) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_ieee_tx_power_table_size =
|
||||
(sizeof(rf_ieee_tx_power_table) / sizeof(rf_ieee_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. For High PA, this must be 0xFFFF.
|
||||
@ -201,40 +133,6 @@ uint32_t rf_ieee_overrides[] CC_ALIGN(4) =
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#else
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ieee_tx_power_table[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_ieee_tx_power_table_size =
|
||||
(sizeof(rf_ieee_tx_power_table) / sizeof(rf_ieee_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_RADIO_SETUP must be configured with default TX power value
|
||||
* in the .txPower field.
|
||||
|
@ -44,10 +44,6 @@
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ieee_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power Table */
|
||||
extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[];
|
||||
extern const size_t rf_ieee_tx_power_table_size;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup;
|
||||
extern rfc_CMD_FS_t rf_cmd_ieee_fs;
|
||||
|
186
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-tx-power.c
Normal file
186
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/ieee-tx-power.c
Normal file
@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for IEEE-mode TX power tables for CC13x2.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1312R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc1312r[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc1352r[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352P with default PA
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc1352p_dpa[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352P with high PA
|
||||
* The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc1352p_hpa[] =
|
||||
{
|
||||
{ 0, RF_TxPowerTable_HIGH_PA_ENTRY(29, 0, 1, 17, 1) },
|
||||
{ 3, RF_TxPowerTable_HIGH_PA_ENTRY(39, 0, 1, 20, 1) },
|
||||
{ 6, RF_TxPowerTable_HIGH_PA_ENTRY(46, 0, 1, 26, 7) },
|
||||
{ 9, RF_TxPowerTable_HIGH_PA_ENTRY(40, 0, 1, 39, 41) },
|
||||
{ 10, RF_TxPowerTable_HIGH_PA_ENTRY(23, 2, 1, 65, 5) },
|
||||
{ 11, RF_TxPowerTable_HIGH_PA_ENTRY(24, 2, 1, 29, 7) },
|
||||
{ 12, RF_TxPowerTable_HIGH_PA_ENTRY(19, 2, 1, 16, 25) },
|
||||
{ 13, RF_TxPowerTable_HIGH_PA_ENTRY(27, 2, 1, 19, 13) },
|
||||
{ 14, RF_TxPowerTable_HIGH_PA_ENTRY(24, 2, 1, 19, 27) },
|
||||
{ 15, RF_TxPowerTable_HIGH_PA_ENTRY(23, 2, 1, 20, 39) },
|
||||
{ 16, RF_TxPowerTable_HIGH_PA_ENTRY(34, 2, 1, 26, 23) },
|
||||
{ 17, RF_TxPowerTable_HIGH_PA_ENTRY(38, 2, 1, 33, 25) },
|
||||
{ 18, RF_TxPowerTable_HIGH_PA_ENTRY(30, 2, 1, 37, 53) },
|
||||
{ 19, RF_TxPowerTable_HIGH_PA_ENTRY(36, 2, 1, 57, 59) },
|
||||
{ 20, RF_TxPowerTable_HIGH_PA_ENTRY(56, 2, 1, 45, 63) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ieee_ztx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Only define the symbols if Prop-mode is selected */
|
||||
#if (RF_MODE == RF_MODE_2_4_GHZ)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC1312R)
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc1312r
|
||||
|
||||
#elif defined(DEVICE_CC1352R)
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc1352r
|
||||
|
||||
#elif defined(DEVICE_CC1352P)
|
||||
#if RF_TXPOWER_HIGH_PA
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc1352p_hpa
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc1352p_dpa
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const rf_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t rf_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
@ -81,48 +81,6 @@ RF_Mode rf_prop_mode =
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if defined(DEVICE_CC1312R) || defined(DEVICE_CC1352R)
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_prop_tx_power_table[] =
|
||||
{
|
||||
{ -20, RF_TxPowerTable_DEFAULT_PA_ENTRY(0, 3, 0, 2) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(1, 3, 0, 2) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(2, 3, 0, 4) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(4, 3, 0, 5) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 7) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 7) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 9) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 11) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 12) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 2, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 32) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 0, 28) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 3, 0, 55) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 2, 0, 42) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 0, 0, 58) },
|
||||
/* The original PA value (12.5 dBm) have been rounded to an integer value. */
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 102) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 79) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_prop_tx_power_table_size =
|
||||
(sizeof(rf_prop_tx_power_table) / sizeof(rf_prop_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. This depends on whether RF_CONF_TXPOWER_BOOST_MODE
|
||||
@ -188,32 +146,6 @@ uint32_t rf_prop_overrides[] CC_ALIGN(4) =
|
||||
#if defined(DEVICE_CC1352P)
|
||||
|
||||
#if RF_CONF_TXPOWER_HIGH_PA
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_prop_tx_power_table[] =
|
||||
{
|
||||
{ 14, RF_TxPowerTable_HIGH_PA_ENTRY( 7, 0, 0, 23, 4) },
|
||||
{ 15, RF_TxPowerTable_HIGH_PA_ENTRY(10, 0, 0, 26, 4) },
|
||||
{ 16, RF_TxPowerTable_HIGH_PA_ENTRY(14, 0, 0, 33, 4) },
|
||||
{ 17, RF_TxPowerTable_HIGH_PA_ENTRY(18, 0, 0, 40, 6) },
|
||||
{ 18, RF_TxPowerTable_HIGH_PA_ENTRY(24, 0, 0, 51, 8) },
|
||||
{ 19, RF_TxPowerTable_HIGH_PA_ENTRY(32, 0, 0, 73, 12) },
|
||||
{ 20, RF_TxPowerTable_HIGH_PA_ENTRY(27, 0, 0, 85, 32) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_prop_tx_power_table_size =
|
||||
(sizeof(rf_prop_tx_power_table) / sizeof(rf_prop_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. For High PA, this must be 0xFFFF.
|
||||
@ -265,49 +197,6 @@ uint32_t rf_prop_overrides[] CC_ALIGN(4) =
|
||||
|
||||
#else
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_prop_tx_power_table[] =
|
||||
{
|
||||
{ -20, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 3) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 3, 0, 3) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 6) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 8) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 0, 9) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 11) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 14) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 2, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 1, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 1, 0, 19) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 1, 0, 25) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 40) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 0, 0, 71) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 64) },
|
||||
#if RF_CONF_TXPOWER_BOOST_MODE
|
||||
/*
|
||||
* This setting requires RF_CONF_TXPOWER_BOOST_MODE = 1.
|
||||
* The original PA value (13.5 dBm) have been rounded to an integer value.
|
||||
*/
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 0) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_prop_tx_power_table_size =
|
||||
(sizeof(rf_prop_tx_power_table) / sizeof(rf_prop_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_PROP_RADIO_DIV_SETUP must be configured with default TX power value
|
||||
* in the .txPower field. This depends on whether RF_CONF_TXPOWER_BOOST_MODE
|
||||
|
@ -44,10 +44,6 @@
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_prop_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Tx Power Tables */
|
||||
extern RF_TxPowerTable_Entry rf_prop_tx_power_table[];
|
||||
extern const size_t rf_prop_tx_power_table_size;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_PROP_RADIO_DIV_SETUP_t rf_cmd_prop_radio_div_setup;
|
||||
extern rfc_CMD_FS_t rf_cmd_prop_fs;
|
||||
|
203
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-tx-power.c
Normal file
203
arch/cpu/cc13xx-cc26xx/rf-settings/cc13x2/prop-tx-power.c
Normal file
@ -0,0 +1,203 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for TX power tables for CC13x2.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1312R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1312r[] =
|
||||
{
|
||||
{ -20, RF_TxPowerTable_DEFAULT_PA_ENTRY(0, 3, 0, 2) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(1, 3, 0, 2) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(2, 3, 0, 4) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(4, 3, 0, 5) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 7) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 7) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 9) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 11) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 12) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 2, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 32) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 0, 28) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 3, 0, 55) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 2, 0, 42) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 0, 0, 58) },
|
||||
/* The original PA value (12.5 dBm) have been rounded to an integer value. */
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 102) },
|
||||
#if RF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 79) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1352r[] =
|
||||
{
|
||||
{ -20, RF_TxPowerTable_DEFAULT_PA_ENTRY(0, 3, 0, 2) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(1, 3, 0, 2) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(2, 3, 0, 4) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(4, 3, 0, 5) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 3, 0, 7) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 7) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 9) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 11) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 12) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY(16, 3, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY(8, 2, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 3, 0, 32) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY(26, 3, 0, 28) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 3, 0, 55) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(23, 2, 0, 42) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 0, 0, 58) },
|
||||
/* The original PA value (12.5 dBm) have been rounded to an integer value. */
|
||||
{ 13, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 102) },
|
||||
#if RF_TXPOWER_BOOST_MODE
|
||||
/* This setting requires RF_TXPOWER_BOOST_MODE = 1. */
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 79) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352P with default PA
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1352p_dpa[] =
|
||||
{
|
||||
{ -20, RF_TxPowerTable_DEFAULT_PA_ENTRY( 0, 3, 0, 2) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 1, 3, 0, 3) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY( 2, 3, 0, 3) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 3, 0, 6) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 8) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 3, 0, 9) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 9) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 11) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 3, 0, 12) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 3, 0, 14) },
|
||||
{ 6, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 2, 0, 14) },
|
||||
{ 7, RF_TxPowerTable_DEFAULT_PA_ENTRY( 4, 1, 0, 16) },
|
||||
{ 8, RF_TxPowerTable_DEFAULT_PA_ENTRY( 6, 1, 0, 19) },
|
||||
{ 9, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 1, 0, 25) },
|
||||
{ 10, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 40) },
|
||||
{ 11, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 0, 0, 71) },
|
||||
{ 12, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 64) },
|
||||
#if RF_TXPOWER_BOOST_MODE
|
||||
/*
|
||||
* This setting requires RF_TXPOWER_BOOST_MODE = 1.
|
||||
* The original PA value (13.5 dBm) have been rounded to an integer value.
|
||||
*/
|
||||
{ 14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 0) },
|
||||
#endif
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC1352P with high PA
|
||||
* The RF_TxPowerTable_HIGH_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_HIGH_PA_ENTRY(bias, ibboost, boost, coefficient, ldoTrim)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_prop_tx_power_table_cc1352p_hpa[] =
|
||||
{
|
||||
{ 14, RF_TxPowerTable_HIGH_PA_ENTRY( 7, 0, 0, 23, 4) },
|
||||
{ 15, RF_TxPowerTable_HIGH_PA_ENTRY(10, 0, 0, 26, 4) },
|
||||
{ 16, RF_TxPowerTable_HIGH_PA_ENTRY(14, 0, 0, 33, 4) },
|
||||
{ 17, RF_TxPowerTable_HIGH_PA_ENTRY(18, 0, 0, 40, 6) },
|
||||
{ 18, RF_TxPowerTable_HIGH_PA_ENTRY(24, 0, 0, 51, 8) },
|
||||
{ 19, RF_TxPowerTable_HIGH_PA_ENTRY(32, 0, 0, 73, 12) },
|
||||
{ 20, RF_TxPowerTable_HIGH_PA_ENTRY(27, 0, 0, 85, 32) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_prop_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Only define the symbols if Prop-mode is selected */
|
||||
#if (RF_MODE == RF_MODE_SUB_1_GHZ)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC1312R)
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1312r
|
||||
|
||||
#elif defined(DEVICE_CC1352R)
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1352r
|
||||
|
||||
#elif defined(DEVICE_CC1352P)
|
||||
#if RF_TXPOWER_HIGH_PA
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1352p_hpa
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_cc1352p_dpa
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const rf_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t rf_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
@ -61,31 +61,6 @@ RF_Mode rf_ble_mode =
|
||||
.rfePatchFxn = &rf_patch_rfe_ble,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Overrides for CMD_RADIO_SETUP */
|
||||
uint32_t rf_ble_overrides[] CC_ALIGN(4) =
|
||||
{
|
||||
|
@ -38,22 +38,16 @@
|
||||
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power table size definition */
|
||||
#define RF_BLE_TX_POWER_TABLE_SIZE 13
|
||||
|
||||
/* TX Power Table Object */
|
||||
extern RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ble_mode;
|
||||
extern RF_Mode rf_ble_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_ble_cmd_radio_setup;
|
||||
extern rfc_CMD_FS_t rf_ble_cmd_fs;
|
||||
extern rfc_CMD_BLE_ADV_NC_t rf_ble_cmd_ble_adv_nc;
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_ble_cmd_radio_setup;
|
||||
extern rfc_CMD_FS_t rf_ble_cmd_fs;
|
||||
extern rfc_CMD_BLE_ADV_NC_t rf_ble_cmd_ble_adv_nc;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API Overrides */
|
||||
extern uint32_t rf_ble_overrides[];
|
||||
extern uint32_t rf_ble_overrides[];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BLE_SETTINGS_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
88
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ble-tx-power.c
Normal file
88
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ble-tx-power.c
Normal file
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for BLE Beacon TX power tables for CC26x0.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC2650
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ble_tx_power_table_cc2650[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ble_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC2650)
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_cc2650
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const ble_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t ble_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
@ -59,38 +59,6 @@ RF_Mode rf_ieee_mode =
|
||||
.rfePatchFxn = 0,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ieee_tx_power_table[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_ieee_tx_power_table_size =
|
||||
(sizeof(rf_ieee_tx_power_table) / sizeof(rf_ieee_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_RADIO_SETUP must be configured with default TX power value
|
||||
* in the .txPower field.
|
||||
|
@ -44,10 +44,6 @@
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ieee_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power Table */
|
||||
extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[];
|
||||
extern const size_t rf_ieee_tx_power_table_size;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup;
|
||||
extern rfc_CMD_FS_t rf_cmd_ieee_fs;
|
||||
|
93
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-tx-power.c
Normal file
93
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x0/ieee-tx-power.c
Normal file
@ -0,0 +1,93 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for IEEE-mode TX power tables for CC26x0.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC2650
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc2650[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 6) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 6) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 3, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(11, 1, 0, 10) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 1, 12) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(18, 1, 1, 14) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 1, 1, 18) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(33, 1, 1, 24) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(20, 0, 0, 33) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(24, 0, 0, 39) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 0, 0, 45) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(36, 0, 1, 73) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(48, 0, 1, 73) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Only define the symbols if Prop-mode is selected */
|
||||
#if (RF_MODE == RF_MODE_2_4_GHZ)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC2650)
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc2650
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const rf_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t rf_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
@ -63,33 +63,6 @@ RF_Mode rf_ble_mode =
|
||||
.rfePatchFxn = &rf_patch_rfe_bt5,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Overrides for CMD_BLE5_RADIO_SETUP */
|
||||
uint32_t rf_ble_overrides_common[] CC_ALIGN(4) =
|
||||
{
|
||||
|
@ -38,12 +38,6 @@
|
||||
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power table size definition */
|
||||
#define RF_BLE_TX_POWER_TABLE_SIZE 15
|
||||
|
||||
/* TX Power Table Object */
|
||||
extern RF_TxPowerTable_Entry rf_ble_tx_power_table[RF_BLE_TX_POWER_TABLE_SIZE+1];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ble_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
90
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ble-tx-power.c
Normal file
90
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ble-tx-power.c
Normal file
@ -0,0 +1,90 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for BLE Beacon TX power tables for CC26x2.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC2652R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ble_tx_power_table_cc2652r[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY( 7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY( 9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY( 8, 2, 0, 6) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(10, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ble_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC2652R)
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_cc2652r
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const ble_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t ble_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
@ -60,40 +60,6 @@ RF_Mode rf_ieee_mode =
|
||||
.rfePatchFxn = 0,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
RF_TxPowerTable_Entry rf_ieee_tx_power_table[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY(7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 100) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(40, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
/*
|
||||
* TX power table size, with one less entry excluding the
|
||||
* termination entry.
|
||||
*/
|
||||
const size_t rf_ieee_tx_power_table_size =
|
||||
(sizeof(rf_ieee_tx_power_table) / sizeof(rf_ieee_tx_power_table[0])) - 1;
|
||||
|
||||
/*
|
||||
* CMD_RADIO_SETUP must be configured with default TX power value
|
||||
* in the .txPower field.
|
||||
|
@ -45,10 +45,6 @@
|
||||
/* TI-RTOS RF Mode Object */
|
||||
extern RF_Mode rf_ieee_mode;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX Power Table */
|
||||
extern RF_TxPowerTable_Entry rf_ieee_tx_power_table[];
|
||||
extern const size_t rf_ieee_tx_power_table_size;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core API commands */
|
||||
extern rfc_CMD_RADIO_SETUP_t rf_cmd_ieee_radio_setup;
|
||||
extern rfc_CMD_FS_t rf_cmd_ieee_fs;
|
||||
|
95
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-tx-power.c
Normal file
95
arch/cpu/cc13xx-cc26xx/rf-settings/cc26x2/ieee-tx-power.c
Normal file
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-rf-tx-power
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Source file for IEEE-mode TX power tables for CC26x2.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* TX Power table for CC2652R
|
||||
* The RF_TxPowerTable_DEFAULT_PA_ENTRY macro is defined in RF.h and requires the following arguments:
|
||||
* RF_TxPowerTable_DEFAULT_PA_ENTRY(bias, gain, boost coefficient)
|
||||
* See the Technical Reference Manual for further details about the "txPower" Command field.
|
||||
* The PA settings require the CCFG_FORCE_VDDR_HH = 0 unless stated otherwise.
|
||||
*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_cc2652r[] =
|
||||
{
|
||||
{ -21, RF_TxPowerTable_DEFAULT_PA_ENTRY(7, 3, 0, 3) },
|
||||
{ -18, RF_TxPowerTable_DEFAULT_PA_ENTRY(9, 3, 0, 3) },
|
||||
{ -15, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 100) },
|
||||
{ -12, RF_TxPowerTable_DEFAULT_PA_ENTRY(40, 2, 0, 8) },
|
||||
{ -10, RF_TxPowerTable_DEFAULT_PA_ENTRY(12, 2, 0, 11) },
|
||||
{ -9, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 2, 0, 5) },
|
||||
{ -6, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 1, 0, 16) },
|
||||
{ -5, RF_TxPowerTable_DEFAULT_PA_ENTRY(14, 1, 0, 17) },
|
||||
{ -3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 1, 0, 20) },
|
||||
{ 0, RF_TxPowerTable_DEFAULT_PA_ENTRY(25, 1, 0, 26) },
|
||||
{ 1, RF_TxPowerTable_DEFAULT_PA_ENTRY(28, 1, 0, 28) },
|
||||
{ 2, RF_TxPowerTable_DEFAULT_PA_ENTRY(13, 0, 0, 34) },
|
||||
{ 3, RF_TxPowerTable_DEFAULT_PA_ENTRY(17, 0, 0, 42) },
|
||||
{ 4, RF_TxPowerTable_DEFAULT_PA_ENTRY(22, 0, 0, 54) },
|
||||
{ 5, RF_TxPowerTable_DEFAULT_PA_ENTRY(30, 0, 0, 74) },
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
tx_power_table_t rf_ieee_tx_power_table_empty[] =
|
||||
{
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Only define the symbols if Prop-mode is selected */
|
||||
#if (RF_MODE == RF_MODE_2_4_GHZ)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table, based on which board is used. */
|
||||
#if defined(DEVICE_CC2652R)
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_cc2652r
|
||||
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table_empty
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define symbols for both the TX power table and its size. The TX power
|
||||
* table size is with one less entry by excluding the termination entry.
|
||||
*/
|
||||
tx_power_table_t *const rf_tx_power_table = TX_POWER_TABLE;
|
||||
const size_t rf_tx_power_table_size = (sizeof(TX_POWER_TABLE) / sizeof(TX_POWER_TABLE[0])) - 1;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
@ -55,7 +55,7 @@
|
||||
#include "rf/rf.h"
|
||||
#include "rf/ble-addr.h"
|
||||
#include "rf/ble-beacond.h"
|
||||
#include "rf-settings.h"
|
||||
#include "rf/settings.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@ -121,25 +121,6 @@ typedef struct {
|
||||
|
||||
static ble_beacond_t ble_beacond;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Configuration for TX power table */
|
||||
#ifdef BLE_MODE_CONF_TX_POWER_TABLE
|
||||
#define TX_POWER_TABLE BLE_MODE_CONF_TX_POWER_TABLE
|
||||
#else
|
||||
#define TX_POWER_TABLE rf_ble_tx_power_table
|
||||
#endif
|
||||
|
||||
#ifdef BLE_MODE_CONF_TX_POWER_TABLE_SIZE
|
||||
#define TX_POWER_TABLE_SIZE BLE_MODE_CONF_TX_POWER_TABLE_SIZE
|
||||
#else
|
||||
#define TX_POWER_TABLE_SIZE RF_BLE_TX_POWER_TABLE_SIZE
|
||||
#endif
|
||||
|
||||
/* TX power table convenience macros */
|
||||
#define TX_POWER_MIN (TX_POWER_TABLE[0].power)
|
||||
#define TX_POWER_MAX (TX_POWER_TABLE[TX_POWER_TABLE_SIZE - 1].power)
|
||||
|
||||
#define TX_POWER_IN_RANGE(dbm) (((dbm) >= TX_POWER_MIN) && ((dbm) <= TX_POWER_MAX))
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(ble_beacond_process, "RF BLE Beacon Daemon Process");
|
||||
/*---------------------------------------------------------------------------*/
|
||||
rf_ble_beacond_result_t
|
||||
@ -209,11 +190,11 @@ rf_ble_is_active(void)
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
rf_ble_beacond_result_t
|
||||
rf_ble_set_tx_power(int8_t dBm)
|
||||
rf_ble_set_tx_power(int8_t dbm)
|
||||
{
|
||||
rf_result_t res;
|
||||
|
||||
if(!TX_POWER_IN_RANGE(dBm)) {
|
||||
if(!tx_power_in_range(dbm, ble_tx_power_table, ble_tx_power_table_size)) {
|
||||
return RADIO_RESULT_INVALID_VALUE;
|
||||
}
|
||||
|
||||
@ -233,7 +214,7 @@ rf_ble_get_tx_power(void)
|
||||
res = rf_get_tx_power(ble_beacond.rf_handle, TX_POWER_TABLE, &dbm)
|
||||
|
||||
if(res != RF_RESULT_OK) {
|
||||
return ~(int8_t)0;
|
||||
return RF_TxPowerTable_INVALID_DBM;
|
||||
}
|
||||
|
||||
return dbm;
|
||||
|
@ -51,8 +51,8 @@
|
||||
#include <string.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RX buf configuration */
|
||||
#define RX_BUF_CNT RF_RX_BUF_CNT
|
||||
#define RX_BUF_SIZE RF_RX_BUF_SIZE
|
||||
#define RX_BUF_CNT RF_CONF_RX_BUF_CNT
|
||||
#define RX_BUF_SIZE RF_CONF_RX_BUF_SIZE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Receive buffer entries with room for 1 IEEE 802.15.4 frame in each */
|
||||
typedef union {
|
||||
|
@ -71,7 +71,8 @@
|
||||
#include "rf/data-queue.h"
|
||||
#include "rf/dot-15-4g.h"
|
||||
#include "rf/sched.h"
|
||||
#include "ieee-settings.h"
|
||||
#include "rf/settings.h"
|
||||
#include "rf/tx-power.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
@ -79,43 +80,15 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if 1
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
# define PRINTF(...)
|
||||
#endif
|
||||
/* Log configuration */
|
||||
#include "sys/log.h"
|
||||
#define LOG_MODULE "Radio"
|
||||
#define LOG_LEVEL LOG_LEVEL_NONE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Configuration parameters */
|
||||
|
||||
/* Configuration to enable/disable auto ACKs in IEEE mode */
|
||||
#ifdef IEEE_MODE_CONF_AUTOACK
|
||||
#define IEEE_MODE_AUTOACK IEEE_MODE_CONF_AUTOACK
|
||||
#else
|
||||
#define IEEE_MODE_AUTOACK 1
|
||||
#endif /* IEEE_MODE_CONF_AUTOACK */
|
||||
|
||||
/* Configuration to enable/disable frame filtering in IEEE mode */
|
||||
#ifdef IEEE_MODE_CONF_PROMISCOUS
|
||||
#define IEEE_MODE_PROMISCOUS IEEE_MODE_CONF_PROMISCOUS
|
||||
#else
|
||||
#define IEEE_MODE_PROMISCOUS 0
|
||||
#endif /* IEEE_MODE_CONF_PROMISCOUS */
|
||||
|
||||
/* Configuration to set the RSSI threshold */
|
||||
#ifdef IEEE_MODE_CONF_RSSI_THRESHOLD
|
||||
#define IEEE_MODE_RSSI_THRESHOLD IEEE_MODE_CONF_RSSI_THRESHOLD
|
||||
#else
|
||||
#define IEEE_MODE_RSSI_THRESHOLD 0xA6
|
||||
#endif /* IEEE_MODE_CONF_RSSI_THRESHOLD */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table convenience macros */
|
||||
#define TX_POWER_TABLE rf_ieee_tx_power_table
|
||||
#define TX_POWER_TABLE_SIZE rf_ieee_tx_power_table_size
|
||||
|
||||
#define TX_POWER_MIN (TX_POWER_TABLE[0].power)
|
||||
#define TX_POWER_MAX (TX_POWER_TABLE[TX_POWER_TABLE_SIZE - 1].power)
|
||||
|
||||
#define TX_POWER_IN_RANGE(dbm) (((dbm) >= TX_POWER_MIN) && ((dbm) <= TX_POWER_MAX))
|
||||
#define IEEE_MODE_AUTOACK IEEE_MODE_CONF_AUTOACK
|
||||
#define IEEE_MODE_PROMISCOUS IEEE_MODE_CONF_PROMISCOUS
|
||||
#define IEEE_MODE_CCA_RSSI_THRESHOLD IEEE_MODE_CONF_CCA_RSSI_THRESHOLD
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Timeout constants */
|
||||
|
||||
@ -232,24 +205,6 @@ static radio_result_t set_value(radio_param_t, radio_value_t);
|
||||
static radio_result_t get_object(radio_param_t, void*, size_t);
|
||||
static radio_result_t set_object(radio_param_t, const void*, size_t);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Radio driver object */
|
||||
const struct radio_driver ieee_mode_driver = {
|
||||
init,
|
||||
prepare,
|
||||
transmit,
|
||||
send,
|
||||
read,
|
||||
channel_clear,
|
||||
receiving_packet,
|
||||
pending_packet,
|
||||
on,
|
||||
off,
|
||||
get_value,
|
||||
set_value,
|
||||
get_object,
|
||||
set_object,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
rat_overflow_cb(void *arg)
|
||||
{
|
||||
@ -279,7 +234,7 @@ init_rf_params(void)
|
||||
cmd_rx.frameFiltOpt.autoAckEn = 0;
|
||||
#endif
|
||||
|
||||
cmd_rx.ccaRssiThr = IEEE_MODE_RSSI_THRESHOLD;
|
||||
cmd_rx.ccaRssiThr = IEEE_MODE_CCA_RSSI_THRESHOLD;
|
||||
|
||||
cmd_tx.pNextOp = (RF_Op*)&cmd_rx_ack;
|
||||
cmd_tx.condition.rule = COND_NEVER; /* Initially ACK turned off */
|
||||
@ -306,8 +261,8 @@ static rf_result_t
|
||||
set_channel(uint8_t channel)
|
||||
{
|
||||
if(!dot_15_4g_chan_in_range(channel)) {
|
||||
PRINTF("set_channel: illegal channel %d, defaults to %d\n",
|
||||
(int)channel, DOT_15_4G_DEFAULT_CHAN);
|
||||
LOG_WARN("Supplied hannel %d is illegal, defaults to %d\n",
|
||||
(int)channel, DOT_15_4G_DEFAULT_CHAN);
|
||||
channel = DOT_15_4G_DEFAULT_CHAN;
|
||||
}
|
||||
|
||||
@ -327,7 +282,7 @@ set_channel(uint8_t channel)
|
||||
const uint16_t freq = (uint16_t)(new_freq / 1000);
|
||||
const uint16_t frac = (uint16_t)(((new_freq - (freq * 1000)) * 0x10000) / 1000);
|
||||
|
||||
PRINTF("set_channel: %d = 0x%04X.0x%04X (%lu)\n",
|
||||
LOG_DBG("Set channel to %d, frequency 0x%04X.0x%04X (%lu)\n",
|
||||
(int)channel, freq, frac, new_freq);
|
||||
|
||||
cmd_fs.frequency = freq;
|
||||
@ -402,7 +357,7 @@ static int
|
||||
init(void)
|
||||
{
|
||||
if(ieee_radio.rf_handle) {
|
||||
PRINTF("init: Radio already initialized\n");
|
||||
LOG_WARN("Radio already initialized\n");
|
||||
return RF_RESULT_OK;
|
||||
}
|
||||
|
||||
@ -419,13 +374,14 @@ init(void)
|
||||
ieee_radio.rf_handle = netstack_open(&rf_params);
|
||||
|
||||
if(ieee_radio.rf_handle == NULL) {
|
||||
PRINTF("init: unable to open IEEE RF driver\n");
|
||||
LOG_ERR("Unable to open RF driver\n");
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
|
||||
set_channel(DOT_15_4G_DEFAULT_CHAN);
|
||||
|
||||
rf_set_tx_power(ieee_radio.rf_handle, TX_POWER_TABLE, TX_POWER_MAX);
|
||||
int8_t max_tx_power = tx_power_max(rf_tx_power_table, rf_tx_power_table_size);
|
||||
rf_set_tx_power(ieee_radio.rf_handle, rf_tx_power_table, max_tx_power);
|
||||
|
||||
ENERGEST_ON(ENERGEST_TYPE_LISTEN);
|
||||
|
||||
@ -456,7 +412,7 @@ transmit(unsigned short transmit_len)
|
||||
rf_result_t res;
|
||||
|
||||
if(ieee_radio.send_on_cca && channel_clear() != 1) {
|
||||
PRINTF("transmit: channel wasn't clear\n");
|
||||
LOG_WARN("Channel is not clear for transmission\n");
|
||||
return RADIO_TX_COLLISION;
|
||||
}
|
||||
|
||||
@ -551,7 +507,7 @@ read(void *buf, unsigned short buf_len)
|
||||
|
||||
/* Sanity check that Frame is at least Frame Shave bytes long */
|
||||
if(frame_len < FRAME_SHAVE) {
|
||||
PRINTF("read: frame too short len=%d\n", frame_len);
|
||||
LOG_ERR("Received frame too short, len=%d\n", frame_len);
|
||||
|
||||
data_queue_release_entry();
|
||||
return 0;
|
||||
@ -560,9 +516,10 @@ read(void *buf, unsigned short buf_len)
|
||||
const uint8_t *payload_ptr = frame_ptr + sizeof(lensz_t);
|
||||
const unsigned short payload_len = (unsigned short)(frame_len - FRAME_SHAVE);
|
||||
|
||||
/* Sanity check that Payload fits in Buffer */
|
||||
/* Sanity check that Payload fits in buffer. */
|
||||
if(payload_len > buf_len) {
|
||||
PRINTF("read: payload too large for buffer len=%d buf_len=%d\n", payload_len, buf_len);
|
||||
LOG_ERR("MAC payload too large for buffer, len=%d buf_len=%d\n",
|
||||
payload_len, buf_len);
|
||||
|
||||
data_queue_release_entry();
|
||||
return 0;
|
||||
@ -570,11 +527,11 @@ read(void *buf, unsigned short buf_len)
|
||||
|
||||
memcpy(buf, payload_ptr, payload_len);
|
||||
|
||||
/* RSSI stored FCS (2) bytes after payload */
|
||||
/* RSSI stored FCS (2) bytes after payload. */
|
||||
ieee_radio.last.rssi = (int8_t)payload_ptr[payload_len + 2];
|
||||
/* LQI retrieved from Status byte, FCS (2) + RSSI (1) bytes after payload */
|
||||
/* LQI retrieved from Status byte, FCS (2) + RSSI (1) bytes after payload. */
|
||||
ieee_radio.last.corr_lqi = (uint8_t)(payload_ptr[payload_len + 3] & STATUS_CORRELATION);
|
||||
/* Timestamp stored FCS (2) + RSSI (1) + Status (1) bytes after payload */
|
||||
/* Timestamp stored FCS (2) + RSSI (1) + Status (1) bytes after payload. */
|
||||
const uint32_t rat_ticks = *(uint32_t*)(payload_ptr + payload_len + 4);
|
||||
ieee_radio.last.timestamp = rat_to_timestamp(rat_ticks);
|
||||
|
||||
@ -617,9 +574,12 @@ cca_request(cmd_cca_req_t *cmd_cca_req)
|
||||
netstack_stop_rx();
|
||||
}
|
||||
|
||||
return (stat == RF_StatCmdDoneSuccess)
|
||||
? RF_RESULT_OK
|
||||
: RF_RESULT_ERROR;
|
||||
if(stat != RF_StatCmdDoneSuccess) {
|
||||
LOG_ERR("CCA request failed, stat=0x%02X\n", stat);
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
|
||||
return RF_RESULT_OK;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
@ -652,7 +612,7 @@ receiving_packet(void)
|
||||
if((cmd_cca_req.ccaInfo.ccaEnergy == CCA_STATE_BUSY) &&
|
||||
(cmd_cca_req.ccaInfo.ccaCorr == CCA_STATE_BUSY) &&
|
||||
(cmd_cca_req.ccaInfo.ccaSync == CCA_STATE_BUSY)) {
|
||||
PRINTF("receiving_packet: we were TXing ACK\n");
|
||||
LOG_WARN("We are TXing ACK, therefore not receiving packets\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -694,7 +654,7 @@ on(void)
|
||||
rf_result_t res;
|
||||
|
||||
if(ieee_radio.rf_is_on) {
|
||||
PRINTF("on: Radio already on\n");
|
||||
LOG_WARN("Radio is already on\n");
|
||||
return RF_RESULT_OK;
|
||||
}
|
||||
|
||||
@ -714,7 +674,7 @@ static int
|
||||
off(void)
|
||||
{
|
||||
if(!ieee_radio.rf_is_on) {
|
||||
PRINTF("off: Radio already off\n");
|
||||
LOG_WARN("Radio is already off\n");
|
||||
return RF_RESULT_OK;
|
||||
}
|
||||
|
||||
@ -778,7 +738,7 @@ get_value(radio_param_t param, radio_value_t *value)
|
||||
|
||||
/* TX power */
|
||||
case RADIO_PARAM_TXPOWER:
|
||||
res = rf_get_tx_power(ieee_radio.rf_handle, TX_POWER_TABLE, (int8_t*)&value);
|
||||
res = rf_get_tx_power(ieee_radio.rf_handle, rf_tx_power_table, (int8_t*)&value);
|
||||
return ((res == RF_RESULT_OK) &&
|
||||
(*value != RF_TxPowerTable_INVALID_DBM))
|
||||
? RADIO_RESULT_OK
|
||||
@ -807,12 +767,12 @@ get_value(radio_param_t param, radio_value_t *value)
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
case RADIO_CONST_TXPOWER_MIN:
|
||||
*value = (radio_value_t)TX_POWER_MIN;
|
||||
*value = (radio_value_t)tx_power_min(rf_tx_power_table);
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
/* TX power max */
|
||||
case RADIO_CONST_TXPOWER_MAX:
|
||||
*value = (radio_value_t)TX_POWER_MAX;
|
||||
*value = (radio_value_t)tx_power_max(rf_tx_power_table, rf_tx_power_table_size);
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
/* Last RSSI */
|
||||
@ -909,7 +869,7 @@ set_value(radio_param_t param, radio_value_t value)
|
||||
memcpy(&cmd_mod_filt.newFrameFiltOpt, &(rf_cmd_ieee_rx.frameFiltOpt), sizeof(rf_cmd_ieee_rx.frameFiltOpt));
|
||||
const RF_Stat stat = RF_runImmediateCmd(ieee_radio.rf_handle, (uint32_t*)&cmd_mod_filt);
|
||||
if(stat != RF_StatCmdDoneSuccess) {
|
||||
PRINTF("setting address filter failed: stat=0x%02X\n", stat);
|
||||
LOG_ERR("Setting address filter failed, stat=0x%02X\n", stat);
|
||||
return RADIO_RESULT_ERROR;
|
||||
}
|
||||
return RADIO_RESULT_OK;
|
||||
@ -935,10 +895,10 @@ set_value(radio_param_t param, radio_value_t value)
|
||||
|
||||
/* TX Power */
|
||||
case RADIO_PARAM_TXPOWER:
|
||||
if(!TX_POWER_IN_RANGE((int8_t)value)) {
|
||||
if(!tx_power_in_range((int8_t)value, rf_tx_power_table, rf_tx_power_table_size)) {
|
||||
return RADIO_RESULT_INVALID_VALUE;
|
||||
}
|
||||
res = rf_set_tx_power(ieee_radio.rf_handle, TX_POWER_TABLE, (int8_t)value);
|
||||
res = rf_set_tx_power(ieee_radio.rf_handle, rf_tx_power_table, (int8_t)value);
|
||||
return (res == RF_RESULT_OK)
|
||||
? RADIO_RESULT_OK
|
||||
: RADIO_RESULT_ERROR;
|
||||
@ -1037,6 +997,23 @@ set_object(radio_param_t param, const void *src, size_t size)
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
const struct radio_driver ieee_mode_driver = {
|
||||
init,
|
||||
prepare,
|
||||
transmit,
|
||||
send,
|
||||
read,
|
||||
channel_clear,
|
||||
receiving_packet,
|
||||
pending_packet,
|
||||
on,
|
||||
off,
|
||||
get_value,
|
||||
set_value,
|
||||
get_object,
|
||||
set_object,
|
||||
};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
|
@ -64,7 +64,8 @@
|
||||
#include "rf/dot-15-4g.h"
|
||||
#include "rf/sched.h"
|
||||
#include "rf/data-queue.h"
|
||||
#include "prop-settings.h"
|
||||
#include "rf/tx-power.h"
|
||||
#include "rf/settings.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@ -74,64 +75,43 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Log configuration */
|
||||
#include "sys/log.h"
|
||||
#define LOG_MODULE "RF Prop Mode"
|
||||
#define LOG_MODULE "Radio"
|
||||
#define LOG_LEVEL LOG_LEVEL_NONE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if 0
|
||||
# define PRINTF(...)
|
||||
#else
|
||||
# define PRINTF(...) printf(__VA_ARGS__)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Data whitener. 1: Whitener, 0: No whitener */
|
||||
#ifdef PROP_MODE_CONF_DW
|
||||
#define PROP_MODE_DW PROP_MODE_CONF_DW
|
||||
#else
|
||||
#define PROP_MODE_DW 0
|
||||
#endif
|
||||
|
||||
#ifdef PROP_MODE_CONF_USE_CRC16
|
||||
#define PROP_MODE_USE_CRC16 PROP_MODE_CONF_USE_CRC16
|
||||
#else
|
||||
#define PROP_MODE_USE_CRC16 0
|
||||
#endif
|
||||
/* Configuration parameters */
|
||||
#define PROP_MODE_DW PROP_MODE_CONF_DW
|
||||
#define PROP_MODE_USE_CRC16 PROP_MODE_CONF_USE_CRC16
|
||||
#define PROP_MODE_CCA_RSSI_THRESHOLD PROP_MODE_CONF_CCA_RSSI_THRESHOLD
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Used for checking result of CCA_REQ command */
|
||||
#define CCA_STATE_IDLE 0
|
||||
#define CCA_STATE_BUSY 1
|
||||
#define CCA_STATE_INVALID 2
|
||||
|
||||
/* Used as an error return value for get_cca_info */
|
||||
#define RF_GET_CCA_INFO_ERROR 0xFF
|
||||
|
||||
#ifdef PROP_MODE_CONF_RSSI_THRESHOLD
|
||||
#define PROP_MODE_RSSI_THRESHOLD PROP_MODE_CONF_RSSI_THRESHOLD
|
||||
#else
|
||||
#define PROP_MODE_RSSI_THRESHOLD 0xA6
|
||||
#endif
|
||||
typedef enum {
|
||||
CCA_STATE_IDLE = 0,
|
||||
CCA_STATE_BUSY = 1,
|
||||
CCA_STATE_INVALID = 2
|
||||
} cca_state_t;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Defines and variables related to the .15.4g PHY HDR */
|
||||
#define DOT_4G_MAX_FRAME_LEN 2047
|
||||
#define DOT_4G_PHR_LEN 2
|
||||
#define DOT_4G_PHR_LEN 2
|
||||
|
||||
/* PHY HDR bits */
|
||||
#define DOT_4G_PHR_CRC16 0x10
|
||||
#define DOT_4G_PHR_DW 0x08
|
||||
#define DOT_4G_PHR_CRC16 0x10
|
||||
#define DOT_4G_PHR_DW 0x08
|
||||
|
||||
#if PROP_MODE_USE_CRC16
|
||||
/* CRC16 */
|
||||
#define DOT_4G_PHR_CRC_BIT DOT_4G_PHR_CRC16
|
||||
#define CRC_LEN 2
|
||||
#define DOT_4G_PHR_CRC_BIT DOT_4G_PHR_CRC16
|
||||
#define CRC_LEN 2
|
||||
#else
|
||||
/* CRC32 */
|
||||
#define DOT_4G_PHR_CRC_BIT 0
|
||||
#define CRC_LEN 4
|
||||
#define DOT_4G_PHR_CRC_BIT 0
|
||||
#define CRC_LEN 4
|
||||
#endif /* PROP_MODE_USE_CRC16 */
|
||||
|
||||
#if PROP_MODE_DW
|
||||
#define DOT_4G_PHR_DW_BIT DOT_4G_PHR_DW
|
||||
#define DOT_4G_PHR_DW_BIT DOT_4G_PHR_DW
|
||||
#else
|
||||
#define DOT_4G_PHR_DW_BIT 0
|
||||
#define DOT_4G_PHR_DW_BIT 0
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* How long to wait for the RF to enter RX in rf_cmd_ieee_rx */
|
||||
@ -140,15 +120,6 @@
|
||||
/* How long to wait for the rx read entry to become ready */
|
||||
#define TIMEOUT_DATA_ENTRY_BUSY (RTIMER_SECOND / 250)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX power table convenience macros */
|
||||
#define TX_POWER_TABLE rf_prop_tx_power_table
|
||||
#define TX_POWER_TABLE_SIZE rf_prop_tx_power_table_size
|
||||
|
||||
#define TX_POWER_MIN (TX_POWER_TABLE[0].power)
|
||||
#define TX_POWER_MAX (TX_POWER_TABLE[TX_POWER_TABLE_SIZE - 1].power)
|
||||
|
||||
#define TX_POWER_IN_RANGE(dbm) ((TX_POWER_MIN <= (dbm)) && ((dbm) <= TX_POWER_MAX))
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* TX buf configuration */
|
||||
#define TX_BUF_HDR_LEN 2
|
||||
#define TX_BUF_PAYLOAD_LEN 180
|
||||
@ -156,42 +127,44 @@
|
||||
#define TX_BUF_SIZE (TX_BUF_HDR_LEN + TX_BUF_PAYLOAD_LEN)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Size of the Length field in Data Entry, two bytes in this case */
|
||||
typedef uint16_t lensz_t;
|
||||
typedef uint16_t lensz_t;
|
||||
|
||||
#define FRAME_OFFSET sizeof(lensz_t)
|
||||
#define FRAME_SHAVE 2 /* RSSI (1) + Status (1) */
|
||||
#define FRAME_OFFSET sizeof(lensz_t)
|
||||
#define FRAME_SHAVE 2 /**< RSSI (1) + Status (1) */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define MAC_RADIO_RECEIVER_SENSITIVITY_DBM -110
|
||||
#define MAC_RADIO_RECEIVER_SATURATION_DBM 10
|
||||
#define MAC_SPEC_ED_MIN_DBM_ABOVE_RECEIVER_SENSITIVITY 10
|
||||
#define MAC_SPEC_ED_MAX 0xFF
|
||||
/* Constants used when calculating the LQI from the RSSI */
|
||||
#define RX_SENSITIVITY_DBM -110
|
||||
#define RX_SATURATION_DBM 10
|
||||
#define ED_MIN_DBM_ABOVE_RX_SENSITIVITY 10
|
||||
#define ED_MAX 0xFF
|
||||
|
||||
#define ED_RF_POWER_MIN_DBM (MAC_RADIO_RECEIVER_SENSITIVITY_DBM + MAC_SPEC_ED_MIN_DBM_ABOVE_RECEIVER_SENSITIVITY)
|
||||
#define ED_RF_POWER_MAX_DBM MAC_RADIO_RECEIVER_SATURATION_DBM
|
||||
#define ED_RF_POWER_MIN_DBM (RX_SENSITIVITY_DBM + ED_MIN_DBM_ABOVE_RX_SENSITIVITY)
|
||||
#define ED_RF_POWER_MAX_DBM RX_SATURATION_DBM
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RF Core typedefs */
|
||||
typedef rfc_propRxOutput_t rx_output_t;
|
||||
|
||||
typedef struct {
|
||||
/* Outgoing frame buffer */
|
||||
uint8_t tx_buf[TX_BUF_SIZE] CC_ALIGN(4);
|
||||
uint8_t tx_buf[TX_BUF_SIZE] CC_ALIGN(4);
|
||||
|
||||
/* RX Statistics struct */
|
||||
rx_output_t rx_stats;
|
||||
rx_output_t rx_stats;
|
||||
|
||||
/* RSSI Threshold */
|
||||
int8_t rssi_threshold;
|
||||
uint16_t channel;
|
||||
int8_t rssi_threshold;
|
||||
uint16_t channel;
|
||||
|
||||
/* Indicates RF is supposed to be on or off */
|
||||
uint8_t rf_is_on;
|
||||
uint8_t rf_is_on;
|
||||
|
||||
/* RF driver */
|
||||
RF_Handle rf_handle;
|
||||
RF_Handle rf_handle;
|
||||
} prop_radio_t;
|
||||
|
||||
static prop_radio_t prop_radio;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Convenience macros for volatile access with the RF commands */
|
||||
#define cmd_radio_setup (*(volatile rfc_CMD_PROP_RADIO_DIV_SETUP_t *)&rf_cmd_prop_radio_div_setup)
|
||||
#define cmd_fs (*(volatile rfc_CMD_FS_t *) &rf_cmd_prop_fs)
|
||||
#define cmd_tx (*(volatile rfc_CMD_PROP_TX_ADV_t *) &rf_cmd_prop_tx_adv)
|
||||
@ -202,6 +175,7 @@ tx_is_active(void)
|
||||
{
|
||||
return cmd_tx.status == ACTIVE;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static inline bool
|
||||
rx_is_active(void)
|
||||
{
|
||||
@ -322,7 +296,7 @@ calculate_lqi(int8_t rssi)
|
||||
* best granularity. This is done by grouping the math operations to
|
||||
* compute the entire numerator before doing any division.
|
||||
*/
|
||||
return (MAC_SPEC_ED_MAX * (rssi - ED_RF_POWER_MIN_DBM)) / (ED_RF_POWER_MAX_DBM - ED_RF_POWER_MIN_DBM);
|
||||
return (ED_MAX * (rssi - ED_RF_POWER_MIN_DBM)) / (ED_RF_POWER_MAX_DBM - ED_RF_POWER_MIN_DBM);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
@ -576,7 +550,7 @@ get_value(radio_param_t param, radio_value_t *value)
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
case RADIO_PARAM_TXPOWER:
|
||||
res = rf_get_tx_power(prop_radio.rf_handle, TX_POWER_TABLE, (int8_t*)&value);
|
||||
res = rf_get_tx_power(prop_radio.rf_handle, rf_tx_power_table, (int8_t*)&value);
|
||||
return ((res == RF_RESULT_OK) &&
|
||||
(*value != RF_TxPowerTable_INVALID_DBM))
|
||||
? RADIO_RESULT_OK
|
||||
@ -601,11 +575,11 @@ get_value(radio_param_t param, radio_value_t *value)
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
case RADIO_CONST_TXPOWER_MIN:
|
||||
*value = (radio_value_t)TX_POWER_MIN;
|
||||
*value = (radio_value_t)tx_power_min(rf_tx_power_table);
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
case RADIO_CONST_TXPOWER_MAX:
|
||||
*value = (radio_value_t)TX_POWER_MAX;
|
||||
*value = (radio_value_t)tx_power_max(rf_tx_power_table, rf_tx_power_table_size);
|
||||
return RADIO_RESULT_OK;
|
||||
|
||||
default:
|
||||
@ -639,10 +613,10 @@ set_value(radio_param_t param, radio_value_t value)
|
||||
: RADIO_RESULT_ERROR;
|
||||
|
||||
case RADIO_PARAM_TXPOWER:
|
||||
if(!TX_POWER_IN_RANGE((int8_t)value)) {
|
||||
if(!tx_power_in_range((int8_t)value, rf_tx_power_table, rf_tx_power_table_size)) {
|
||||
return RADIO_RESULT_INVALID_VALUE;
|
||||
}
|
||||
res = rf_set_tx_power(prop_radio.rf_handle, TX_POWER_TABLE, (int8_t)value);
|
||||
res = rf_set_tx_power(prop_radio.rf_handle, rf_tx_power_table, (int8_t)value);
|
||||
return (res == RF_RESULT_OK)
|
||||
? RADIO_RESULT_OK
|
||||
: RADIO_RESULT_ERROR;
|
||||
|
@ -57,17 +57,18 @@
|
||||
#include "rf/rf.h"
|
||||
#include "rf/sched.h"
|
||||
#include "rf/data-queue.h"
|
||||
#include "rf-settings.h"
|
||||
#include "rf/settings.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if 1
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/* Log configuration */
|
||||
#include "sys/log.h"
|
||||
#define LOG_MODULE "Radio"
|
||||
#define LOG_LEVEL LOG_LEVEL_NONE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Configuration parameters */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define CMD_FS_RETRIES 3
|
||||
|
||||
@ -175,7 +176,7 @@ cmd_rx_restore(uint_fast8_t rx_key)
|
||||
);
|
||||
|
||||
if(!CMD_HANDLE_OK(cmd_rx_handle)) {
|
||||
PRINTF("cmd_rx_restore: unable to schedule RX command handle=%d status=0x%04x",
|
||||
LOG_ERR("Unable to restore RX command, handle=%d status=0x%04x",
|
||||
cmd_rx_handle, CMD_STATUS(netstack_cmd_rx));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
@ -322,7 +323,7 @@ netstack_sched_ieee_tx(bool ack_request)
|
||||
);
|
||||
|
||||
if(!CMD_HANDLE_OK(tx_handle)) {
|
||||
PRINTF("netstack_sched_tx: unable to schedule TX command handle=%d status=0x%04x\n",
|
||||
LOG_ERR("Unable to schedule TX command, handle=%d status=0x%04x\n",
|
||||
tx_handle, CMD_STATUS(netstack_cmd_tx));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
@ -348,7 +349,7 @@ netstack_sched_ieee_tx(bool ack_request)
|
||||
}
|
||||
|
||||
if(!EVENTS_CMD_DONE(tx_events)) {
|
||||
PRINTF("netstack_sched_tx: TX command pend error events=0x%08llx status=0x%04x\n",
|
||||
LOG_ERR("Pending on TX comand generated error, events=0x%08llx status=0x%04x\n",
|
||||
tx_events, CMD_STATUS(netstack_cmd_tx));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
@ -376,8 +377,8 @@ netstack_sched_prop_tx(void)
|
||||
);
|
||||
|
||||
if(!CMD_HANDLE_OK(tx_handle)) {
|
||||
PRINTF("netstack_sched_tx: unable to schedule TX command handle=%d status=0x%04x\n",
|
||||
tx_handle, CMD_STATUS(netstack_cmd_tx));
|
||||
LOG_ERR("Unable to schedule TX command, handle=%d status=0x%04x\n",
|
||||
tx_handle, CMD_STATUS(netstack_cmd_tx));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
|
||||
@ -405,8 +406,8 @@ netstack_sched_prop_tx(void)
|
||||
}
|
||||
|
||||
if(!EVENTS_CMD_DONE(tx_events)) {
|
||||
PRINTF("netstack_sched_tx: TX command pend error events=0x%08llx status=0x%04x\n",
|
||||
tx_events, CMD_STATUS(netstack_cmd_tx));
|
||||
LOG_ERR("Pending on scheduled TX command generated error, events=0x%08llx status=0x%04x\n",
|
||||
tx_events, CMD_STATUS(netstack_cmd_tx));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
|
||||
@ -417,7 +418,7 @@ rf_result_t
|
||||
netstack_sched_rx(bool start)
|
||||
{
|
||||
if(cmd_rx_is_active()) {
|
||||
PRINTF("netstack_sched_rx: already in RX\n");
|
||||
LOG_WARN("Already in RX when scheduling RX\n");
|
||||
return RF_RESULT_OK;
|
||||
}
|
||||
|
||||
@ -438,8 +439,8 @@ netstack_sched_rx(bool start)
|
||||
);
|
||||
|
||||
if(!CMD_HANDLE_OK(cmd_rx_handle)) {
|
||||
PRINTF("netstack_sched_rx: unable to schedule RX command handle=%d status=0x%04x\n",
|
||||
cmd_rx_handle, CMD_STATUS(netstack_cmd_rx));
|
||||
LOG_ERR("Unable to schedule RX command, handle=%d status=0x%04x\n",
|
||||
cmd_rx_handle, CMD_STATUS(netstack_cmd_rx));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
|
||||
@ -457,7 +458,7 @@ rf_result_t
|
||||
netstack_stop_rx(void)
|
||||
{
|
||||
if(!cmd_rx_is_active()) {
|
||||
PRINTF("netstack_stop_rx: RX not active\n");
|
||||
LOG_WARN("RX not active when stopping RX\n");
|
||||
return RF_RESULT_OK;
|
||||
}
|
||||
|
||||
@ -498,8 +499,8 @@ ble_sched_beacon(RF_Callback cb, RF_EventMask bm_event)
|
||||
);
|
||||
|
||||
if(!CMD_HANDLE_OK(beacon_handle)) {
|
||||
PRINTF("ble_sched_beacon: unable to schedule BLE Beacon command handle=%d status=0x%04x\n",
|
||||
beacon_handle, CMD_STATUS(ble_cmd_beacon));
|
||||
LOG_ERR("Unable to schedule BLE Beacon command, handle=%d status=0x%04x\n",
|
||||
beacon_handle, CMD_STATUS(ble_cmd_beacon));
|
||||
return RF_RESULT_ERROR;
|
||||
}
|
||||
|
||||
@ -508,8 +509,8 @@ ble_sched_beacon(RF_Callback cb, RF_EventMask bm_event)
|
||||
/* Wait until Beacon operation finishes */
|
||||
RF_EventMask beacon_events = RF_pendCmd(&rf_ble, beacon_handle, 0);
|
||||
if(!EVENTS_CMD_DONE(beacon_events)) {
|
||||
PRINTF("ble_sched_beacon: Beacon command pend error events=0x%08llx status=0x%04x\n",
|
||||
beacon_events, CMD_STATUS(ble_cmd_beacon));
|
||||
LOG_ERR("Pending on scheduled BLE Beacon command generated error, events=0x%08llx status=0x%04x\n",
|
||||
beacon_events, CMD_STATUS(ble_cmd_beacon));
|
||||
|
||||
cmd_rx_restore(rx_key);
|
||||
return RF_RESULT_ERROR;
|
||||
@ -534,7 +535,9 @@ PROCESS_THREAD(rf_sched_process, ev, data)
|
||||
/* start the synth re-calibration timer once. */
|
||||
if(rf_is_on) {
|
||||
rf_is_on = false;
|
||||
etimer_set(&synth_recal_timer, synth_recal_interval());
|
||||
clock_time_t interval = synth_recal_interval();
|
||||
LOG_INFO("Starting synth re-calibration timer, next timeout %lu\n", interval);
|
||||
etimer_set(&synth_recal_timer, interval);
|
||||
}
|
||||
|
||||
if(ev == PROCESS_EVENT_POLL) {
|
||||
@ -549,7 +552,7 @@ PROCESS_THREAD(rf_sched_process, ev, data)
|
||||
* RX after we've freed at least on packet.
|
||||
*/
|
||||
if(rx_buf_full) {
|
||||
PRINTF("rf_core: RX buf full, restart RX status=0x%04x\n", CMD_STATUS(netstack_cmd_rx));
|
||||
LOG_ERR("RX buffer full, restart RX status=0x%04x\n", CMD_STATUS(netstack_cmd_rx));
|
||||
rx_buf_full = false;
|
||||
|
||||
/* Restart RX. */
|
||||
@ -569,10 +572,11 @@ PROCESS_THREAD(rf_sched_process, ev, data)
|
||||
/* Scheduling CMD_FS will re-calibrate the synth. */
|
||||
if((ev == PROCESS_EVENT_TIMER) &&
|
||||
etimer_expired(&synth_recal_timer)) {
|
||||
PRINTF("rf_core: Re-calibrate synth\n");
|
||||
netstack_sched_fs();
|
||||
clock_time_t interval = synth_recal_interval();
|
||||
LOG_DBG("Re-calibrate synth, next interval %lu\n", interval);
|
||||
|
||||
etimer_set(&synth_recal_timer, synth_recal_interval());
|
||||
netstack_sched_fs();
|
||||
etimer_set(&synth_recal_timer, interval);
|
||||
}
|
||||
}
|
||||
PROCESS_END();
|
||||
|
@ -27,6 +27,19 @@
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-cpu
|
||||
* @{
|
||||
*
|
||||
* \defgroup cc13xx-cc26xx-rf-settings RF settings for CC13xx/CC26xx
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Header file of RF settings for CC13xx/CC26xx.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef NETSTACK_SETTINGS_H_
|
||||
#define NETSTACK_SETTINGS_H_
|
||||
@ -35,57 +48,63 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if SUPPORTS_PROP_MODE
|
||||
#include "prop-settings.h"
|
||||
#endif
|
||||
|
||||
#if SUPPORTS_IEEE_MODE
|
||||
#include "ieee-settings.h"
|
||||
#endif
|
||||
|
||||
#if SUPPORTS_BLE_BEACON
|
||||
#include "ble-settings.h"
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Netstack RF command configuration */
|
||||
|
||||
/* Prop-mode RF settings */
|
||||
#if (RF_MODE == RF_MODE_SUB_1_GHZ)
|
||||
|
||||
#include "prop-settings.h"
|
||||
|
||||
#define netstack_mode rf_prop_mode
|
||||
#define netstack_cmd_radio_setup rf_cmd_prop_radio_div_setup
|
||||
#define netstack_cmd_fs rf_cmd_prop_fs
|
||||
#define netstack_cmd_tx rf_cmd_prop_tx_adv
|
||||
#define netstack_cmd_rx rf_cmd_prop_rx_adv
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/* IEEE-mode RF settings */
|
||||
#elif (RF_MODE == RF_MODE_2_4_GHZ)
|
||||
|
||||
#include "ieee-settings.h"
|
||||
|
||||
#define netstack_mode rf_ieee_mode
|
||||
#define netstack_cmd_radio_setup rf_cmd_ieee_radio_setup
|
||||
#define netstack_cmd_fs rf_cmd_ieee_fs
|
||||
#define netstack_cmd_tx rf_cmd_ieee_tx
|
||||
#define netstack_cmd_rx rf_cmd_ieee_rx
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#else
|
||||
#error "Unsupported RF_MODE"
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* BLE RF settings */
|
||||
|
||||
#endif /* RF_MODE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* BLE Beacon RF command configuration */
|
||||
|
||||
/* CC13x0/CC26x0 devices */
|
||||
#if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X0_CC26X0)
|
||||
|
||||
#include "ble-settings.h"
|
||||
|
||||
#define ble_mode rf_ble_mode
|
||||
#define ble_cmd_radio_setup rf_ble_cmd_radio_setup
|
||||
#define ble_adv_par rf_ble_adv_par
|
||||
#define ble_cmd_beacon rf_ble_cmd_ble_adv_nc
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* CC13x2/CC26x2 devices */
|
||||
#elif (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2)
|
||||
|
||||
#include "ble-settings.h"
|
||||
|
||||
#define ble_mode rf_ble_mode
|
||||
#define ble_cmd_radio_setup rf_cmd_ble5_radio_setup
|
||||
#define ble_adv_par rf_ble5_adv_aux_par
|
||||
#define ble_cmd_beacon rf_cmd_ble5_adv_aux
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#else
|
||||
#error "Unsupported DeviceFamily_PARENT for BLE settings"
|
||||
#endif
|
||||
#endif /* DeviceFamily_PARENT */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* NETSTACK_SETTINGS_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
106
arch/cpu/cc13xx-cc26xx/rf/tx-power.h
Normal file
106
arch/cpu/cc13xx-cc26xx/rf/tx-power.h
Normal file
@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Texas Instruments Incorporated - http://www.ti.com/
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/**
|
||||
* \addtogroup cc13xx-cc26xx-cpu
|
||||
* @{
|
||||
*
|
||||
* \defgroup cc13xx-cc26xx-rf-tx-power TX power functioanlity for CC13xx/CC26xx
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* \file
|
||||
* Header file of TX power functionality of CC13xx/CC26xx.
|
||||
* \author
|
||||
* Edvard Pettersen <e.pettersen@ti.com>
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef TX_POWER_H_
|
||||
#define TX_POWER_H_
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <stdbool.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define RF_TXPOWER_HIGH_PA RF_CONF_TXPOWER_HIGH_PA
|
||||
#define RF_TXPOWER_BOOST_MODE RF_CONF_TXPOWER_BOOST_MODE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
typedef RF_TxPowerTable_Entry tx_power_table_t;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name Extern declarations of TX Power Table variables.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Nestack RF TX power table */
|
||||
extern tx_power_table_t *const rf_tx_power_table;
|
||||
extern const size_t rf_tx_power_table_size;
|
||||
|
||||
/* BLE Beacon RF TX power table */
|
||||
extern tx_power_table_t *const ble_tx_power_table;
|
||||
extern const size_t ble_tx_power_table_size;
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name TX power table convenience functions.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
static inline int8_t
|
||||
tx_power_min(tx_power_table_t *table)
|
||||
{
|
||||
return table[0].power;
|
||||
}
|
||||
|
||||
static inline int8_t
|
||||
tx_power_max(tx_power_table_t *table, size_t size)
|
||||
{
|
||||
return table[size - 1].power;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
tx_power_in_range(int8_t dbm, tx_power_table_t *table, size_t size)
|
||||
{
|
||||
return (dbm >= tx_power_min(table)) &&
|
||||
(dbm <= tx_power_max(table, size));
|
||||
}
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* TX_POWER_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* @}
|
||||
* @}
|
||||
*/
|
@ -38,6 +38,7 @@ DEFINES += $(BOARD_TYPE)
|
||||
DEFINES += PLATFORM_HAS_BUTTON=$(PLATFORM_HAS_BUTTON)
|
||||
DEFINES += SUPPORTS_PROP_MODE=$(SUPPORTS_PROP_MODE)
|
||||
DEFINES += SUPPORTS_IEEE_MODE=$(SUPPORTS_IEEE_MODE)
|
||||
DEFINES += SUPPORTS_BLE_BEACON=$(SUPPORTS_BLE_BEACON)
|
||||
DEFINES += SUPPORTS_HIGH_PA=$(SUPPORTS_HIGH_PA)
|
||||
|
||||
### If the user-specified a Node ID, pass a define
|
||||
|
@ -84,7 +84,7 @@
|
||||
/* Log configuration */
|
||||
#include "sys/log.h"
|
||||
#define LOG_MODULE "CC13xx/CC26xx"
|
||||
#define LOG_LEVEL LOG_LEVEL_DBG
|
||||
#define LOG_LEVEL LOG_LEVEL_MAIN
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Board-specific initialization function. This function is defined in
|
||||
@ -164,7 +164,7 @@ platform_init_stage_one(void)
|
||||
gpio_hal_init();
|
||||
leds_init();
|
||||
|
||||
fade(Board_PIN_RLED);
|
||||
fade(Board_PIN_LED0);
|
||||
|
||||
/* TI Drivers init */
|
||||
#if TI_UART_CONF_ENABLE
|
||||
@ -182,7 +182,7 @@ platform_init_stage_one(void)
|
||||
|
||||
TRNG_init();
|
||||
|
||||
fade(Board_PIN_GLED);
|
||||
fade(Board_PIN_LED1);
|
||||
|
||||
/* NoRTOS must be called last */
|
||||
NoRTOS_start();
|
||||
@ -214,7 +214,7 @@ platform_init_stage_two(void)
|
||||
|
||||
button_hal_init();
|
||||
|
||||
fade(Board_PIN_RLED);
|
||||
fade(Board_PIN_LED0);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
@ -251,7 +251,7 @@ platform_init_stage_three(void)
|
||||
process_start(&sensors_process, NULL);
|
||||
#endif
|
||||
|
||||
fade(Board_PIN_GLED);
|
||||
fade(Board_PIN_LED1);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
|
@ -41,12 +41,13 @@
|
||||
#include "lib/sensors.h"
|
||||
#include "sys/ctimer.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "bmp-280-sensor.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <Board.h>
|
||||
|
||||
#include <ti/drivers/I2C.h>
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "bmp-280-sensor.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
@ -58,6 +59,13 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Disable the entire file if sensors are disabled, as it could potentially
|
||||
* create compile errors with missing defines from either the Board file or
|
||||
* configuration defines.
|
||||
*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef Board_BMP280_ADDR
|
||||
# error "Board file doesn't define I2C address Board_BMP280_ADDR"
|
||||
#endif
|
||||
@ -458,4 +466,6 @@ status(int type)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(bmp_280_sensor, "BMP280", value, configure, status);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_SENSORS_ENABLE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -59,10 +59,14 @@
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* The BMP-280 driver uses the I2C0 peripheral to access the senssor */
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
#if (TI_I2C_CONF_ENABLE == 0) || (TI_I2C_CONF_I2C0_ENABLE == 0)
|
||||
# error "The BMP280 requires the I2C driver (TI_I2C_CONF_ENABLE = 1)"
|
||||
#endif
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
typedef enum {
|
||||
BMP_280_SENSOR_TYPE_TEMP,
|
||||
|
@ -72,6 +72,15 @@
|
||||
#define BOARD_CONF_HAS_SENSORS 1
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name Enable or disable the SensorTag sensors.
|
||||
*
|
||||
* Those values are not meant to be modified by the user
|
||||
* @{
|
||||
*/
|
||||
#define BOARD_SENSORS_ENABLE (!(BOARD_CONF_SENSORS_DISABLE))
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_CONF_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
|
@ -4,7 +4,7 @@
|
||||
SUBFAMILY = cc13x0-cc26x0
|
||||
DEVICE_FAMILY = CC26X0
|
||||
DEVICE_LINE = CC26XX
|
||||
DEVICE = CC1350
|
||||
DEVICE = CC2650
|
||||
|
||||
BOARD_SOURCEFILES += CC2650STK.c CC2650STK_fxns.c
|
||||
BOARD_SOURCEFILES += leds-arch.c
|
||||
|
@ -40,6 +40,8 @@
|
||||
#include "contiki.h"
|
||||
#include "sys/ctimer.h"
|
||||
#include "lib/sensors.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "hdc-1000-sensor.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <Board.h>
|
||||
@ -58,6 +60,13 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Disable the entire file if sensors are disabled, as it could potentially
|
||||
* create compile errors with missing defines from either the Board file or
|
||||
* configuration defines.
|
||||
*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef Board_HDC1000_ADDR
|
||||
# error "Board file doesn't define the I2C address Board_HDC1000_ADDR"
|
||||
#endif
|
||||
@ -342,4 +351,6 @@ status(int type)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(hdc_1000_sensor, "HDC1000", value, configure, status);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_SENSORS_ENABLE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -67,9 +67,13 @@
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
#if (TI_I2C_CONF_ENABLE == 0) || (TI_I2C_CONF_I2C0_ENABLE == 0)
|
||||
# error "The HDC-1000 requires the I2C driver (TI_I2C_CONF_ENABLE = 1)"
|
||||
#endif
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
typedef enum {
|
||||
HDC_1000_SENSOR_TYPE_TEMP,
|
||||
|
@ -40,7 +40,8 @@
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
#include "sys/rtimer.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "mpu-9250-sensor.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <Board.h>
|
||||
@ -63,6 +64,13 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Disable the entire file if sensors are disabled, as it could potentially
|
||||
* create compile errors with missing defines from either the Board file or
|
||||
* configuration defines.
|
||||
*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef Board_MPU9250_ADDR
|
||||
# error "Board file doesn't define I2C address Board_MPU9250_ADDR"
|
||||
#endif
|
||||
@ -648,4 +656,6 @@ status(int type)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(mpu_9250_sensor, "MPU9250", value, configure, status);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_SENSORS_ENABLE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -75,9 +75,13 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
#if (TI_I2C_CONF_ENABLE == 0) || (TI_I2C_CONF_I2C0_ENABLE == 0)
|
||||
# error "The MPU-9250 requires the I2C driver (TI_I2C_CONF_ENABLE = 1)"
|
||||
#endif
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define MPU_9250_READING_ERROR -1
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -40,7 +40,8 @@
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
#include "sys/ctimer.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "opt-3001-sensor.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <Board.h>
|
||||
@ -59,6 +60,13 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Disable the entire file if sensors are disabled, as it could potentially
|
||||
* create compile errors with missing defines from either the Board file or
|
||||
* configuration defines.
|
||||
*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef Board_OPT3001_ADDR
|
||||
# error "Board file doesn't define I2C address Board_OPT3001_ADDR"
|
||||
#endif
|
||||
@ -365,4 +373,6 @@ status(int type)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(opt_3001_sensor, "OPT3001", value, configure, status);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_SENSORS_ENABLE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -63,9 +63,13 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
#if (TI_I2C_CONF_ENABLE == 0) || (TI_I2C_CONF_I2C0_ENABLE == 0)
|
||||
# error "The OPT-3001 requires the I2C driver (TI_I2C_CONF_ENABLE = 1)"
|
||||
#endif
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define OPT_3001_READING_ERROR -1
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
@ -39,10 +39,13 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "board-peripherals.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Exports a global symbol to be used by the sensor API */
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
SENSORS(&bmp_280_sensor, &tmp_007_sensor, &opt_3001_sensor, &hdc_1000_sensor, &mpu_9250_sensor);
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -40,7 +40,8 @@
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
#include "sys/ctimer.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "tmp-007-sensor.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include <Board.h>
|
||||
@ -59,6 +60,13 @@
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*
|
||||
* Disable the entire file if sensors are disabled, as it could potentially
|
||||
* create compile errors with missing defines from either the Board file or
|
||||
* configuration defines.
|
||||
*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Slave address */
|
||||
#ifndef Board_TMP_ADDR
|
||||
# error "Board file doesn't define I2C address Board_TMP_ADDR"
|
||||
@ -409,4 +417,6 @@ status(int type)
|
||||
/*---------------------------------------------------------------------------*/
|
||||
SENSORS_SENSOR(tmp_007_sensor, "TMP-007", value, configure, status);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_SENSORS_ENABLE */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
@ -68,9 +68,13 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
#if (TI_I2C_CONF_ENABLE == 0) || (TI_I2C_CONF_I2C0_ENABLE == 0)
|
||||
# error "The BMP280 requires the I2C driver to be enabled (TI_I2C_CONF_ENABLE = 1)"
|
||||
#endif
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
typedef enum {
|
||||
TMP_007_TYPE_OBJECT = (1 << 0),
|
||||
|
@ -80,6 +80,15 @@
|
||||
#define BOARD_CONF_HAS_SENSORS 1
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name Enable or disable the SmartRF06EB sensors.
|
||||
*
|
||||
* Those values are not meant to be modified by the user
|
||||
* @{
|
||||
*/
|
||||
#define BOARD_SENSORS_ENABLE (!(BOARD_CONF_SENSORS_DISABLE))
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* BOARD_CONF_H_ */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
|
@ -39,10 +39,13 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
#include "lib/sensors.h"
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "board-conf.h"
|
||||
#include "board-peripherals.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Exports a global symbol to be used by the sensor API */
|
||||
#if BOARD_SENSORS_ENABLE
|
||||
SENSORS(&als_sensor);
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/** @} */
|
||||
|
Loading…
Reference in New Issue
Block a user