diff --git a/boards/openmote-b/Makefile.dep b/boards/openmote-b/Makefile.dep index df94179725..b96e814846 100644 --- a/boards/openmote-b/Makefile.dep +++ b/boards/openmote-b/Makefile.dep @@ -1,5 +1,13 @@ ifneq (,$(filter gnrc_netdev_default netdev_default,$(USEMODULE))) - USEMODULE += cc2538_rf + ifeq (,$(filter cc2538_rf,$(USEMODULE))) + USEMODULE += at86rf215 + endif +endif + +# at86rf215 is hard-wired to sub-GHz, but 2.4 GHz can be switched between +# at86rf215 and cc2538_rf. Use 2.4 GHz for cc2538_rf if both are used. +ifeq (at86rf215 cc2538_rf, $(filter at86rf215 cc2538_rf,$(USEMODULE))) + DISABLE_MODULE += at86rf215_24ghz endif ifneq (,$(filter saul_default,$(USEMODULE))) diff --git a/boards/openmote-b/board.c b/boards/openmote-b/board.c index ceaaecec02..da825bba54 100644 --- a/boards/openmote-b/board.c +++ b/boards/openmote-b/board.c @@ -36,9 +36,15 @@ void board_init(void) gpio_init(RF24_SWITCH_CC2538_PIN, GPIO_OUT); gpio_init(RF24_SWITCH_AT86RF215_PIN, GPIO_OUT); - /* start with cc2538 2.4ghz radio*/ - RF24_SWITCH_CC2538_ON; +#ifdef MODULE_CC2538_RF + /* use cc2538 2.4ghz radio*/ RF24_SWITCH_AT86RF215_OFF; + RF24_SWITCH_CC2538_ON; +#else + /* use at86rf215 2.4ghz radio*/ + RF24_SWITCH_CC2538_OFF; + RF24_SWITCH_AT86RF215_ON; +#endif /* initialize the CPU */ cpu_init(); diff --git a/boards/openmote-b/include/board.h b/boards/openmote-b/include/board.h index 0e49505b90..e2ecedd77f 100644 --- a/boards/openmote-b/include/board.h +++ b/boards/openmote-b/include/board.h @@ -76,6 +76,16 @@ #define RF24_SWITCH_AT86RF215_TOGGLE (RF_SWITCH_PORT->DATA ^= RF24_SWITCH_AT86RF215_MASK) /** @} */ +/** + * @name AT86RF215 configuration + * @{ + */ +#define AT86RF215_PARAM_SPI SPI_DEV(0) +#define AT86RF215_PARAM_CS GPIO_PIN(0, 3) /* A3 */ +#define AT86RF215_PARAM_INT GPIO_PIN(3, 0) /* D0 */ +#define AT86RF215_PARAM_RESET GPIO_PIN(3, 1) /* D1 */ +/** @} */ + /** * @name xtimer configuration * @{