|
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
6 | 6 |
|
7 | | -#include <zephyr/init.h> |
8 | | -#include <hal/nrf_gpio.h> |
9 | | -#include <nrfx.h> |
10 | 7 | #include <zephyr/device.h> |
11 | | -#include <zephyr/drivers/gpio.h> |
12 | 8 |
|
13 | 9 | #include <zephyr/logging/log.h> |
14 | 10 | LOG_MODULE_REGISTER(thingy53_board_init); |
15 | 11 |
|
16 | | -#define ADXL362_NODE DT_NODELABEL(adxl362) |
17 | | -#define ADXL362_GPIO_NODE DT_SPI_DEV_CS_GPIOS_CTLR(ADXL362_NODE) |
18 | | -#define ADXL362_CS DT_SPI_DEV_CS_GPIOS_PIN(ADXL362_NODE) |
19 | | -#define ADXL362_FLAGS DT_SPI_DEV_CS_GPIOS_FLAGS(ADXL362_NODE) |
20 | | - |
21 | | -#define BMI270_NODE DT_NODELABEL(bmi270) |
22 | | -#define BMI270_GPIO_NODE DT_SPI_DEV_CS_GPIOS_CTLR(BMI270_NODE) |
23 | | -#define BMI270_CS DT_SPI_DEV_CS_GPIOS_PIN(BMI270_NODE) |
24 | | -#define BMI270_FLAGS DT_SPI_DEV_CS_GPIOS_FLAGS(BMI270_NODE) |
25 | | - |
26 | 12 | /* Initialization chain of Thingy:53 board requires some delays before on board sensors |
27 | 13 | * could be accessed after power up. In particular bme680 and bmm150 sensors require, |
28 | 14 | * respectively 2ms and 1ms power on delay. In order to avoid delays sum, common delay is |
@@ -70,33 +56,8 @@ static void enable_cpunet(void) |
70 | 56 | static int setup(const struct device *dev) |
71 | 57 | { |
72 | 58 | ARG_UNUSED(dev); |
73 | | -#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) |
74 | | - |
75 | | - const struct device *gpio; |
76 | | - int err; |
77 | | - |
78 | | - gpio = DEVICE_DT_GET(ADXL362_GPIO_NODE); |
79 | | - if (!device_is_ready(gpio)) { |
80 | | - LOG_ERR("%s device not ready", gpio->name); |
81 | | - return -ENODEV; |
82 | | - } |
83 | | - err = gpio_pin_configure(gpio, ADXL362_CS, ADXL362_FLAGS | GPIO_OUTPUT_INACTIVE); |
84 | | - if (err < 0) { |
85 | | - LOG_ERR("Failed to configure ADXL362 CS Pin"); |
86 | | - return err; |
87 | | - } |
88 | | - |
89 | | - gpio = DEVICE_DT_GET(BMI270_GPIO_NODE); |
90 | | - if (!device_is_ready(gpio)) { |
91 | | - LOG_ERR("%s device not ready", gpio->name); |
92 | | - return -ENODEV; |
93 | | - } |
94 | | - err = gpio_pin_configure(gpio, BMI270_CS, BMI270_FLAGS | GPIO_OUTPUT_INACTIVE); |
95 | | - if (err < 0) { |
96 | | - LOG_ERR("Failed to configure BMI270 CS Pin"); |
97 | | - return err; |
98 | | - } |
99 | 59 |
|
| 60 | +#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE) |
100 | 61 | if (IS_ENABLED(CONFIG_SENSOR)) { |
101 | 62 | /* Initialization chain of Thingy:53 board requires some delays before on board |
102 | 63 | * sensors could be accessed after power up. In particular bme680 and bmm150 |
|
0 commit comments