From c5664b77b051d560cc97c62a006ee725b3dca22b Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 4 Oct 2019 16:11:17 +0200 Subject: [PATCH] boards/thing52: enable VDD pin for hts221 or lps22hb devices --- boards/thingy52/board.c | 11 +++++++++++ boards/thingy52/include/board.h | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/boards/thingy52/board.c b/boards/thingy52/board.c index c48a65ffc6..476a86a8fc 100644 --- a/boards/thingy52/board.c +++ b/boards/thingy52/board.c @@ -21,8 +21,19 @@ #include "cpu.h" #include "board.h" +#if defined(MODULE_LPS22HB) || defined(MODULE_HTS221) +#include "periph/gpio.h" +#endif + void board_init(void) { + /* LP22HB and HTS221 can only be powered with VREG when VDD_PWR_CTRL_PIN + is set. */ +#if defined(MODULE_LPS22HB) || defined(MODULE_HTS221) + gpio_init(VDD_PWR_CTRL_PIN, GPIO_OUT); + gpio_set(VDD_PWR_CTRL_PIN); +#endif + /* initialize the CPU */ cpu_init(); } diff --git a/boards/thingy52/include/board.h b/boards/thingy52/include/board.h index 1a66f6d592..d3e7d00559 100644 --- a/boards/thingy52/include/board.h +++ b/boards/thingy52/include/board.h @@ -33,6 +33,14 @@ extern "C" { #define BTN0_MODE GPIO_IN_PU /** @} */ +/** + * @name Power switch pins definitions + * @{ + */ +#define SPK_PWR_CTRL_PIN GPIO_PIN(0, 29) /**< Speaker power switch */ +#define VDD_PWR_CTRL_PIN GPIO_PIN(0, 30) /**< VDD power switch */ +/** @} */ + /** * @name LIS2DH12 low power accelerometer configuration * @{