nes-proj/arch/cpu/cc13xx-cc26xx/dev/dot-15-4g.h

159 lines
6.8 KiB
C
Raw Normal View History

2018-02-09 11:50:55 +00:00
/*
* Copyright (c) 2015, 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 rf-core
* @{
*
* \defgroup rf-core-15-4g-modes IEEE 802.15.4g Frequency Bands and Modes
*
* @{
*
* \file
* Header file with descriptors for the various modes of operation defined in
* IEEE 802.15.4g
*/
/*---------------------------------------------------------------------------*/
#ifndef DOT_15_4G_H_
#define DOT_15_4G_H_
/*---------------------------------------------------------------------------*/
#include "contiki.h"
2018-07-13 12:34:08 +00:00
#include <ti/devices/DeviceFamily.h>
#include DeviceFamily_constructPath(driverlib/rf_mailbox.h)
2018-02-09 11:50:55 +00:00
/*---------------------------------------------------------------------------*/
/* IEEE 802.15.4g frequency band identifiers (Table 68f) */
2018-07-13 12:34:08 +00:00
#define DOT_15_4G_FREQ_BAND_169 0 /* 169.400169.475 (Europe) - 169 MHz band */
#define DOT_15_4G_FREQ_BAND_450 1 /* 450470 (US FCC Part 22/90) - 450 MHz band */
#define DOT_15_4G_FREQ_BAND_470 2 /* 470510 (China) - 470 MHz band */
#define DOT_15_4G_FREQ_BAND_780 3 /* 779787 (China) - 780 MHz band */
#define DOT_15_4G_FREQ_BAND_863 4 /* 863870 (Europe) - 863 MHz band */
#define DOT_15_4G_FREQ_BAND_896 5 /* 896901 (US FCC Part 90) - 896 MHz band */
#define DOT_15_4G_FREQ_BAND_901 6 /* 901902 (US FCC Part 24) - 901 MHz band */
#define DOT_15_4G_FREQ_BAND_915 7 /* 902928 (US) - 915 MHz band */
#define DOT_15_4G_FREQ_BAND_917 8 /* 917923.5 (Korea) - 917 MHz band */
#define DOT_15_4G_FREQ_BAND_920 9 /* 920928 (Japan) - 920 MHz band */
#define DOT_15_4G_FREQ_BAND_928 10 /* 928960 (US, non-contiguous) - 928 MHz band */
#define DOT_15_4G_FREQ_BAND_950 11 /* 950958 (Japan) - 950 MHz band */
#define DOT_15_4G_FREQ_BAND_1427 12 /* 14271518 (US and Canada, non-contiguous) - 1427 MHz band */
#define DOT_15_4G_FREQ_BAND_2450 13 /* 24002483.5 2450 MHz band */
2018-02-09 11:50:55 +00:00
/*---------------------------------------------------------------------------*/
/* Default band selection to band 4 - 863MHz */
2018-07-13 12:34:08 +00:00
#ifdef DOT_15_4G_CONF_FREQ_BAND_ID
# define DOT_15_4G_FREQ_BAND_ID DOT_15_4G_CONF_FREQ_BAND_ID
2018-02-09 11:50:55 +00:00
#else
2018-07-13 12:34:08 +00:00
# define DOT_15_4G_FREQ_BAND_ID DOT_15_4G_FREQ_BAND_863
2018-02-09 11:50:55 +00:00
#endif
/*---------------------------------------------------------------------------*/
/*
* Channel count, spacing and other params relating to the selected band. We
* currently only support some of the bands defined in .15.4g and for those
* bands we only support operating mode #1 (Table 134).
*
2018-07-13 12:34:08 +00:00
* DOT_15_4G_CHAN0_FREQ is specified here in KHz
2018-02-09 11:50:55 +00:00
*/
2018-07-13 12:34:08 +00:00
#if DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_470
# define DOT_15_4G_CHAN_MIN 0
# define DOT_15_4G_CHAN_MAX 198
# define DOT_15_4G_FREQ_SPACING 200
# define DOT_15_4G_CHAN0_FREQ 470200
2018-02-09 11:50:55 +00:00
2018-07-13 12:34:08 +00:00
# define PROP_MODE_CONF_LO_DIVIDER 0x0A
2018-02-09 11:50:55 +00:00
2018-07-13 12:34:08 +00:00
#elif DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_780
# define DOT_15_4G_CHAN_MIN 0
# define DOT_15_4G_CHAN_MAX 38
# define DOT_15_4G_FREQ_SPACING 200
# define DOT_15_4G_CHAN0_FREQ 779200
2018-02-09 11:50:55 +00:00
2018-07-13 12:34:08 +00:00
# define PROP_MODE_CONF_LO_DIVIDER 0x06
2018-02-09 11:50:55 +00:00
2018-07-13 12:34:08 +00:00
#elif DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_863
# define DOT_15_4G_CHAN_MIN 0
# define DOT_15_4G_CHAN_MAX 33
# define DOT_15_4G_FREQ_SPACING 200
# define DOT_15_4G_CHAN0_FREQ 863125
2018-02-09 11:50:55 +00:00
2018-07-13 12:34:08 +00:00
# define PROP_MODE_CONF_LO_DIVIDER 0x05
#elif DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_915
# define DOT_15_4G_CHAN_MIN 0
# define DOT_15_4G_CHAN_MAX 128
# define DOT_15_4G_FREQ_SPACING 200
# define DOT_15_4G_CHAN0_FREQ 902200
# define PROP_MODE_CONF_LO_DIVIDER 0x05
#elif DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_920
# define DOT_15_4G_CHAN_MIN 0
# define DOT_15_4G_CHAN_MAX 37
# define DOT_15_4G_FREQ_SPACING 200
# define DOT_15_4G_CHAN0_FREQ 920600
# define PROP_MODE_CONF_LO_DIVIDER 0x05
#elif DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_950
# define DOT_15_4G_CHAN_MIN 0
# define DOT_15_4G_CHAN_MAX 32
# define DOT_15_4G_FREQ_SPACING 200
# define DOT_15_4G_CHAN0_FREQ 951000
# define PROP_MODE_CONF_LO_DIVIDER 0x05
#elif DOT_15_4G_FREQ_BAND_ID==DOT_15_4G_FREQ_BAND_2450
# define DOT_15_4G_CHAN_MIN 11
# define DOT_15_4G_CHAN_MAX 26
# define DOT_15_4G_FREQ_SPACING 5000
# define DOT_15_4G_CHAN0_FREQ 2405000
2018-02-09 11:50:55 +00:00
#else
2018-07-13 12:34:08 +00:00
# error The selected IEEE 802.15.4g frequency band is not supported
2018-02-09 11:50:55 +00:00
#endif
/*---------------------------------------------------------------------------*/
2018-07-13 12:34:08 +00:00
#define DOT_15_4_G_FREQ(chan) \
(DOT_15_4G_CHAN0_FREQ + DOT_15_4G_FREQ_SPACING * ((chan) - DOT_15_4G_CHAN_MIN))
#define DOT_15_4_G_CHAN_IN_RANGE(chan) \
(((chan) >= DOT_15_4G_CHAN_MIN) && ((chan) <= DOT_15_4G_CHAN_MAX))
2018-07-09 18:13:01 +00:00
/*---------------------------------------------------------------------------*/
2018-07-13 17:09:02 +00:00
#define DOT_15_4_G_DEFAULT_CHAN IEEE802154_DEFAULT_CHANNEL
/* Sanity check default channel */
#if !(DOT_15_4_G_CHAN_IN_RANGE(DOT_15_4_G_DEFAULT_CHAN))
# error IEEE802154_DEFAULT_CHANNEL is not in valid channel range
#endif
/*---------------------------------------------------------------------------*/
2018-02-09 11:50:55 +00:00
#endif /* DOT_15_4G_H_ */
/*---------------------------------------------------------------------------*/
/**
* @}
* @}
*/