File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ BUILD_ASSERT(DT_NUM_INST_STATUS_OKAY(semtech_sx1261) +
34
34
#define HAVE_GPIO_CS DT_INST_SPI_DEV_HAS_CS_GPIOS(0)
35
35
#define GPIO_CS_LABEL DT_INST_SPI_DEV_CS_GPIOS_LABEL(0)
36
36
#define GPIO_CS_PIN DT_INST_SPI_DEV_CS_GPIOS_PIN(0)
37
+ #define GPIO_CS_FLAGS DT_INST_SPI_DEV_CS_GPIOS_FLAGS(0)
37
38
38
39
#define GPIO_RESET_LABEL DT_INST_GPIO_LABEL(0, reset_gpios)
39
40
#define GPIO_RESET_PIN DT_INST_GPIO_PIN(0, reset_gpios)
@@ -441,12 +442,15 @@ static int sx126x_lora_init(struct device *dev)
441
442
442
443
#if HAVE_GPIO_CS
443
444
dev_data .spi_cs .gpio_dev = device_get_binding (GPIO_CS_LABEL );
444
- dev_data .spi_cs .gpio_pin = GPIO_CS_PIN ;
445
445
if (!dev_data .spi_cs .gpio_dev ) {
446
446
LOG_ERR ("Cannot get pointer to %s device" , GPIO_CS_LABEL );
447
447
return - EIO ;
448
448
}
449
449
450
+ dev_data .spi_cs .gpio_pin = GPIO_CS_PIN ;
451
+ dev_data .spi_cs .gpio_dt_flags = GPIO_CS_FLAGS ;
452
+ dev_data .spi_cs .delay = 0U ;
453
+
450
454
dev_data .spi_cfg .cs = & dev_data .spi_cs ;
451
455
#endif
452
456
dev_data .spi_cfg .operation = SPI_WORD_SET (8 ) | SPI_TRANSFER_MSB ;
You can’t perform that action at this time.
0 commit comments