Skip to contentSkip to conversation

arm: Add nRF51 GPIO peripheral

RFC Superseded Steffen Görtz 1 participant 2 messages Jul 15, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC 1/2 arm: Add nRF51 GPIO peripheral

---
The general purpose i/o implementation supports tri-state inputs and outputs (HIGH-Z, LOW, HIGH). SENSE output is not supported and tests will follow in V2.

 hw/gpio/Makefile.objs        |   1 +
 hw/gpio/nrf51_gpio.c         | 302 +++++++++++++++++++++++++++++++++++
 include/hw/gpio/nrf51_gpio.h |  55 +++++++
 3 files changed, 358 insertions(+)
 create mode 100644 hw/gpio/nrf51_gpio.c
 create mode 100644 include/hw/gpio/nrf51_gpio.h
hw/gpio/Makefile.objs +1 -0
index fa0a72e6d0..e5da0cb54f 100644
@@ -8,3 +8,4 @@ common-obj-$(CONFIG_GPIO_KEY) += gpio_key.o
 obj-$(CONFIG_OMAP) += omap_gpio.o
 obj-$(CONFIG_IMX) += imx_gpio.o
 obj-$(CONFIG_RASPI) += bcm2835_gpio.o
+obj-$(CONFIG_NRF51_SOC) += nrf51_gpio.o
hw/gpio/nrf51_gpio.c new file +302 -0

302 lines not on this page · raw message

include/hw/gpio/nrf51_gpio.h new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
2.18.0
#1 lore raw

RFC 2/2 arm: Add nRF51 GPIO tests

---

Test stubs for GIPO. Tests will follow in v2.

 tests/microbit-test.c | 7 +++++++
 1 file changed, 7 insertions(+)
tests/microbit-test.c +7 -0
index c502ee3976..a1e2f67855 100644
@@ -101,6 +101,12 @@ static void test_nrf51_nvmc(void)
     }
 }
 
+static void test_nrf51_gpio(void)
+{
+    /* TODO add tests for GPIO */
+    g_assert_true(false);
+}
+
 int main(int argc, char **argv)
 {
     int ret;
@@ -110,6 +116,7 @@ int main(int argc, char **argv)
     global_qtest = qtest_startf("-machine microbit");
 
     qtest_add_func("/microbit/nrf51/nvmc", test_nrf51_nvmc);
+    qtest_add_func("/microbit/nrf51/gpio", test_nrf51_gpio);
 
     ret = g_test_run();
 
Signature · 1 line
2.18.0