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: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
6310a5de1c
commit
651fa0b08a
2 changed files with 6 additions and 19 deletions
|
@ -1,4 +1,2 @@
|
|||
if(CONFIG_PINMUX)
|
||||
zephyr_library()
|
||||
zephyr_library_sources(pinmux.c)
|
||||
endif()
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue