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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@

zephyr_include_directories(include)

add_subdirectory(drivers)
add_subdirectory(lib)
1 change: 1 addition & 0 deletions Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
# as the module Kconfig entry point (see zephyr/module.yml). You can browse
# module options by going to Zephyr -> Modules in Kconfig.

rsource "drivers/Kconfig"
rsource "lib/Kconfig"
28 changes: 0 additions & 28 deletions app/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,34 +79,6 @@ config SM_UART_TX_BUF_SIZE
If the buffers are full, will send synchronously.
These buffers are not used when CMUX is in use.

#
# GPIO functionality
#
config SM_START_SLEEP
bool "Enter sleep on startup"
help
If enabled, the SiP is put into deep sleep when powered on.
It can then be started using SM_POWER_PIN.

config SM_POWER_PIN
int "Power pin"
default -1
help
Interface GPIO pin used to put the SiP into deep sleep and wake up from it or exit idle.
The pin is configured with a pull up and must be pulled down shortly to perform one power off or wake up operation.

config SM_INDICATE_PIN
int "Indicate pin"
default -1
help
Interface GPIO pin used to indicate that data is available when Serial Modem is idle (after #XSLEEP=2 AT command).

config SM_INDICATE_TIME
int "Indication period"
default 100
help
GPIO active indication time in milliseconds. This setting specify the period length for the pin to be active

#
# Automatic network attach
#
Expand Down
12 changes: 0 additions & 12 deletions app/boards/nrf9131ek_nrf9131_ns.conf

This file was deleted.

15 changes: 14 additions & 1 deletion app/boards/nrf9131ek_nrf9131_ns.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,24 @@

/ {
chosen {
ncs,sm-uart = &uart0;
ncs,sm-uart = &dtr_uart0;
};
};

&uart0 {
status = "okay";
hw-flow-control;

dtr_uart0: dtr-uart {
compatible = "nordic,dtr-uart";
dtr-gpios = <&gpio0 28 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these be PULL_UP | ACTIVE_LOW, so if nobody is driving the pin it will be in "inactive" state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With DK's SM should run immediately when the DK is plugged in. So DTR should be asserted by default. Pushing the button down will then deassert DTR.

I am not 100% on EK board, but I would expect the same functionality to make sense.

ri-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
status = "okay";
};
};

&gpio0 {
status = "okay";
/* Use PORT event for DTR (28) pin to save power */
sense-edge-mask = <0x10000000>;
};
17 changes: 0 additions & 17 deletions app/boards/nrf9151dk_nrf9151_ns.conf

This file was deleted.

49 changes: 14 additions & 35 deletions app/boards/nrf9151dk_nrf9151_ns.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,35 @@
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
/ {
chosen {
ncs,sm-uart = &uart0;
ncs,sm-uart = &dtr_uart0;
};
};

/* DTR with DK */
&uart0 {
status = "okay";
hw-flow-control;
};

&uart2 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
status = "disabled";
hw-flow-control;
dtr_uart0: dtr-uart {
compatible = "nordic,dtr-uart";
dtr-gpios = <&gpio0 8 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>;
ri-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
status = "okay";
};
};

pinctrl-0 = <&uart2_default_alt>;
pinctrl-1 = <&uart2_sleep_alt>;
pinctrl-names = "default", "sleep";
&gpio0 {
status = "okay";
/* Use PORT event for DTR (8) pin to save power */
sense-edge-mask = <0x00000100>;
};

&i2c2 {
status = "disabled";
};

&pinctrl {
uart2_default_alt: uart2_default_alt {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 11)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 0, 10)>,
<NRF_PSEL(UART_RTS, 0, 12)>,
<NRF_PSEL(UART_CTS, 0, 13)>;
};
};

uart2_sleep_alt: uart2_sleep_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 10)>,
<NRF_PSEL(UART_RX, 0, 11)>,
<NRF_PSEL(UART_RTS, 0, 12)>,
<NRF_PSEL(UART_CTS, 0, 13)>;
low-power-enable;
};
};
};

/* Enable external flash */
&gd25wb256 {
status = "okay";
Expand Down
17 changes: 0 additions & 17 deletions app/boards/nrf9160dk_nrf9160_ns.conf

This file was deleted.

47 changes: 13 additions & 34 deletions app/boards/nrf9160dk_nrf9160_ns.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -6,50 +6,29 @@

/ {
chosen {
ncs,sm-uart = &uart0;
ncs,sm-uart = &dtr_uart0;
};
};

/* DTR with DK */
&uart0 {
status = "okay";
hw-flow-control;
};

&uart2 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
status = "disabled";
hw-flow-control;
dtr_uart0: dtr-uart {
compatible = "nordic,dtr-uart";
dtr-gpios = <&gpio0 6 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>; /* button0 */
ri-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; /* led0 */
status = "okay";
};
};

pinctrl-0 = <&uart2_default_alt>;
pinctrl-1 = <&uart2_sleep_alt>;
pinctrl-names = "default", "sleep";
&gpio0 {
status = "okay";
/* Use PORT event for DTR (6) pin to save power */
sense-edge-mask = <0x00000040>;
};

&i2c2 {
status = "disabled";
};

&pinctrl {
uart2_default_alt: uart2_default_alt {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 11)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 0, 10)>,
<NRF_PSEL(UART_RTS, 0, 12)>,
<NRF_PSEL(UART_CTS, 0, 13)>;
};
};

uart2_sleep_alt: uart2_sleep_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 10)>,
<NRF_PSEL(UART_RX, 0, 11)>,
<NRF_PSEL(UART_RTS, 0, 12)>,
<NRF_PSEL(UART_CTS, 0, 13)>;
low-power-enable;
};
};
};
17 changes: 0 additions & 17 deletions app/boards/nrf9161dk_nrf9161_ns.conf

This file was deleted.

47 changes: 13 additions & 34 deletions app/boards/nrf9161dk_nrf9161_ns.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,33 @@

/ {
chosen {
ncs,sm-uart = &uart0;
ncs,sm-uart = &dtr_uart0;
};
};

/* DTR with DK */
&uart0 {
status = "okay";
hw-flow-control;
};

&uart2 {
compatible = "nordic,nrf-uarte";
current-speed = <115200>;
status = "disabled";
hw-flow-control;
dtr_uart0: dtr-uart {
compatible = "nordic,dtr-uart";
dtr-gpios = <&gpio0 8 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>;
ri-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
status = "okay";
};
};

pinctrl-0 = <&uart2_default_alt>;
pinctrl-1 = <&uart2_sleep_alt>;
pinctrl-names = "default", "sleep";
&gpio0 {
status = "okay";
/* Use PORT event for DTR (8) pin to save power */
sense-edge-mask = <0x00000100>;
};

&i2c2 {
status = "disabled";
};

&pinctrl {
uart2_default_alt: uart2_default_alt {
group1 {
psels = <NRF_PSEL(UART_RX, 0, 11)>;
bias-pull-up;
};
group2 {
psels = <NRF_PSEL(UART_TX, 0, 10)>,
<NRF_PSEL(UART_RTS, 0, 12)>,
<NRF_PSEL(UART_CTS, 0, 13)>;
};
};

uart2_sleep_alt: uart2_sleep_alt {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 10)>,
<NRF_PSEL(UART_RX, 0, 11)>,
<NRF_PSEL(UART_RTS, 0, 12)>,
<NRF_PSEL(UART_CTS, 0, 13)>;
low-power-enable;
};
};
};

/* Enable external flash */
&gd25wb256 {
status = "okay";
Expand Down
12 changes: 0 additions & 12 deletions app/boards/thingy91_nrf9160_ns.conf

This file was deleted.

20 changes: 15 additions & 5 deletions app/boards/thingy91_nrf9160_ns.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,26 @@

/ {
chosen {
ncs,sm-uart = &uart0;
ncs,sm-uart = &dtr_uart0;
};
};

/* DTR with DK */
&uart0 {
status = "okay";

dtr_uart0: dtr-uart {
compatible = "nordic,dtr-uart";
dtr-gpios = <&gpio0 26 (GPIO_PULL_UP | GPIO_ACTIVE_HIGH)>; /* button0 */
ri-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>; /* blue_led */
status = "okay";
};
};

&gpio0 {
status = "okay";
/* Use PORT event for DTR (26) pin to save power */
sense-edge-mask = <0x04000000>;
};

&uart2 {
Expand All @@ -21,7 +35,3 @@
&i2c2 {
status = "okay";
};

&button0 {
status = "disabled";
};
Loading