forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
- Loading branch information
1 parent
dcfc3e7
commit bfb3e30
Showing
11 changed files
with
260 additions
and
8 deletions.
There are no files selected for viewing
41 changes: 36 additions & 5 deletions
41
samples/bluetooth/beacon/boards/nrf52840dk_nrf52840.overlay
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,37 @@ | ||
|
||
|
||
/delete-node/ &radio; | ||
|
||
&pinctrl { | ||
spi1_alt: spi1_alt { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 0, 28)>, | ||
<NRF_PSEL(SPIM_MOSI, 0, 29)>, | ||
<NRF_PSEL(SPIM_MISO, 0, 30)>; | ||
}; | ||
}; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
zephyr,bt-hci = &hci_spi; | ||
}; | ||
}; | ||
|
||
&spi1 { | ||
status = "okay"; | ||
|
||
pinctrl-0 = <&spi1_alt>; | ||
pinctrl-names = "default"; | ||
/delete-property/ pinctrl-1; | ||
cs-gpios = < &gpio0 31 GPIO_ACTIVE_LOW >; | ||
|
||
hci_spi: bt-hci@0 { | ||
compatible = "zephyr,bt-hci-spi"; | ||
reg = <0>; | ||
reset-gpios = <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | ||
irq-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; | ||
spi-max-frequency = <2000000>; | ||
reset-assert-duration-ms = <6>; | ||
}; | ||
}; |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
CONFIG_BT=y | ||
CONFIG_LOG=y | ||
CONFIG_BT_DEVICE_NAME="Test beacon" | ||
|
||
CONFIG_BT_HCI=y | ||
CONFIG_BT_CTLR=n | ||
CONFIG_BT_SPI=y |
34 changes: 34 additions & 0 deletions
34
samples/bluetooth/hci_spi/boards/nrf52840dk_nrf52840.overlay
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,34 @@ | ||
/* | ||
* Copyright (c) 2020 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
|
||
&pinctrl { | ||
spi1_alt: spi1_alt { | ||
group1 { | ||
psels = <NRF_PSEL(SPIS_SCK, 0, 28)>, | ||
<NRF_PSEL(SPIS_MOSI, 0, 29)>, | ||
<NRF_PSEL(SPIS_MISO, 0, 30)>, | ||
<NRF_PSEL(SPIS_CSN, 0, 31)>; | ||
}; | ||
}; | ||
}; | ||
|
||
&spi1 { | ||
compatible = "nordic,nrf-spis"; | ||
status = "okay"; | ||
def-char = <0x00>; | ||
pinctrl-0 = <&spi1_alt>; | ||
/delete-property/ pinctrl-1; | ||
pinctrl-names = "default"; | ||
|
||
bt-hci@0 { | ||
compatible = "zephyr,bt-hci-spi-slave"; | ||
reg = <0>; | ||
irq-gpios = <&gpio0 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; | ||
}; | ||
}; | ||
|
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,33 @@ | ||
/* | ||
* Copyright (c) 2020 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
|
||
&pinctrl { | ||
spi1_alt: spi1_alt { | ||
group1 { | ||
psels = <NRF_PSEL(SPIS_SCK, 0, 28)>, | ||
<NRF_PSEL(SPIS_MOSI, 0, 29)>, | ||
<NRF_PSEL(SPIS_MISO, 0, 30)>, | ||
<NRF_PSEL(SPIS_CSN, 0, 31)>; | ||
}; | ||
}; | ||
}; | ||
|
||
&spi1 { | ||
compatible = "nordic,nrf-spis"; | ||
status = "okay"; | ||
def-char = <0x00>; | ||
pinctrl-0 = <&spi1_alt>; | ||
/delete-property/ pinctrl-1; | ||
pinctrl-names = "default"; | ||
|
||
bt-hci@0 { | ||
compatible = "zephyr,bt-hci-spi-slave"; | ||
reg = <0>; | ||
irq-gpios = <&gpio0 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; | ||
}; | ||
}; |
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
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,45 @@ | ||
&pinctrl { | ||
spi1_alt: spi1_alt { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 0, 28)>, | ||
<NRF_PSEL(SPIM_MOSI, 0, 29)>, | ||
<NRF_PSEL(SPIM_MISO, 0, 30)>; | ||
}; | ||
}; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
zephyr,bt-hci = &hci_spi; | ||
}; | ||
}; | ||
|
||
&spi1 { | ||
status = "okay"; | ||
|
||
pinctrl-0 = <&spi1_alt>; | ||
pinctrl-names = "default"; | ||
/delete-property/ pinctrl-1; | ||
cs-gpios = < &gpio0 31 GPIO_ACTIVE_LOW >; | ||
|
||
hci_spi: bt-hci@0 { | ||
compatible = "zephyr,bt-hci-spi"; | ||
reg = <0>; | ||
reset-gpios = <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | ||
irq-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; | ||
spi-max-frequency = <2000000>; | ||
reset-assert-duration-ms = <6>; | ||
}; | ||
}; | ||
|
||
/{ | ||
coex_gpio: coex { | ||
compatible = "gpio-radio-coex"; | ||
grant-gpios = <&gpio1 0 (GPIO_PULL_DOWN | GPIO_ACTIVE_LOW)>; | ||
grant-delay-us = <150>; | ||
}; | ||
}; | ||
|
||
&radio { | ||
coex = <&coex_gpio>; | ||
}; |
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,37 @@ | ||
|
||
|
||
/delete-node/ &radio; | ||
|
||
&pinctrl { | ||
spi1_alt: spi1_alt { | ||
group1 { | ||
psels = <NRF_PSEL(SPIM_SCK, 0, 28)>, | ||
<NRF_PSEL(SPIM_MOSI, 0, 29)>, | ||
<NRF_PSEL(SPIM_MISO, 0, 30)>; | ||
}; | ||
}; | ||
}; | ||
|
||
/ { | ||
chosen { | ||
zephyr,bt-hci = &hci_spi; | ||
}; | ||
}; | ||
|
||
&spi1 { | ||
status = "okay"; | ||
|
||
pinctrl-0 = <&spi1_alt>; | ||
pinctrl-names = "default"; | ||
/delete-property/ pinctrl-1; | ||
cs-gpios = < &gpio0 31 GPIO_ACTIVE_LOW >; | ||
|
||
hci_spi: bt-hci@0 { | ||
compatible = "zephyr,bt-hci-spi"; | ||
reg = <0>; | ||
reset-gpios = <&gpio0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | ||
irq-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; | ||
spi-max-frequency = <2000000>; | ||
reset-assert-duration-ms = <6>; | ||
}; | ||
}; |
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,19 @@ | ||
# Workaround: Unable to allocate command buffer when using K_NO_WAIT since | ||
# Host number of completed commands does not follow normal flow control. | ||
CONFIG_BT_BUF_CMD_TX_COUNT=10 | ||
|
||
# Controller | ||
CONFIG_BT_LL_SW_SPLIT=y | ||
|
||
# Disable unused Bluetooth features | ||
CONFIG_BT_CTLR_DUP_FILTER_LEN=0 | ||
CONFIG_BT_CTLR_LE_ENC=n | ||
CONFIG_BT_CTLR_LE_PING=n | ||
CONFIG_BT_DATA_LEN_UPDATE=n | ||
CONFIG_BT_PHY_UPDATE=n | ||
CONFIG_BT_CTLR_MIN_USED_CHAN=n | ||
CONFIG_BT_CTLR_PRIVACY=n | ||
|
||
CONFIG_BT_OBSERVER=y | ||
CONFIG_BT_BROADCASTER=y | ||
CONFIG_BT_EXT_ADV=y |
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