Commit 651fa0b0 authored by Gerard Marull-Paretas's avatar Gerard Marull-Paretas Committed by Kumar Gala
Browse files

boards: 96b_wistrio: use GPIO API to configure pull-up



The internal pinmux API was being used to setup GPIO pull-ups, however,
this can be done using the standard GPIO API.

Signed-off-by: default avatarGerard Marull-Paretas <gerard.marull@nordicsemi.no>
parent 6310a5de
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
if(CONFIG_PINMUX)
zephyr_library()
zephyr_library_sources(pinmux.c)
endif()
+6 −17
Original line number Diff line number Diff line
@@ -8,27 +8,13 @@
#include <drivers/gpio.h>
#include <init.h>
#include <kernel.h>
#include <drivers/pinmux.h>
#include <sys/sys_io.h>

#include <pinmux/pinmux_stm32.h>

static const struct pin_config pinconf[] = {
	/* RF_CTX_PA */
	{STM32_PIN_PA4, STM32_PUSHPULL_PULLUP},
	/* RF_CRX_RX */
	{STM32_PIN_PB6, STM32_PUSHPULL_PULLUP},
	/* RF_CBT_HF */
	{STM32_PIN_PB7, STM32_PUSHPULL_PULLUP},
};

static int pinmux_stm32_init(const struct device *port)
{
	ARG_UNUSED(port);
	const struct device *gpioa, *gpiob, *gpioh;

	stm32_setup_pins(pinconf, ARRAY_SIZE(pinconf));

	gpioa = device_get_binding(DT_LABEL(DT_NODELABEL(gpioa)));
	if (!gpioa) {
		return -ENODEV;
@@ -44,13 +30,16 @@ static int pinmux_stm32_init(const struct device *port)
		return -ENODEV;
	}

	gpio_pin_configure(gpioa, 4, GPIO_OUTPUT);
	/* RF_CTX_PA */
	gpio_pin_configure(gpioa, 4, GPIO_OUTPUT | GPIO_PULL_UP);
	gpio_pin_set(gpioa, 4, 1);

	gpio_pin_configure(gpiob, 6, GPIO_OUTPUT);
	/* RF_CRX_RX */
	gpio_pin_configure(gpiob, 6, GPIO_OUTPUT | GPIO_PULL_UP);
	gpio_pin_set(gpiob, 6, 1);

	gpio_pin_configure(gpiob, 7, GPIO_OUTPUT);
	/* RF_CBT_HF */
	gpio_pin_configure(gpiob, 7, GPIO_OUTPUT | GPIO_PULL_UP);
	gpio_pin_set(gpiob, 7, 0);

	gpio_pin_configure(gpioh, 1, GPIO_OUTPUT);