diff --git a/boards/common/particle-mesh/board.c b/boards/common/particle-mesh/board.c index 05f0d0d3ba..cbf2ce6a4c 100644 --- a/boards/common/particle-mesh/board.c +++ b/boards/common/particle-mesh/board.c @@ -33,6 +33,16 @@ void board_init(void) gpio_init(LED2_PIN, GPIO_OUT); gpio_set(LED2_PIN); + gpio_init(VCTL1_PIN, GPIO_OUT); + /* Suppress output to the UFL connector */ + gpio_set(VCTL1_PIN); +#ifdef VCTL2_PIN + /* On boards without VCLT2_PIN (Boron), the VCTL2 net is driven by NOT(VCTL1) */ + gpio_init(VCTL2_PIN, GPIO_OUT); + /* Enable output to the built-in antenna */ + gpio_clear(VCTL2_PIN); +#endif + /* initialize the CPU */ cpu_init(); } diff --git a/boards/common/particle-mesh/include/board.h b/boards/common/particle-mesh/include/board.h index 0655d255ab..0c180d9e44 100644 --- a/boards/common/particle-mesh/include/board.h +++ b/boards/common/particle-mesh/include/board.h @@ -61,6 +61,27 @@ extern "C" { #define BTN0_MODE GPIO_IN_PU /** @} */ +/** + * @name Antenna selection configuration + * @{ + */ + +#ifdef BOARD_PARTICLE_XENON +#define VCTL1_PIN GPIO_PIN(0, 24) +#define VCTL2_PIN GPIO_PIN(0, 25) +#endif + +#ifdef BOARD_PARTICLE_ARGON +#define VCTL1_PIN GPIO_PIN(0, 25) +#define VCTL2_PIN GPIO_PIN(0, 2) +#endif + +#ifdef BOARD_PARTICLE_BORON +#define VCTL1_PIN GPIO_PIN(0, 7) +#endif + +/** @} */ + #ifdef __cplusplus } #endif