Skip to content

Commit 01e1dcb

Browse files
committed
SLM: Refactor DTR+RI UART handler
Work in progress: Not ready. * Refactor to use just Zephyr GPIO API * Use Devicetree to define pins * Refactor DTR UP/DOWN events to ASSERT/DEASSERT * Logic level 1 is asserted, use DT to change 0/1 level of that. * Remove support of DTE device, that is separate driver TODO: * sw_dtr should not keep RX buffers. Instead when RX is enabled, feed buffer to UART from application call. * When buffer is needed, make a callback to app to request a buffer. * When UART is powered down because of DTR, block RX_STOP and RX_DISABLE events going to application, so app thinks the UART keeps on going. Signed-off-by: Seppo Takalo <[email protected]>
1 parent 120532d commit 01e1dcb

File tree

4 files changed

+293
-603
lines changed

4 files changed

+293
-603
lines changed

applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.conf

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,30 @@
55
#
66

77
# nRF52 <=> nRF91 interface pin 4 (see https://docs.nordicsemi.com/bundle/ug_nrf91_dk/page/UG/nrf91_DK/board_controller.html)
8-
CONFIG_SLM_POWER_PIN=22
8+
CONFIG_SLM_POWER_PIN=-1
9+
10+
CONFIG_USE_SEGGER_RTT=n
11+
# Where console messages (printk) are output.
12+
# By itself, SLM does not output any.
13+
CONFIG_RTT_CONSOLE=n
14+
CONFIG_UART_CONSOLE=y
15+
# Where SLM logs are output.
16+
CONFIG_LOG_BACKEND_RTT=n
17+
CONFIG_LOG_BACKEND_UART=y
18+
19+
CONFIG_SHELL=y
20+
CONFIG_GPIO=y
21+
CONFIG_GPIO_SHELL=y
22+
CONFIG_PM_DEVICE_SHELL=y
23+
24+
CONFIG_UART_1_INTERRUPT_DRIVEN=n
25+
CONFIG_UART_1_ASYNC=y
26+
CONFIG_UART_USE_RUNTIME_CONFIGURE=y
27+
CONFIG_UART_ASYNC_API=y
28+
29+
CONFIG_SLM_SMS=n
30+
CONFIG_SLM_GNSS=n
31+
CONFIG_SLM_NRF_CLOUD=n
32+
CONFIG_SLM_GPIO=n
33+
34+
CONFIG_SIZE_OPTIMIZATIONS_AGGRESSIVE=y

applications/serial_lte_modem/overlay-zephyr-modem-nrf9160dk-nrf52840.overlay

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88

99
/ {
1010
chosen {
11-
ncs,slm-uart = &uart1;
11+
ncs,slm-uart = &dtr_uart;
1212
};
1313
};
1414

1515
&uart1 {
1616
current-speed = <115200>;
1717
hw-flow-control;
18+
status = "okay";
19+
dtr_uart: nrf-sw-dtr-uart {
20+
compatible = "nordic,nrf-sw-dtr-uart";
21+
dtr-gpios = <&interface_to_nrf52840 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
22+
ri-gpios = <&interface_to_nrf52840 5 (GPIO_ACTIVE_LOW)>;
23+
status = "okay";
24+
};
1825
};

0 commit comments

Comments
 (0)