From 14842f943a6fe839b011b686b3978cc6d3d4a4c0 Mon Sep 17 00:00:00 2001 From: Hauke Petersen <hauke.petersen@fu-berlin.de> Date: Thu, 18 Jan 2018 14:57:50 +0100 Subject: [PATCH] boards/ruuvitag: init and set CS pins in board_init --- boards/ruuvitag/include/board.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/boards/ruuvitag/include/board.h b/boards/ruuvitag/include/board.h index 0278f245e8..a87a972f84 100644 --- a/boards/ruuvitag/include/board.h +++ b/boards/ruuvitag/include/board.h @@ -34,10 +34,18 @@ extern "C" { #define LED0_PIN GPIO_PIN(0, 17) #define LED1_PIN GPIO_PIN(0, 19) +/* as a shortcut, we include the two CS pins into the LED_MASK, this will make + * sure both pins are initialized as output and set during board initialization. + * This is needed so that the BMX280 and LIS2DH12 device drivers do not + * interfere... */ +#define CS_PIN_MASK ((1 << 3) | (1 << 8)) + #define LED_PORT NRF_P0 #define LED0_MASK (1 << 17) #define LED1_MASK (1 << 19) -#define LED_MASK (LED0_MASK | LED1_MASK) + +/* mask used in the common board.c file to initialize and set the given pins */ +#define LED_MASK (LED0_MASK | LED1_MASK | CS_PIN_MASK) #define LED0_ON (LED_PORT->OUTCLR = LED0_MASK) #define LED0_OFF (LED_PORT->OUTSET = LED0_MASK) -- GitLab