Commit graph

52060 commits

Author SHA1 Message Date
Kieran Mackey 38ed9c885e drivers: dac: added driver for Microchip MCP4725
The MCP4725 is a single channel 12 bit DAC. It is controlled via I2C.

Signed-off-by: Kieran Mackey <kieran.mackey@lairdconnect.com>
2021-05-06 11:07:33 -05:00
Torsten Rasmussen 25578be909 cmake: rework empty zephyr libraries handling.
This is an update to #34289.

When using CMake <=3.18 an interface library may not use the property
SOURCES.

Therefore, if an interface lib is added to the list of ZEPHYR_LIBS, then
CMake <=3.18 will raise the following error:
```
CMake Error .... (get_property):
  INTERFACE_LIBRARY targets may only have whitelisted properties.
  The property "SOURCES" is not allowed.
```

Therefore the check has been reworked into two steps.
First ensure all libs are static, and if they are, then check if they
are empty and not imported.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-06 18:06:32 +02:00
Andrzej Głąbek 96f20cfb99 drivers: i2c_nrfx_twim: Remove extra path for zero-length transfers
nrfx 2.5.0 release includes the patch in the nrfx_twim driver that
fixes the driver behavior for zero-length transfers. No need to keep
the same fix in the shim layer.
This effectively reverts cb86a2b306.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-05-06 17:46:14 +02:00
Andrzej Głąbek 3d609d7e5a modules: hal_nordic: Update nrfx to version 2.5.0
Update the hal_nordic module revision, to switch to nrfx v2.5.0.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-05-06 17:46:14 +02:00
Trond Einar Snekvik 1649f2fc4a samples: bluetooth: iso_receive: Convert to new k_work API
Converts the sample to the new k_work API, and introduces a blink
boolean to catch cancel failures.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-05-06 10:12:59 -05:00
Trond Einar Snekvik 27a4c91ac5 samples: bbc_microbit: pong: Convert to new k_work API
Converts the bbc_microbit pong sample to new k_work API.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-05-06 10:12:59 -05:00
Lukasz Maciejonczyk 103b516a3c net: openthread: add Link Metrics API
This commit implements the OpenThread APIs to configure Enhanced-ACK
Based Probing in radio for a specific Initiator. This is needed for
Link Metrics functionality.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-05-06 09:57:15 -05:00
Emil Lindqvist f3f8af4cc2 drivers: modem: ublox-sara-r4: make reset pin optional
Remove reset pin requirement from devicetree as this
is not required for modem functionality, and is not
used in the driver anyways.

Signed-off-by: Emil Lindqvist <emil@lindq.gr>
2021-05-06 09:44:19 -05:00
Thomas Stranger 8b156dfc85 tests: spi: convert nucleo_g474re to define prescaler in dt
As the nucleo_g474re was converted to define clock properties
in devicetree, this commit makes the ncecessary changes such that
the ncecessary test properties are still applied.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Thomas Stranger 04ee034f4b drivers/dma: stm32 fix dmamux request id valid check
The request id is given by the DMA request MUX id which start at offset
1 and are vaid until req_nb + gen_nb.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Thomas Stranger 3c87b7acaa tests: spi: add nucleo_g431rb to spi_loopback test in async mode
Add nucleo_g431rb to spi_loopback test using spi async configuration.
Such that tests do not only run with syncronous spi configuration
(nucleo_g474re), but also with the asyncronous configuration.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Thomas Stranger a3967cefa4 tests: dma: add nucleog474re board
Add nucleo_g474re board to dma/chan_blen_transfer and dma/loop_transfer
tests.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Thomas Stranger edca247dbd tests: uart_async_api: add nucleo_g474re board
Adds nucleo_g474re board to the uart_async_api test.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Thomas Stranger 0baa7d63b1 dts: stm32g4: fix dmamux number of dmamux request inputs
For dmamux nodes the dma-requests property specifies the number of
peripheral request inputs(not nr. of request trigger inputs).
This commit fixes this for g4 series.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-06 09:28:33 -05:00
Piotr Pryga ce56f046e5 bluetooth: Fix cte_type value in periodic adv sync report
Periodic advertising sync report returned wrong cte_type value.
This commit fixes the problem.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 7cdbeb541a Bluetooth: controller: Use common mem_link_rx for node_rx_iq_report
Change use of dedicated memory pool for linked list nodes for
node_rx_iq_report to common mem_link_rx. Former solution had
a drawback. Released link nodes may be enqueued to wrong memory
pool. E.g. link related with nopde_rx_iq_report went to common
link memory pool, whereas link nodes from common pool were enqueued
to dedicated list.
The solution was working because links have the same memory layout,
just different memory pools they originated from.
The problem may occur if one of those link memory pools is reset.
Then the same link may be used by node_rx and node_rx_iq_report
at the same time, causing controller failure.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 6c76b70af6 samples: Bluetooth: Add Direction Finding connectionless Rx sample
Add an application that uses Direction Finding API for reception
and sampling of CTE in connectionless mode (periodic adverising PDUs).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 938f04ffaa Bluetooth: controller: Fix build error for non Nordic plaforms
Direction finding is implemented only for Nordic link layer.
Build was failing due to missing header files for Openisa (RiskV).
Added dummy lll_df_types.h header file to OpenISA lower link layer.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 7c834bf19d Bluetooth: host: Add handl HCI_LE_Connectionless_IQ_Report
Add handling for HCI_LE_Connectionless_IQ_Report received
from controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 105a85cdf5 Bluetooth: host: Add CTE reports receive cb API for per sync
Add new callback to periodic advertising sync callback.
The callback may be used to receive notification about CTE
reports in connectionless mode (periodic advetising sync).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 64c359bcef Bluetoot: host: Make get_per_adv_sync to be global function
The function get_per_adv_sync is used by HCI events to get
reference to periodic advertising sync object related with
handle available in handled events. Due to implementation
of Direction Finding event handlers in separate source file,
direction.c instead of putting in hci_core.c the function
get_per_adv_sync has to be globally accessible.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 6518621805 Bluetooth: host: Add CTE receive and sample enable API
Add functions that give possibility to enable or disable
CTE receive and sample in connectionless mode.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga b48fe0a7db Bluetooth: host: Add option to enable connectionless CTE RX
Add Kconfig option that will enable supprot for connectionless
CTE reception. Thanks to that it will be possible to conditionally
enable or disable support of the feature and decrease code size
if the feature is not required.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ca87766bd7 Bluetooth: controller: df: Set BT_CTLR_DF_ANT_SWITCH_RX enable
Set BT_CTLR_DF_ANT_SWITCH_RX enabled by default.
There is already added implementation that supports
this feature in controller, so it may be enabled by
default.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 4009692fcf Bluetooth: controller: Add connectionless CTE RX feat. in supp. feat. list
Add connectionless CTE RX feature to list of features supported
by controller. Add direction finding initialization in hci_core
if the feature is enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga bf7bf0bec9 tests: Bluetooth: df: Add connectionless IQ sampling enable unit tests
Add unit tests for connectionless IQ sampling functionality in
controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga c02be507fb tests: Bluetooth: df: Move UT code into connectionless_cte_tx sub dir
Before thic commit the bluetooth/df unit tests subdirectory contained
connectionless CTE TX verification. Due to the implementation of
connectionless CTE RX new set of tests will be provided.
The new functionality requires different: configuration and common
setup code. Because of that, current test code was moved to
connectionless_cte_tx subdirectory.
Code shared by all DF tests is moved to common subdirectory.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga f74a0b294c Bluetooth: controller: Dropp IQ sampl report if CTE disabled after evt end
Disable of CTE sampling for periodic advertising sync PDUs may be
interrupted by radio event. In such situation, TX thread will be
handled before RX thread delivers IQ samples report to host. In
this case RX thread would deliver IQ samples report after CTE
sampling was disabled.

To avoid such situation RX thread has to check if:
- CTE sampling is not disabled,
- CTE sampling was not requested to be disabled after start of radio
  event.

CTE sampling configuration is double buffered. Updated configuration is
swapped at the beginning of radio event.

If CTE sampling is diabled or requested to disable (next radio event
didn't start), the IQ samples report should be dropped by RX thread
and should not be delivered to host.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 6652b18d19 Bluetooth: controller: LLL: Add CTE report for per. adv. PDU with bad CRC
Add reporing of IQ samples collected for CTE attached to periodic
advertising PDUs with bad CRC.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga e884c02d92 Bluetooth: controller: Add opt. to enable CTE samplig for PDUs with bad CRC
Add Kconfig option that will enable possiblity to sample CTE attached to
PDUs that have bard CRC. Sampling is based on CTEInfo field available
in received PDU. If radio is able to parse the field correclty then
it will start sampling even the CRC is wrong.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 17d9df1c7a Bluetooth: controller: hci: Add connectionless IQ report event handler
Add handler for HCI_LE_Connection_IQ_Report event.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 582ca85e29 Bluetooth: controller: hci: Add connectionelss IQ samplig enable handler
Add handler for HCI_LE_Set_Connectionless_IQ_Sampling_Enable HCI
command.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ff24092bdd Bluetooth: controller: ULL: Add function to enable or disable CTE sampling
Add function that enables or disables CTE sampling attached to received
periodic advertising PDUs.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga b7c1c4575d Bluetooth: controller: LLL: Add CTE sampling and reporting
ULL may request LLL to start receiving and sampling CTE attached to
end of periodic advertising PDUs. When the CTE is successfully sampled,
LLL should report collected samples to ULL.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga edfb85736e Bluetooth: controller: radio: Add function to get CTEInfo from Radio reg
Nordic Radio perihperal provides possiblity to get value of CTEInfo
field parsed from received PDU. It is faster to get the information
from Radio register than parse a PDU content.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 646303834c Bluetooth: controller: LLL: DF: Add function to enable CTE receive
Add function to enable CTE receive and sampling. The function
is aimed to be used by code in lll_sync.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga d182b7169a Bluetooth: controller: Add function to update per sync event slot duration
To enable or disable CTE sampling during periodic advertising sync evnet
it is requireq to change the event duration. To make it possible new
function was added that handles the operation.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 871359d934 Bluetooth: controller: ULL: Add init of DF sync configuration
lll_sync object is used to store information for LLL to enable
or disable CTE sampling. The commit adds initialization of
lll_df_sync member of lll_sync.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 37dd38c988 Bluetooth: controller: LLL: Add DF configuration to lll_sync structure.
To enable or disable CTE sampling in periodic advertising scanner LLL
implementation lll_sync is extended by lll_df_sync member.
The lll_df_sync is a double buffer for lll_df_sync_cfg.
It will be used by LL thread to enable or disable CTE sampling and
provide configuration for sampling CTE in AoA mode.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2f4e014f14 Bluetooth: controller: ULL: Add node_rx_iq_report handling in ULL RX path
Add handling of Direction Finding node_rx_iq_report type in ULL.
This is required to correctly deliver IQ samples collected by
LLL during receive of PDU including CTE.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ff94b9f676 Bluetooth: controller: Add double buffer for DF sync configuration
CTE sampling enable or disable requests should be provided to LLL.
Double buffer of lll_df_sync_cfg is added to lll_sync for that purpose
Thanks to that:
- there is no need to synchronize LLL with LL thread
- LLL has always access to valid configuration (new or former)

The configuration is stored in double buffer as instances
of lll_df_sync_cfg, not as pointers. This is the only
difference between double buffer pattern used to store adverising PDU.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga aa51f0a0dc Bluetooth: controller: Add DF per. adv. sync. configuration stucture
Add new structure lll_df_sync_cfg to store DF configuration
for periodic advertising synchronization.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 4d706bb6fb Bluetooth: controller: Add IQ report mem pool management
Add functions that will allow to mangage IQ reports memory pool
e.g. allocate or relase new IQ report nodes.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga bdaf4eed9a Bluetooth: controller: New node_rx type for IQ sample report
Add new kind of node_rx type that will store IQ samples report.
The structure includes node_rx_hdr and may be used by the same
queues that are used to forward regular node_rx_pdu objects
between LLL and ULL.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2aa8431c87 include: Bluetooth: hci: Add LE connectionelss IQ samples report event
Add HCI_LE_Connectionless_IQ_Report event that will allow controller
to report received CTE and provide collected IQ samples to host.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga ddece2501d include: Bluetooth: hci: Add LE set connectionless IQ sampling enabled
Add new command HCI_LE_Set_Connectionless_IQ_Sampling_Enable that
will allow host to enable CTE sampling in controller.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 8ceaea179c include: Bluetooth: hci: move command to appropriate position in file
All commands are put in the file according to OpCode Command Field
increasing order. bt_hci_cp_le_set_cl_cte_tx_enable was written in
wrong position. This commit moves it to correct one.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 68704c8cb1 Bluetooth: controller: Add Kconfig option to enable conn-less CTE sampling
Direction Finding support requires possibility to receive and sample CTE
attached to periodic advertising PDUs. New option will be used to enable
or disable the functionality. New option is introduced to avoid using
double statements checking if BT_CTLR_DF_CTE_RX and BT_CTLR_SYNC_-
-PERIODIC are enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2e1e8aff8d Bluetooth: controller: Add Kconfig option to enable debugging code in DF
To avid enabling HCI drived debugging, like in other controller source
files, Direction Finding has its own option BT_CTLR_DF_DEBUG_ENABLE.
This gives fine grained control deubgging output.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Piotr Pryga 2f7b0b7392 Bluetooth: controller: Disable not implemented DF features
Set to disabled not yet implemented Direction Finding features.
The features will be enabled by default when they are implemented.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00