Skip to content

Commit bba3bd0

Browse files
volodymyr-bondarchukMaureenHelm
authored andcommitted
boards: thingy53_nrf5340: Remove CS configuration in board.c
CSs now are configured properly according to DTS description during SPI driver initialization. Earlier, additional configuration was required due to a problem, fixed in f7466d2. Signed-off-by: Volodymyr Bondarchuk <[email protected]>
1 parent 4de1d01 commit bba3bd0

File tree

1 file changed

+1
-40
lines changed

1 file changed

+1
-40
lines changed

boards/arm/thingy53_nrf5340/board.c

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,11 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include <zephyr/init.h>
8-
#include <hal/nrf_gpio.h>
9-
#include <nrfx.h>
107
#include <zephyr/device.h>
11-
#include <zephyr/drivers/gpio.h>
128

139
#include <zephyr/logging/log.h>
1410
LOG_MODULE_REGISTER(thingy53_board_init);
1511

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-
2612
/* Initialization chain of Thingy:53 board requires some delays before on board sensors
2713
* could be accessed after power up. In particular bme680 and bmm150 sensors require,
2814
* 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)
7056
static int setup(const struct device *dev)
7157
{
7258
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-
}
9959

60+
#if !defined(CONFIG_TRUSTED_EXECUTION_SECURE)
10061
if (IS_ENABLED(CONFIG_SENSOR)) {
10162
/* Initialization chain of Thingy:53 board requires some delays before on board
10263
* sensors could be accessed after power up. In particular bme680 and bmm150

0 commit comments

Comments
 (0)