From 93b1e0ac442234c4ce60caf6937fa764df8d9913 Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Tue, 18 Aug 2020 21:27:19 +0200 Subject: Add nrfmicro 1.1, 1.1 flipped and 1.3 boards. --- app/boards/arm/nrfmicro/pinmux.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/boards/arm/nrfmicro/pinmux.c (limited to 'app/boards/arm/nrfmicro/pinmux.c') diff --git a/app/boards/arm/nrfmicro/pinmux.c b/app/boards/arm/nrfmicro/pinmux.c new file mode 100644 index 0000000..803d20d --- /dev/null +++ b/app/boards/arm/nrfmicro/pinmux.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 Okke Formsma, joric + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include +#include +#include + +static int pinmux_nrfmicro_init(struct device *port) +{ + ARG_UNUSED(port); + + struct device *p1 = device_get_binding("GPIO_1"); + +#if defined(BOARD_NRFMICRO_13) + struct device *p0 = device_get_binding("GPIO_0"); + // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1) + gpio_pin_configure(p1, 9, GPIO_OUTPUT); + gpio_pin_set(p1, 9, 0); + + // enable charger (nRFMicro 1.3 only) + gpio_pin_configure(p0, 5, GPIO_OUTPUT); + gpio_pin_set(p0, 5, 0); +#else + // enable EXT_VCC (use 0 for nRFMicro 1.3, use 1 for nRFMicro 1.1) + gpio_pin_configure(p1, 9, GPIO_OUTPUT); + gpio_pin_set(p1, 9, 1); +#endif + return 0; +} + +SYS_INIT(pinmux_nrfmicro_init, APPLICATION, CONFIG_APPLICATION_INIT_PRIORITY); \ No newline at end of file -- cgit v1.2.3