Add support to use the extended conn create options to establish
connections on LE Coded PHY or 2M. This uses the connection options
set by bt_conn_set_scan_params.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add API to set the scan parameters used in the LE Create Connection
HCI command used by bt_conn_create_le and bt_conn_create_aute_le.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add support for the new scan options and use the LE Extended Scan
HCI commands if they are available in the controller.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Refactor scan and initiator random address handling to a helper function
so that it can be re-used.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add reference count old to new value transition in the debug print, this
makes it easier to interpret the printed line when debuggin reference
count bugs.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Extract setting advertising filter policy parameter from the adv params
options field to a helper function.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Use the scan types defined in bluetooth.h instead of the hci defined
ones. Although they have the same value it is best to avoid using the
hci.h header in applications.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Update buffer sizes needed when advertising extensions is enabled. Since
BT_RX_BUF_LEN is used for the HCI command as well we need to fit the
full 255 bytes of the Set Extended Advertising Data or Scan Response
Data plus the 3 byte header of an HCI command.
For the discardable buffer size we need to fit the LE Extended
Advertising Report event, which can be a maximum of 255 bytes plus the
2 byte header of an HCI event.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add Kconfig options to enable extendend advertising and scanning
support.
Include option to support both types of advertising
commands in case the controller capabilities is not know or the
controller is pluggable.
Include option to only support legacy advertising API, this is to
support the use-case of advertising using different identity than the
scanner or initiator.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add additional HCI defines for extended advertising. Renamed a few
parameters that are not yet in use.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add scanner API for extended scanner. This includes the options to scan
on the LE Coded PHY for long range, configuring scan timeout with scan
timeout callback and additional information received from the extended
advertising report.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Deprecate BT_LE_ADV defines in hci.h that are expected to be used by the
application in the scan received callback to identify the advertising
PDU type. These defines are mixing HCI input parameters and advertising
PDU types. Internally it is acceptable to mix these, but at the API we
should to mix in them.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Rename filter_dup parameters used for scanning filter options to the
more generic name options, and make scan filter options follow same
naming patters as advertising and initiator scan options.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add API for creating and starting advertising sets. This allows to start
and advertising set for a specific timeout or number of events.
The advertising set can be configured to advertise extended data on
secondary advertising channels or advertise on LE Coded PHY to give the
advertiser longer range.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Deprecate bt_create_conn_le and rename it to in order to add return
code, new arguments and to follow the established naming convention.
Add API for the application to control the scan parameters of the
initiator role. This allows the application more scheduling control
of the initiator in multi-role scenarios. Also provides options to
configure the initiator for LE Coded PHY for long range support.
We deprecate the old way of creating connection to make the name more
consistent with the rest of the API.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add GAP definitions for advertising PDU types and properties LE PHY
types and values that signifies either invalid or disabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Convert DT_INST_0_SIFIVE_GPIO0_IRQ_##n to use the new DT macros:
DT_INST_IRQ_BY_IDX(0, n, irq). Also tweak a use of
DT_INST_IRQ_HAS_CELL(0, irq) to DT_INST_IRQ_HAS_IDX(0, 0) to match
style.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Trivial cleanup: sort the devicetree/foo.h includes and the relevant
sections for them in the documentation.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
We have a number of cases that now look like:
#if DT_HAS_COMPAT(ti_lmp90077)
LMP90XXX_DEVICE(90077, 0, 16, 4);
#endif /* DT_INST_0_TI_LMP90077 */
The DT_INST_0_TI_LMP90077 comment is stale, and doesn't add much since
the #if associated with the #endif is just 2 lines up. Removing the old
comments seems the best cleanup.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add checks to prevent SPI transactions from being run in ISR
context. This affects both the LMP90xxx ADC and GPIO drivers.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Move calibration setup SPI transaction to acquisition thread to allow
adc_read_async() to be called from ISR context.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Introduce a dedicated function for performing an entire LMP90xxx ADC
channel read and sample all channels in one go in the ADC acquisition
thread.
This removes the SPI transactions from adc_context_start_sampling()
which can be called in k_timer ISR context for consecutive ADC reads.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This adds utility functions to irq.h in accordance with zephyr's
multi-level irq numbering schema. Functions that are added will
get the zephyr IRQs level and provide function to return the
interrupt number at a particular level.
Fixes issue #20338
Signed-off-by: Jaron Kelleher <jkelleher@fb.com>
Identify when received PUBLISH message is malformed and overall packet
length received is smaller than parsed variable header lenght.
Add unit test to cover this case.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Verify more strictly that data read from the transport fits into RX
buffer. Switch to unsigned integers, where possible, to prevent
unnecessary signed/unsigned operations.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The standard allows up to 4 bytes of packet length data, while current
implementation parsed up to 5 bytes.
Add additional unit test, which verifies that error is reported in case
of invalid packet length.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
We can build the openamp library configured with VirtIO master
support, VirtIO slave support, or both. By default both master
and slave code is enabled. We can reduce code footprint by only
build master or slave as needed.
Expose Kconfig options for Master & Slave and set them accordingly in
the sample.
Here's the code reduction we see:
For the total image we see as 1260 byte reduction:
Memory region Used Size Region Size %age Used
FLASH [Master & Slave]: 30308 B 256 KB 11.56%
FLASH [Master only] : 29048 B 256 KB 11.08%
On the remote side we see a 828 byte reduction:
Memory region Used Size Region Size %age Used
FLASH [Master & Slave]: 11564 B 64 KB 17.65%
FLASH [Slave only] : 10736 B 64 KB 16.38%
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Added properties to support the core interrupt controller on the NIOS2
cpu cores and enable that support for the NS16550 UART.
We rename some compatibles so that the cpu core compatibles is unique.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>