arm: Add nRF51 GPIO peripheral
RFC 1/2 arm: Add nRF51 GPIO peripheral
Signed-off-by Steffen Görtz <[email protected]>
---
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
@@ -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
RFC 2/2 arm: Add nRF51 GPIO tests
Signed-off-by Steffen Görtz <[email protected]>
---
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
@@ -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