Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/arm/rak5010_nrf52840/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ if BOARD_RAK5010_NRF52840
config BOARD
default "rak5010_nrf52840"

config MODEM_QUECTEL_BG9X
default y

if USB

config USB_NRFX
Expand Down
37 changes: 24 additions & 13 deletions boards/arm/rak5010_nrf52840/rak5010_nrf52840.dts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
compatible = "nordic,rak5010_nrf52840";

chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,console = &uart1;
zephyr,shell-uart = &uart1;
zephyr,uart-mcumgr = &uart1;
zephyr,bt-mon-uart = &uart1;
zephyr,bt-c2h-uart = &uart1;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
Expand Down Expand Up @@ -54,20 +54,31 @@

&uart0 {
compatible = "nordic,nrf-uart";
current-speed = <115200>;
status = "okay";
tx-pin = <33>;
rx-pin = <34>;
current-speed = <115200>;
tx-pin = <6>;
rx-pin = <8>;
rts-pin = <7>;
cts-pin = <11>;

/* QUECTEL BG9X */
quectel_bg9x: quectel_bg9x {
compatible = "quectel,bg9x";
label = "quectel,bg9x";
mdm-power-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
mdm-reset-gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
mdm-dtr-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
mdm-wdisable-gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
status = "okay";
};
};

&uart1 {
compatible = "nordic,nrf-uart";
status = "okay";
current-speed = <115200>;
tx-pin = <8>;
rx-pin = <6>;
rts-pin = <7>;
cts-pin = <11>;
status = "okay";
tx-pin = <33>;
rx-pin = <34>;
};

&i2c1 {
Expand Down
6 changes: 6 additions & 0 deletions drivers/modem/quectel-bg9x.c
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,12 @@ static void pin_init(void)
{
LOG_INF("Setting Modem Pins");

#if DT_INST_NODE_HAS_PROP(0, mdm_wdisable_gpios)
LOG_INF("Deactivate W Disable");
modem_pin_write(&mctx, MDM_WDISABLE, 0);
k_sleep(K_MSEC(250));
#endif

/* NOTE: Per the BG95 document, the Reset pin is internally connected to the
* Power key pin.
*/
Expand Down
9 changes: 9 additions & 0 deletions drivers/modem/quectel-bg9x.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ enum mdm_control_pins {
#if DT_INST_NODE_HAS_PROP(0, mdm_dtr_gpios)
MDM_DTR,
#endif
#if DT_INST_NODE_HAS_PROP(0, mdm_wdisable_gpios)
MDM_WDISABLE,
#endif
};

/* driver data */
Expand Down Expand Up @@ -135,6 +138,12 @@ static struct modem_pin modem_pins[] = {
DT_INST_GPIO_PIN(0, mdm_dtr_gpios),
DT_INST_GPIO_FLAGS(0, mdm_dtr_gpios) | GPIO_OUTPUT_LOW),
#endif
#if DT_INST_NODE_HAS_PROP(0, mdm_wdisable_gpios)
/* MDM_WDISABLE */
MODEM_PIN(DT_INST_GPIO_LABEL(0, mdm_wdisable_gpios),
DT_INST_GPIO_PIN(0, mdm_wdisable_gpios),
DT_INST_GPIO_FLAGS(0, mdm_wdisable_gpios) | GPIO_OUTPUT_LOW),
#endif
};

#endif /* #ifndef QUECTEL_BG9X_H */
4 changes: 4 additions & 0 deletions dts/bindings/modem/quectel,bg9x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ properties:
mdm-dtr-gpios:
type: phandle-array
required: false

mdm-wdisable-gpios:
type: phandle-array
required: false