mirror of
https://github.com/thelsing/knx.git
synced 2026-03-07 02:17:30 +01:00
Start cleanup
This commit is contained in:
@@ -166,8 +166,6 @@ set(${PROJECT_NAME}_SOURCES
|
||||
./RTT/SEGGER_RTT.c
|
||||
./RTT/SEGGER_RTT.h
|
||||
./RTT/SEGGER_RTT_ASM_ARMv7M.S
|
||||
./RFQueue.c
|
||||
./RFQueue.h
|
||||
./smartrf_settings/smartrf_settings.c
|
||||
./smartrf_settings/smartrf_settings.h
|
||||
./CC1310_LAUNCHXL_fxns.c
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Filename: rf_queue.c
|
||||
* Revised: $ $
|
||||
* Revision: $ $
|
||||
*
|
||||
* Description: Help functions for handling queues
|
||||
*
|
||||
* Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
/* Standard C Libraries */
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Application Header files */
|
||||
#include "RFQueue.h"
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#include DeviceFamily_constructPath(driverlib/rf_data_entry.h)
|
||||
|
||||
/* Receive entry pointer to keep track of read items */
|
||||
rfc_dataEntryGeneral_t* readEntry;
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! Get the current dataEntry
|
||||
//!
|
||||
//! \return rfc_dataEntry*
|
||||
//
|
||||
//*****************************************************************************
|
||||
rfc_dataEntryGeneral_t*
|
||||
RFQueue_getDataEntry()
|
||||
{
|
||||
return (readEntry);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! Move to next dataEntry
|
||||
//!
|
||||
//! \return None
|
||||
//
|
||||
//*****************************************************************************
|
||||
uint8_t
|
||||
RFQueue_nextEntry()
|
||||
{
|
||||
/* Set status to pending */
|
||||
readEntry->status = DATA_ENTRY_PENDING;
|
||||
|
||||
/* Move read entry pointer to next entry */
|
||||
readEntry = (rfc_dataEntryGeneral_t*)readEntry->pNextEntry;
|
||||
|
||||
return (readEntry->status);
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! Define a queue
|
||||
//!
|
||||
//! \param dataQueue is a pointer to the queue to use
|
||||
//! \param buf is the prealocated byte buffer to use
|
||||
//! \param buf_len is the number of preallocated bytes
|
||||
//! \param numEntries are the number of dataEntries to split the buffer into
|
||||
//! \param length is the length of data in every dataEntry
|
||||
//!
|
||||
//! \return uint8_t
|
||||
//
|
||||
//*****************************************************************************
|
||||
uint8_t
|
||||
RFQueue_defineQueue(dataQueue_t *dataQueue, uint8_t *buf, uint16_t buf_len, uint8_t numEntries, uint16_t length)
|
||||
{
|
||||
|
||||
if (buf_len < (numEntries * (length + RF_QUEUE_DATA_ENTRY_HEADER_SIZE + RF_QUEUE_QUEUE_ALIGN_PADDING(length))))
|
||||
{
|
||||
/* queue does not fit into buffer */
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* Padding needed for 4-byte alignment? */
|
||||
uint8_t pad = 4-((length + RF_QUEUE_DATA_ENTRY_HEADER_SIZE)%4);
|
||||
|
||||
/* Set the Data Entries common configuration */
|
||||
uint8_t *first_entry = buf;
|
||||
int i;
|
||||
for (i = 0; i < numEntries; i++)
|
||||
{
|
||||
buf = first_entry + i * (RF_QUEUE_DATA_ENTRY_HEADER_SIZE + length + pad);
|
||||
((rfc_dataEntry_t*)buf)->status = DATA_ENTRY_PENDING; // Pending - starting state
|
||||
((rfc_dataEntry_t*)buf)->config.type = DATA_ENTRY_TYPE_GEN; // General Data Entry
|
||||
((rfc_dataEntry_t*)buf)->config.lenSz = 0; // No length indicator byte in data
|
||||
((rfc_dataEntry_t*)buf)->length = length; // Total length of data field
|
||||
|
||||
((rfc_dataEntryGeneral_t*)buf)->pNextEntry = &(((rfc_dataEntryGeneral_t*)buf)->data)+length+pad;
|
||||
}
|
||||
/* Make circular Last.Next -> First */
|
||||
((rfc_dataEntry_t*)buf)->pNextEntry = first_entry;
|
||||
|
||||
/* Create Data Entry Queue and configure for circular buffer Data Entries */
|
||||
dataQueue->pCurrEntry = first_entry;
|
||||
dataQueue->pLastEntry = NULL;
|
||||
|
||||
/* Set read pointer to first entry */
|
||||
readEntry = (rfc_dataEntryGeneral_t*)first_entry;
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
/******************************************************************************
|
||||
* Filename: rf_queue.h
|
||||
* Revised: $ $
|
||||
* Revision: $ $
|
||||
*
|
||||
* Description: Help functions for handling queues
|
||||
*
|
||||
* Copyright (C) 2015-2017 Texas Instruments Incorporated - http://www.ti.com/
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! \addtogroup rfqueue_api
|
||||
//! @{
|
||||
//
|
||||
//*****************************************************************************
|
||||
|
||||
#ifndef RF_QUEUE_H
|
||||
#define RF_QUEUE_H
|
||||
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#include DeviceFamily_constructPath(driverlib/rf_data_entry.h)
|
||||
|
||||
#define RF_QUEUE_DATA_ENTRY_HEADER_SIZE 8 // Contant header size of a Generic Data Entry
|
||||
|
||||
#define RF_QUEUE_QUEUE_ALIGN_PADDING(length) (4-((length + RF_QUEUE_DATA_ENTRY_HEADER_SIZE)%4)) // Padding offset
|
||||
|
||||
#define RF_QUEUE_DATA_ENTRY_BUFFER_SIZE(numEntries, dataSize, appendedBytes) \
|
||||
(numEntries*(RF_QUEUE_DATA_ENTRY_HEADER_SIZE + dataSize + appendedBytes + RF_QUEUE_QUEUE_ALIGN_PADDING(dataSize + appendedBytes)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern uint8_t RFQueue_nextEntry();
|
||||
extern rfc_dataEntryGeneral_t* RFQueue_getDataEntry();
|
||||
extern uint8_t RFQueue_defineQueue(dataQueue_t *queue ,uint8_t *buf, uint16_t buf_len, uint8_t numEntries, uint16_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//*****************************************************************************
|
||||
//
|
||||
//! Close the Doxygen group.
|
||||
//! @}
|
||||
//
|
||||
//*****************************************************************************
|
||||
@@ -5,23 +5,20 @@
|
||||
//
|
||||
//*********************************************************************************
|
||||
|
||||
|
||||
//*********************************************************************************
|
||||
// Parameter summary
|
||||
// Address: off
|
||||
// Address0: 0xAA
|
||||
// Address1: 0xBB
|
||||
// Address: on
|
||||
// Address0: 0x44FF
|
||||
// Frequency: 868.29999 MHz
|
||||
// Data Format: Serial mode disable
|
||||
// Deviation: 50.000 kHz
|
||||
// Packet Length Config: Variable
|
||||
// Max Packet Length: 128
|
||||
// Packet Length: 20
|
||||
// Max Packet Length: unlimited packet length mode
|
||||
// RX Filter BW: 196 kHz
|
||||
// Symbol Rate: 32.76825 kBaud
|
||||
// Sync Word Length: 24 Bits
|
||||
// TX Power: 14 dBm (requires define CCFG_FORCE_VDDR_HH = 1 in ccfg.c, see CC13xx/CC26xx Technical Reference Manual)
|
||||
// Whitening: No whitening
|
||||
// FEC mode: manchester code
|
||||
|
||||
#include <ti/devices/DeviceFamily.h>
|
||||
#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
|
||||
@@ -182,47 +179,6 @@ rfc_CMD_PROP_TX_t RF_cmdPropTx =
|
||||
.pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
|
||||
};
|
||||
|
||||
// CMD_PROP_RX
|
||||
rfc_CMD_PROP_RX_t RF_cmdPropRx =
|
||||
{
|
||||
.commandNo = 0x3802,
|
||||
.status = 0x0000,
|
||||
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
|
||||
.startTime = 0x00000000,
|
||||
.startTrigger.triggerType = 0x0,
|
||||
.startTrigger.bEnaCmd = 0x0,
|
||||
.startTrigger.triggerNo = 0x0,
|
||||
.startTrigger.pastTrig = 0x0,
|
||||
.condition.rule = 0x1,
|
||||
.condition.nSkip = 0x0,
|
||||
.pktConf.bFsOff = 0x0,
|
||||
.pktConf.bRepeatOk = 0x0,
|
||||
.pktConf.bRepeatNok = 0x0,
|
||||
.pktConf.bUseCrc = 0x1,
|
||||
.pktConf.bVarLen = 0x1,
|
||||
.pktConf.bChkAddress = 0x0,
|
||||
.pktConf.endType = 0x0,
|
||||
.pktConf.filterOp = 0x0,
|
||||
.rxConf.bAutoFlushIgnored = 0x0,
|
||||
.rxConf.bAutoFlushCrcErr = 0x0,
|
||||
.rxConf.bIncludeHdr = 0x1,
|
||||
.rxConf.bIncludeCrc = 0x0,
|
||||
.rxConf.bAppendRssi = 0x0,
|
||||
.rxConf.bAppendTimestamp = 0x0,
|
||||
.rxConf.bAppendStatus = 0x1,
|
||||
.syncWord = 0x547696,
|
||||
.maxPktLen = 0x80, // MAKE SURE DATA ENTRY IS LARGE ENOUGH
|
||||
.address0 = 0xAA,
|
||||
.address1 = 0xBB,
|
||||
.endTrigger.triggerType = 0x1,
|
||||
.endTrigger.bEnaCmd = 0x0,
|
||||
.endTrigger.triggerNo = 0x0,
|
||||
.endTrigger.pastTrig = 0x0,
|
||||
.endTime = 0x00000000,
|
||||
.pQueue = 0, // INSERT APPLICABLE POINTER: (dataQueue_t*)&xxx
|
||||
.pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
|
||||
};
|
||||
|
||||
// CMD_PROP_RX_ADV
|
||||
rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv =
|
||||
{
|
||||
@@ -239,11 +195,11 @@ rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv =
|
||||
.pktConf.bFsOff = 0x0,
|
||||
.pktConf.bRepeatOk = 0x0,
|
||||
.pktConf.bRepeatNok = 0x0,
|
||||
.pktConf.bUseCrc = 0x0,
|
||||
.pktConf.bUseCrc = 0x0, // CRC engine cannot be used
|
||||
.pktConf.bCrcIncSw = 0x0,
|
||||
.pktConf.bCrcIncHdr = 0x1,
|
||||
.pktConf.endType = 0x0,
|
||||
.pktConf.filterOp = 0x1,
|
||||
.pktConf.filterOp = 0x0,
|
||||
.rxConf.bAutoFlushIgnored = 0x0,
|
||||
.rxConf.bAutoFlushCrcErr = 0x0,
|
||||
.rxConf.bIncludeHdr = 0x1,
|
||||
@@ -251,16 +207,16 @@ rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv =
|
||||
.rxConf.bAppendRssi = 0x0,
|
||||
.rxConf.bAppendTimestamp = 0x0,
|
||||
.rxConf.bAppendStatus = 0x0,
|
||||
.syncWord0 = 0x547696,
|
||||
.syncWord0 = 0x547696, // KNX-RF syncword
|
||||
.syncWord1 = 0,
|
||||
.maxPktLen = 0,
|
||||
.hdrConf.numHdrBits = 8,
|
||||
.hdrConf.numHdrBits = 8, // One length byte in header
|
||||
.hdrConf.lenPos = 0,
|
||||
.hdrConf.numLenBits = 8,
|
||||
.addrConf.addrType = 0,
|
||||
.addrConf.addrSize = 0,
|
||||
.hdrConf.numLenBits = 8, // Header length is just the length byte
|
||||
.addrConf.addrType = 0, // Address bytes AFTER header
|
||||
.addrConf.addrSize = 2, // use the two fixed bytes (0x44 and 0xff) after the length byte as address bytes
|
||||
.addrConf.addrPos = 0,
|
||||
.addrConf.numAddr = 1,
|
||||
.addrConf.numAddr = 1, // just the two fixed bytes are used as one address
|
||||
.lenOffset = 0,
|
||||
.endTrigger.triggerType = 0x1,
|
||||
.endTrigger.bEnaCmd = 0x0,
|
||||
@@ -272,29 +228,30 @@ rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv =
|
||||
.pOutput = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
|
||||
};
|
||||
|
||||
// CMD_TX_TEST
|
||||
rfc_CMD_TX_TEST_t RF_cmdTxTest =
|
||||
{
|
||||
.commandNo = 0x0808,
|
||||
.status = 0x0000,
|
||||
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
|
||||
.startTime = 0x00000000,
|
||||
.startTrigger.triggerType = 0x0,
|
||||
.startTrigger.bEnaCmd = 0x0,
|
||||
.startTrigger.triggerNo = 0x0,
|
||||
.startTrigger.pastTrig = 0x0,
|
||||
.condition.rule = 0x1,
|
||||
.condition.nSkip = 0x0,
|
||||
.config.bUseCw = 0x0,
|
||||
.config.bFsOff = 0x1,
|
||||
.config.whitenMode = 0x2,
|
||||
.__dummy0 = 0x00,
|
||||
.txWord = 0xABCD,
|
||||
.__dummy1 = 0x00,
|
||||
.endTrigger.triggerType = 0x1,
|
||||
.endTrigger.bEnaCmd = 0x0,
|
||||
.endTrigger.triggerNo = 0x0,
|
||||
.endTrigger.pastTrig = 0x0,
|
||||
.syncWord = 0x930B51DE,
|
||||
.endTime = 0x00000000,
|
||||
// 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.
|
||||
const RF_TxPowerTable_Entry PROP_RF_txPowerTable[] =
|
||||
{
|
||||
{-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) },
|
||||
{13, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 0, 83) }, // The original PA value (12.5 dBm) have been rounded to an integer value.
|
||||
{14, RF_TxPowerTable_DEFAULT_PA_ENTRY(63, 0, 1, 83) }, // This setting requires CCFG_FORCE_VDDR_HH = 1.
|
||||
RF_TxPowerTable_TERMINATION_ENTRY
|
||||
};
|
||||
|
||||
const uint8_t PROP_RF_txPowerTableSize = sizeof(PROP_RF_txPowerTable)/sizeof(RF_TxPowerTable_Entry);
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include DeviceFamily_constructPath(driverlib/rf_prop_cmd.h)
|
||||
#include <ti/drivers/rf/RF.h>
|
||||
|
||||
// RF Core TX power
|
||||
extern const RF_TxPowerTable_Entry PROP_RF_txPowerTable[];
|
||||
extern const uint8_t PROP_RF_txPowerTableSize;
|
||||
|
||||
// TI-RTOS RF Mode Object
|
||||
extern RF_Mode RF_prop;
|
||||
|
||||
@@ -21,8 +25,6 @@ extern RF_Mode RF_prop;
|
||||
extern rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup;
|
||||
extern rfc_CMD_FS_t RF_cmdFs;
|
||||
extern rfc_CMD_PROP_TX_t RF_cmdPropTx;
|
||||
extern rfc_CMD_PROP_RX_t RF_cmdPropRx;
|
||||
extern rfc_CMD_PROP_RX_ADV_t RF_pCmdPropRxAdv;
|
||||
extern rfc_CMD_TX_TEST_t RF_cmdTxTest;
|
||||
extern rfc_CMD_PROP_RX_ADV_t RF_cmdPropRxAdv;
|
||||
|
||||
#endif // _SMARTRF_SETTINGS_H_
|
||||
|
||||
Reference in New Issue
Block a user