boards: ubx_bmd345eval_nrf52840: use gpio hogs to initialize fem pins
Instead of custom board init code. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
This commit is contained in:
parent
63a9f774df
commit
12cca8939e
3 changed files with 7 additions and 46 deletions
|
@ -1,7 +0,0 @@
|
||||||
# BMD-345-EVAL board configuration
|
|
||||||
|
|
||||||
# Copyright (c) 2021 u-blox AG
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
zephyr_library()
|
|
||||||
zephyr_library_sources(board.c)
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2021 u-blox AG
|
|
||||||
* Copyright (c) 2021 Linumiz
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr/device.h>
|
|
||||||
#include <zephyr/drivers/gpio.h>
|
|
||||||
|
|
||||||
#define MODE_PIN 4 /* P1.04 */
|
|
||||||
#define A_SEL_PIN 2 /* P1.02 */
|
|
||||||
|
|
||||||
static int bmd345_fem_init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
int ret;
|
|
||||||
const struct device *mode_asel_port_dev;
|
|
||||||
|
|
||||||
mode_asel_port_dev = DEVICE_DT_GET(DT_NODELABEL(gpio1));
|
|
||||||
|
|
||||||
if (!device_is_ready(mode_asel_port_dev)) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = gpio_pin_configure(mode_asel_port_dev, MODE_PIN, GPIO_OUTPUT_LOW);
|
|
||||||
if (ret < 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = gpio_pin_configure(mode_asel_port_dev, A_SEL_PIN, GPIO_OUTPUT_LOW);
|
|
||||||
if (ret < 0) {
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SYS_INIT(bmd345_fem_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
|
@ -162,6 +162,13 @@
|
||||||
|
|
||||||
&gpio1 {
|
&gpio1 {
|
||||||
status = "okay";
|
status = "okay";
|
||||||
|
|
||||||
|
fem-pins {
|
||||||
|
gpio-hog;
|
||||||
|
/* A_SEL, MODE pins */
|
||||||
|
gpios = <2 GPIO_ACTIVE_HIGH>, <4 GPIO_ACTIVE_HIGH>;
|
||||||
|
output-low;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
&uart0 {
|
&uart0 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue