Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
boards: arm: particle_boron: enable SARA-R4 modem
The Particle.io Boron is an nRF52840-based board with a connected u-blox SARA-R4 modem. The main board was previously upstreamed without modem support. Now that we have a driver to support the SARA-R4 modem, let's enable it for the Boron board. Signed-off-by: Michael Scott <mike@foundries.io>
- Loading branch information
1 parent
4c49075
commit e2b45e6
Showing
6 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_library() | ||
zephyr_library_sources(board.c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright (c) 2019 Foundries.io | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <init.h> | ||
#include "board.h" | ||
#include <gpio.h> | ||
|
||
static int particle_boron_init(struct device *dev) | ||
{ | ||
|
||
ARG_UNUSED(dev); | ||
|
||
#if defined(CONFIG_MODEM_UBLOX_SARA_R4) | ||
struct device *gpio_dev; | ||
|
||
/* Enable the serial buffer for SARA-R4 modem */ | ||
gpio_dev = device_get_binding(SERIAL_BUFFER_ENABLE_GPIO_NAME); | ||
if (!gpio_dev) { | ||
return -ENODEV; | ||
} | ||
|
||
gpio_pin_configure(gpio_dev, V_INT_DETECT_GPIO_PIN, GPIO_DIR_IN); | ||
|
||
gpio_pin_configure(gpio_dev, SERIAL_BUFFER_ENABLE_GPIO_PIN, | ||
GPIO_DIR_OUT); | ||
#endif | ||
|
||
return 0; | ||
} | ||
|
||
/* needs to be done after GPIO driver init */ | ||
SYS_INIT(particle_boron_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2019 Foundries.io | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef __INC_BOARD_H | ||
#define __INC_BOARD_H | ||
|
||
/* pin used to enable the buffer power */ | ||
#define SERIAL_BUFFER_ENABLE_GPIO_NAME DT_NORDIC_NRF_GPIO_0_LABEL | ||
#define SERIAL_BUFFER_ENABLE_GPIO_PIN 25 | ||
|
||
/* pin used to detect V_INT (buffer power) */ | ||
#define V_INT_DETECT_GPIO_PIN 2 | ||
|
||
#endif /* __INC_BOARD_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters