You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2021/03/03 07:54:15 UTC

[mynewt-core] 02/02: hw/mcu/da1469x: Use spi_da1469x driver instead of spi_hal

This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 9de49b96084a5a41da36f8583ae6b0243925d432
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Fri Jan 8 12:38:18 2021 +0100

    hw/mcu/da1469x: Use spi_da1469x driver instead of spi_hal
    
    DA1469x now has dedicated SPI bus driver that will be
    used instead of generic spi_hal.
---
 hw/mcu/dialog/da1469x/pkg.yml              |  2 +-
 hw/mcu/dialog/da1469x/src/da1469x_periph.c | 14 +++++++-------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/mcu/dialog/da1469x/pkg.yml b/hw/mcu/dialog/da1469x/pkg.yml
index b2c057e..86b49f7 100644
--- a/hw/mcu/dialog/da1469x/pkg.yml
+++ b/hw/mcu/dialog/da1469x/pkg.yml
@@ -49,7 +49,7 @@ pkg.deps.'(I2C_0 || I2C_1) && BUS_DRIVER_PRESENT':
     - "@apache-mynewt-core/hw/bus/drivers/i2c_hal"
 
 pkg.deps.'(SPI_0_MASTER || SPI_1_MASTER) && BUS_DRIVER_PRESENT':
-    - "@apache-mynewt-core/hw/bus/drivers/spi_hal"
+    - "@apache-mynewt-core/hw/bus/drivers/spi_da1469x"
 
 pkg.deps.'(PWM_0 || PWM_1 || PWM_2)':
     - "@apache-mynewt-core/hw/drivers/pwm/pwm_da1469x"
diff --git a/hw/mcu/dialog/da1469x/src/da1469x_periph.c b/hw/mcu/dialog/da1469x/src/da1469x_periph.c
index 0ec0628..56911ef 100644
--- a/hw/mcu/dialog/da1469x/src/da1469x_periph.c
+++ b/hw/mcu/dialog/da1469x/src/da1469x_periph.c
@@ -71,7 +71,7 @@ static struct crypto_dev os_bsp_crypto;
 
 #if MYNEWT_VAL(SPI_0_MASTER) || MYNEWT_VAL(SPI_1_MASTER)
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
-#include "bus/drivers/spi_hal.h"
+#include "bus/drivers/spi_da1469x.h"
 #else
 #include "hal/hal_spi.h"
 #endif
@@ -191,7 +191,7 @@ static const struct bus_spi_dev_cfg spi0_cfg = {
     .pin_mosi = MYNEWT_VAL(SPI_0_MASTER_PIN_MOSI),
     .pin_miso = MYNEWT_VAL(SPI_0_MASTER_PIN_MISO),
 };
-static struct bus_spi_hal_dev spi0_bus;
+static struct bus_spi_dev spi0_bus;
 #else
 static const struct da1469x_hal_spi_cfg hal_spi0_cfg = {
     .pin_sck = MYNEWT_VAL(SPI_0_MASTER_PIN_SCK),
@@ -215,7 +215,7 @@ static const struct bus_spi_dev_cfg spi1_cfg = {
     .pin_mosi = MYNEWT_VAL(SPI_1_MASTER_PIN_MOSI),
     .pin_miso = MYNEWT_VAL(SPI_1_MASTER_PIN_MISO),
 };
-static struct bus_spi_hal_dev spi1_bus;
+static struct bus_spi_dev spi1_bus;
 #else
 static const struct da1469x_hal_spi_cfg hal_spi1_cfg = {
     .pin_sck = MYNEWT_VAL(SPI_1_MASTER_PIN_SCK),
@@ -440,8 +440,8 @@ da1469x_periph_create_spi(void)
 
 #if MYNEWT_VAL(SPI_0_MASTER)
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
-    rc = bus_spi_hal_dev_create("spi0", &spi0_bus,
-                                (struct bus_spi_dev_cfg *)&spi0_cfg);
+    rc = bus_spi_da1469x_dev_create("spi0", &spi0_bus,
+                                    (struct bus_spi_dev_cfg *)&spi0_cfg);
     assert(rc == 0);
 #else
     rc = hal_spi_init(0, (void *)&hal_spi0_cfg, HAL_SPI_TYPE_MASTER);
@@ -451,8 +451,8 @@ da1469x_periph_create_spi(void)
 
 #if MYNEWT_VAL(SPI_1_MASTER)
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
-    rc = bus_spi_hal_dev_create("spi1", &spi1_bus,
-                                (struct bus_spi_dev_cfg *)&spi1_cfg);
+    rc = bus_spi_da1469x_dev_create("spi1", &spi1_bus,
+                                    (struct bus_spi_dev_cfg *)&spi1_cfg);
     assert(rc == 0);
 #else
     rc = hal_spi_init(1, (void *)&hal_spi1_cfg, HAL_SPI_TYPE_MASTER);