From 6b2bfe18e94d878aad399a8298872e965edd21e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Thu, 5 Oct 2017 15:14:41 +0200 Subject: [PATCH 1/2] at86rf2xx: Set page 2 by default on AT86RF212B Page 2 is O-QPSK 100 kbit/s or 250 kbit/s, which matches the bandwidth provided in the 2.4 GHz band, at the cost of receiver sensitivity. The previous default, page 0, provides only 20 kbit/s in channel 0, and 40 kbit/s in channels 1-10, and should be used in specific applications where the radio environment requires the maximum receiver sensitivity and noise resilience. --- drivers/at86rf2xx/at86rf2xx.c | 2 +- drivers/include/at86rf2xx.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/at86rf2xx/at86rf2xx.c b/drivers/at86rf2xx/at86rf2xx.c index fb5436d0b1..84f09a41c0 100644 --- a/drivers/at86rf2xx/at86rf2xx.c +++ b/drivers/at86rf2xx/at86rf2xx.c @@ -98,7 +98,7 @@ void at86rf2xx_reset(at86rf2xx_t *dev) at86rf2xx_reg_write(dev, AT86RF2XX_REG__TRX_CTRL_2, AT86RF2XX_TRX_CTRL_2_MASK__RX_SAFE_MODE); #ifdef MODULE_AT86RF212B - at86rf2xx_set_page(dev, 0); + at86rf2xx_set_page(dev, AT86RF2XX_DEFAULT_PAGE); #endif /* don't populate masked interrupt flags to IRQ_STATUS register */ diff --git a/drivers/include/at86rf2xx.h b/drivers/include/at86rf2xx.h index b1c2bc6ef4..aeaecad4f3 100644 --- a/drivers/include/at86rf2xx.h +++ b/drivers/include/at86rf2xx.h @@ -57,10 +57,13 @@ extern "C" { #define AT86RF2XX_MIN_CHANNEL (IEEE802154_CHANNEL_MIN_SUBGHZ) #define AT86RF2XX_MAX_CHANNEL (IEEE802154_CHANNEL_MAX_SUBGHZ) #define AT86RF2XX_DEFAULT_CHANNEL (IEEE802154_DEFAULT_SUBGHZ_CHANNEL) +/* Page 2 is O-QPSK 100 kbit/s (channel 0), or 250 kbit/s (channels 1-10) */ +#define AT86RF2XX_DEFAULT_PAGE (2) #else #define AT86RF2XX_MIN_CHANNEL (IEEE802154_CHANNEL_MIN) #define AT86RF2XX_MAX_CHANNEL (IEEE802154_CHANNEL_MAX) #define AT86RF2XX_DEFAULT_CHANNEL (IEEE802154_DEFAULT_CHANNEL) +/* Only page 0 is supported in the 2.4 GHz band */ #endif /** @} */ From d458abfa0e00acebb54054d2eacd207e2c062e4b Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 7 Dec 2017 11:16:39 +0100 Subject: [PATCH 2/2] ieee802154: Make 2 default channel page for sub GHz --- drivers/include/at86rf2xx.h | 2 +- sys/include/net/ieee802154.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/include/at86rf2xx.h b/drivers/include/at86rf2xx.h index aeaecad4f3..36e0c899ee 100644 --- a/drivers/include/at86rf2xx.h +++ b/drivers/include/at86rf2xx.h @@ -58,7 +58,7 @@ extern "C" { #define AT86RF2XX_MAX_CHANNEL (IEEE802154_CHANNEL_MAX_SUBGHZ) #define AT86RF2XX_DEFAULT_CHANNEL (IEEE802154_DEFAULT_SUBGHZ_CHANNEL) /* Page 2 is O-QPSK 100 kbit/s (channel 0), or 250 kbit/s (channels 1-10) */ -#define AT86RF2XX_DEFAULT_PAGE (2) +#define AT86RF2XX_DEFAULT_PAGE (IEEE802154_DEFAULT_SUBGHZ_PAGE) #else #define AT86RF2XX_MIN_CHANNEL (IEEE802154_CHANNEL_MIN) #define AT86RF2XX_MAX_CHANNEL (IEEE802154_CHANNEL_MAX) diff --git a/sys/include/net/ieee802154.h b/sys/include/net/ieee802154.h index bd3f539156..5d833b8498 100644 --- a/sys/include/net/ieee802154.h +++ b/sys/include/net/ieee802154.h @@ -124,6 +124,10 @@ extern const uint8_t ieee802154_addr_bcast[IEEE802154_ADDR_BCAST_LEN]; #define IEEE802154_DEFAULT_CHANNEL (26U) #endif +#ifndef IEEE802154_DEFAULT_SUBGHZ_PAGE +#define IEEE802154_DEFAULT_SUBGHZ_PAGE (2U) +#endif + #ifndef IEEE802154_DEFAULT_PANID #define IEEE802154_DEFAULT_PANID (0x0023U) #endif