You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2018/11/23 16:16:40 UTC

[mynewt-core] 08/26: hw/mcu/nordic: Extend hal_spi with new calls

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

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

commit 32f9889b434211490b7b604e390a2d7fbf162ec9
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Nov 8 17:30:22 2018 +0100

    hw/mcu/nordic: Extend hal_spi with new calls
---
 hw/mcu/nordic/nrf52xxx/src/hal_spi.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/hw/mcu/nordic/nrf52xxx/src/hal_spi.c b/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
index d4dc3a1..4a2c5b5 100644
--- a/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
+++ b/hw/mcu/nordic/nrf52xxx/src/hal_spi.c
@@ -663,6 +663,20 @@ err:
     return (rc);
 }
 
+int
+hal_spi_init_hw(uint8_t spi_num, uint8_t spi_type,
+                const struct hal_spi_hw_settings *cfg)
+{
+    struct nrf52_hal_spi_cfg hal_cfg;
+
+    hal_cfg.sck_pin = cfg->pin_sck;
+    hal_cfg.mosi_pin = cfg->pin_mosi;
+    hal_cfg.miso_pin = cfg->pin_miso;
+    hal_cfg.ss_pin = cfg->pin_ss;
+
+    return hal_spi_init(spi_num, &hal_cfg, spi_type);
+}
+
 /**
  * Configure the spi. Must be called after the spi is initialized (after
  * hal_spi_init is called) and when the spi is disabled (user must call