[efr32] enable BRD4170A to support 915MHz and 2.4GHz by default (#3664)

This commit is contained in:
Zhanglong Xia
2019-03-14 09:44:35 -07:00
committed by Jonathan Hui
parent dea08b2db7
commit 1af2933449
7 changed files with 34 additions and 21 deletions
@@ -35,6 +35,6 @@
#ifndef __BOARD_CONFIG_H__
#define __BOARD_CONFIG_H__
#define RADIO_SUPPORT_2P4GHZ_OQPSK 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#endif // __BOARD_CONFIG_H__
@@ -35,6 +35,6 @@
#ifndef __BOARD_CONFIG_H__
#define __BOARD_CONFIG_H__
#define RADIO_SUPPORT_2P4GHZ_OQPSK 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#endif // __BOARD_CONFIG_H__
@@ -35,7 +35,7 @@
#ifndef __BOARD_CONFIG_H__
#define __BOARD_CONFIG_H__
#define RADIO_SUPPORT_2P4GHZ_OQPSK 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#define RADIO_SUPPORT_915MHZ_OQPSK 1 ///< Dev board suppports OQPSK modulation in 915MHz band.
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#define RADIO_CONFIG_915MHZ_OQPSK_SUPPORT 1 ///< Dev board suppports OQPSK modulation in 915MHz band.
#endif // __BOARD_CONFIG_H__
@@ -35,6 +35,6 @@
#ifndef __BOARD_CONFIG_H__
#define __BOARD_CONFIG_H__
#define RADIO_SUPPORT_2P4GHZ_OQPSK 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#define RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT 1 ///< Dev board suppports OQPSK modulation in 2.4GHz band.
#endif // __BOARD_CONFIG_H__
@@ -32,6 +32,7 @@
* for OpenThread.
*/
#include "board_config.h"
#include "em_msc.h"
#ifndef OPENTHREAD_CORE_EFR32_CONFIG_H_
@@ -46,6 +47,26 @@
#define OPENTHREAD_CONFIG_LOG_OUTPUT OPENTHREAD_CONFIG_LOG_OUTPUT_PLATFORM_DEFINED
#endif
/*
* @def OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT
*
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 915MHz band.
*
*/
#ifdef RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
#define OPENTHREAD_CONFIG_RADIO_915MHZ_OQPSK_SUPPORT 1
#endif
/*
* @def OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT
*
* Define to 1 if you want to enable physical layer to support OQPSK modulation in 2.4GHz band.
*
*/
#ifdef RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
#define OPENTHREAD_CONFIG_RADIO_2P4GHZ_OQPSK_SUPPORT 1
#endif
/**
* @def OPENTHREAD_CONFIG_PLATFORM_INFO
*
+7 -15
View File
@@ -64,14 +64,6 @@ enum
IEEE802154_DSN_OFFSET = 2,
};
enum
{
EFR32_915MHZ_OQPSK_CHANNEL_MIN = 1,
EFR32_915MHZ_OQPSK_CHANNEL_MAX = 10,
EFR32_2P4GHZ_OQPSK_CHANNEL_MIN = 11,
EFR32_2P4GHZ_OQPSK_CHANNEL_MAX = 26,
};
enum
{
EFR32_RECEIVE_SENSITIVITY = -100, // dBm
@@ -88,7 +80,7 @@ enum
enum
{
#if RADIO_SUPPORT_2P4GHZ_OQPSK && RADIO_SUPPORT_915MHZ_OQPSK
#if RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT && RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
EFR32_NUM_BAND_CONFIGS = 2,
#else
EFR32_NUM_BAND_CONFIGS = 1,
@@ -278,25 +270,25 @@ void efr32BandConfigInit(void (*aEventCallback)(RAIL_Handle_t railHandle, RAIL_E
{
uint8_t index = 0;
#if RADIO_SUPPORT_2P4GHZ_OQPSK
#if RADIO_CONFIG_2P4GHZ_OQPSK_SUPPORT
sBandConfigs[index].mRailConfig.eventsCallback = aEventCallback;
sBandConfigs[index].mRailConfig.protocol = NULL;
sBandConfigs[index].mRailConfig.scheduler = &sBandConfigs[index].mRailSchedState;
sBandConfigs[index].mChannelConfig = NULL;
sBandConfigs[index].mChannelMin = EFR32_2P4GHZ_OQPSK_CHANNEL_MIN;
sBandConfigs[index].mChannelMax = EFR32_2P4GHZ_OQPSK_CHANNEL_MAX;
sBandConfigs[index].mChannelMin = OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MIN;
sBandConfigs[index].mChannelMax = OT_RADIO_2P4GHZ_OQPSK_CHANNEL_MAX;
assert((sBandConfigs[index].mRailHandle = efr32RailConfigInit(&sBandConfigs[index])) != NULL);
index++;
#endif
#if RADIO_SUPPORT_915MHZ_OQPSK
#if RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
sBandConfigs[index].mRailConfig.eventsCallback = aEventCallback;
sBandConfigs[index].mRailConfig.protocol = NULL;
sBandConfigs[index].mRailConfig.scheduler = &sBandConfigs[index].mRailSchedState;
sBandConfigs[index].mChannelConfig = channelConfigs[0];
sBandConfigs[index].mChannelMin = EFR32_915MHZ_OQPSK_CHANNEL_MIN;
sBandConfigs[index].mChannelMax = EFR32_915MHZ_OQPSK_CHANNEL_MAX;
sBandConfigs[index].mChannelMin = OT_RADIO_915MHZ_OQPSK_CHANNEL_MIN;
sBandConfigs[index].mChannelMax = OT_RADIO_915MHZ_OQPSK_CHANNEL_MAX;
assert((sBandConfigs[index].mRailHandle = efr32RailConfigInit(&sBandConfigs[index])) != NULL);
#endif
+1 -1
View File
@@ -7,7 +7,7 @@
#define RADIO_CONFIG_XTAL_FREQUENCY 38400000UL
#if RADIO_SUPPORT_915MHZ_OQPSK
#if RADIO_CONFIG_915MHZ_OQPSK_SUPPORT
extern const RAIL_ChannelConfig_t *channelConfigs[];
#endif