Allow custom frequency bands (+ some TI radio tweak options)

* Add DOT_15_4G_FREQUENCY_BAND_CUSTOM for configuring non-standard frequency band
* Add option to tweak some timer settings
This commit is contained in:
Olav Frengstad 2018-05-03 17:00:07 +02:00
parent e8286f46c9
commit d17566aaef
2 changed files with 51 additions and 14 deletions

View File

@ -78,9 +78,17 @@
#define IEEE802154_CONF_DEFAULT_CHANNEL 0 #define IEEE802154_CONF_DEFAULT_CHANNEL 0
#endif /* IEEE802154_CONF_DEFAULT_CHANNEL */ #endif /* IEEE802154_CONF_DEFAULT_CHANNEL */
#ifndef CSMA_CONF_ACK_WAIT_TIME
#define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 400) #define CSMA_CONF_ACK_WAIT_TIME (RTIMER_SECOND / 400)
#endif /* CSMA_CONF_ACK_WAIT_TIME */
#ifndef CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME
#define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1000) #define CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME (RTIMER_SECOND / 1000)
#endif /* CSMA_CONF_AFTER_ACK_DETECTED_WAIT_TIME */
#ifndef CSMA_CONF_SEND_SOFT_ACK
#define CSMA_CONF_SEND_SOFT_ACK 1 #define CSMA_CONF_SEND_SOFT_ACK 1
#endif /* CSMA_CONF_SEND_SOFT_ACK */
#else /* CC13XX_CONF_PROP_MODE */ #else /* CC13XX_CONF_PROP_MODE */
#ifndef NETSTACK_CONF_RADIO #ifndef NETSTACK_CONF_RADIO

View File

@ -49,20 +49,21 @@
#include "driverlib/rf_mailbox.h" #include "driverlib/rf_mailbox.h"
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* IEEE 802.15.4g frequency band identifiers (Table 68f) */ /* IEEE 802.15.4g frequency band identifiers (Table 68f) */
#define DOT_15_4G_FREQUENCY_BAND_169 0 /* 169.400169.475 (Europe) - 169 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_169 0 /* 169.400169.475 (Europe) - 169 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_450 1 /* 450470 (US FCC Part 22/90) - 450 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_450 1 /* 450470 (US FCC Part 22/90) - 450 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_470 2 /* 470510 (China) - 470 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_470 2 /* 470510 (China) - 470 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_780 3 /* 779787 (China) - 780 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_780 3 /* 779787 (China) - 780 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_863 4 /* 863870 (Europe) - 863 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_863 4 /* 863870 (Europe) - 863 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_896 5 /* 896901 (US FCC Part 90) - 896 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_896 5 /* 896901 (US FCC Part 90) - 896 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_901 6 /* 901902 (US FCC Part 24) - 901 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_901 6 /* 901902 (US FCC Part 24) - 901 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_915 7 /* 902928 (US) - 915 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_915 7 /* 902928 (US) - 915 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_917 8 /* 917923.5 (Korea) - 917 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_917 8 /* 917923.5 (Korea) - 917 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_920 9 /* 920928 (Japan) - 920 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_920 9 /* 920928 (Japan) - 920 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_928 10 /* 928960 (US, non-contiguous) - 928 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_928 10 /* 928960 (US, non-contiguous) - 928 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_950 11 /* 950958 (Japan) - 950 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_950 11 /* 950958 (Japan) - 950 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_1427 12 /* 14271518 (US and Canada, non-contiguous) - 1427 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_1427 12 /* 14271518 (US and Canada, non-contiguous) - 1427 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_2450 13 /* 24002483.5 2450 MHz band */ #define DOT_15_4G_FREQUENCY_BAND_2450 13 /* 24002483.5 2450 MHz band */
#define DOT_15_4G_FREQUENCY_BAND_CUSTOM 14 /* For use with custom frequency band settings */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Default band selection to band 4 - 863MHz */ /* Default band selection to band 4 - 863MHz */
#ifdef DOT_15_4G_CONF_FREQUENCY_BAND_ID #ifdef DOT_15_4G_CONF_FREQUENCY_BAND_ID
@ -77,6 +78,18 @@
* bands we only support operating mode #1 (Table 134). * bands we only support operating mode #1 (Table 134).
* *
* DOT_15_4G_CHAN0_FREQUENCY is specified here in KHz * DOT_15_4G_CHAN0_FREQUENCY is specified here in KHz
*
* Custom bands and configuration can be used with DOT_15_4G_FREQUENCY_BAND_CUSTOM.
*
* Example of custom setup for the 868Mhz sub-band in Europe with 11 channels,
* center frequency at 868.050MHz and channel spacing at 100KHz.
* These should be put in project-config.h or similar.
*
* #define DOT_15_4G_FREQUENCY_BAND_ID DOT_15_4G_FREQUENCY_BAND_CUSTOM
* #define DOT_15_4G_CHAN0_FREQUENCY 868050
* #define DOT_15_4G_CHANNEL_SPACING 100
* #define DOT_15_4G_CHANNEL_MAX 11
* #define PROP_MODE_CONF_LO_DIVIDER 0x05
*/ */
#if DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_470 #if DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_470
#define DOT_15_4G_CHANNEL_MAX 198 #define DOT_15_4G_CHANNEL_MAX 198
@ -116,6 +129,22 @@
#define DOT_15_4G_CHAN0_FREQUENCY 951000 #define DOT_15_4G_CHAN0_FREQUENCY 951000
#define PROP_MODE_CONF_LO_DIVIDER 0x05 #define PROP_MODE_CONF_LO_DIVIDER 0x05
#elif DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_CUSTOM
#ifndef DOT_15_4G_CHANNEL_MAX
#error DOT_15_4G_CHANNEL_MAX must be manually set when using custom frequency band
#endif
#ifndef DOT_15_4G_CHANNEL_SPACING
#error DOT_15_4G_CHANNEL_SPACING must be manually set when using custom frequency band
#endif
#ifndef DOT_15_4G_CHAN0_FREQUENCY
#error DOT_15_4G_CHAN0_FREQUENCY must be manually set when using custom frequency band
#endif
#ifndef PROP_MODE_CONF_LO_DIVIDER
#error PROP_MODE_CONF_LO_DIVIDER must be manually set when using custom frequency band
#endif
#else #else
#error The selected frequency band is not supported #error The selected frequency band is not supported
#endif #endif