Updated the implementation of the GPIO_PORT_PIN_MASK_FROM_DT_NODE and
GPIO_PORT_PIN_MASK_FROM_DT_INST macros to support
"gpio-reserved-ranges" device tree property.
Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
Added
* GPIO_DT_RESERVED_RANGES_NGPIOS(node_id, ngpios),
* GPIO_DT_RESERVED_RANGES(node_id),
* GPIO_DT_INST_RESERVED_RANGES_NGPIOS(inst, ngpios) and
* GPIO_DT_INST_RESERVED_RANGES(inst)
as DT gpio's "gpio-reserved-ranges" property missing support.
The array of pins range pairs as shown below now works.
Also implemented paired extended versions of
GPIO_PORT_PIN_MASK_FROM_NGPIOS macro:
* GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(node_id, ngpios) and
* GPIO_DT_INST_PORT_PIN_MASK_NGPIOS_EXC(inst, ngpios)
with reserved (ie EXCluded) pins support too.
The implementation constraint is inherited from common DT limitations:
a maximum of 64 pairs can be used, i.e. theoretically no more than
128-bit gpio ports are supported (but resulted bitmask is actually
limited by the size of gpio_port_pins_t type).
Usage example:
The reserved mask, defined in the device tree as:
gpio0: gpio0 {
....
ngpios=<32>;
gpio-reserved-ranges = <0 8>, <9 5>, <15 16>;
....
};
and used in driver configuration as:
{
...
.gpio_reserved = GPIO_DT_RESERVED_RANGES(DT_NODELABEL(gpio0)),
.pin_port_mask = GPIO_DT_PORT_PIN_MASK_NGPIOS_EXC(
DT_NODELABEL(gpio0),
DT_PROP(DT_NODELABEL(gpio0), ngpios)),
...
}
correctly converts to:
.gpio_reserved = 0x7fffbeff, 0b01111111 11111111 10111110 11111111)
.pin_port_mask = 0x80004100, 0b10000000 00000000 01000001 00000000)
Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
Add auxiliary lists Z_SPARSE_LIST_ODD_NUMBERS and
Z_SPARSE_LIST_EVEN_NUMBERS. These lists were originally created for
GPIO_DT_RESERVED_RANGES_NGPIOS macro, but may be useful for others
applications too.
Signed-off-by: Andrey VOLKOV <andrey.volkov@munic.io>
`@param` can't be used to document struct fields. Inline each field
documentation and improve it.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Since flags can use either 16/32-bit depending on
CONFIG_SPI_EXTENDED_MODES, add a new opaque type that uses the correct
bit-width depending on that option. This allows us to simplify the
structure layout.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
`spi_cs_control` `cs` field is no longer a pointer, but a struct member.
Clarify it must be zero-initialized if not used. Remove confusing
comment about the need to use `device_is_ready()` on `cs` field,
`spi_is_ready_dt()` is the only thing users need to do.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Capitalized group name to preserve alphabetical order in device driver APIs
list, and fixed minor typo (backed->backend)
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Supplement the documentation pm_device_is_powered()
adding that a device is assumed powered in case
the device does not support PM or is not on a power domain.
Signed-off-by: Marcel Krüger <marcel.krueger@ithinx.io>
Fixes erroneous packing/unpacking of model app list messages
in the configuration client and server. According to the mesh 1.1
protcol spec (4.3.1.1) two app indexes shall be packed in a 3 octet
interleaved format. The current implementation packs them in 4 octets.
This commit also provide a helper function for unpacking key indexes
as public API to facilitate future config model callback API.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Add a user possibility to set a callback for receiving a new function.
It allows instant performing some actions, that need to be done before
context switch.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Verify validity of a received command before passing it to the general
handler.
It allows performing some actions, right after receiving the command.
The context switch is not needed. Such feature may be needed for
overloaded system, where instant reboot is required.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Add a function to signal a new host command by a backend.
Use a function instead of giving semaphore, because it allows more
actions on rx event, common for all backends.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Add a config to save the final result of a last host command that has
sent EC_HOST_CMD_IN_PROGRESS response. To get the final result use the
ec_host_cmd_send_in_progress_status function.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Removed the unneccessary casts in the functions to remove warnings
during build for SoCs using RAT. Functionality reamins the same,
tested on board.
Signed-off-by: L Lakshmanan <l-lakshmanan@ti.com>
Some drivers do not implement set_orientation().
To prevent crashes, just error out when not implemented.
Fixes: #57277
Signed-off-by: David Bongartz <david.bongartz@gmail.com>
This introduces support for Wi-Fi network managers in Zephyr. The
motivation is for the Wi-Fi management layer to work with both
Network managers and offloaded Wi-Fi drivers. The device driver
decides which one to use.
network manager : Apps -> Wi-Fi Mgmt -> Network Manager -> Wi-Fi
interface
offloaded : Apps -> Wi-Fi Mgmt -> Wi-Fi offloaded interface
Support for multiple network managers has been added, each device can
choose its own network manager and there can be mix and match:
wlan0 - Offloaded
wlan1 - Network manager 1
wlan2 - Network manager 2
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Decouple interface and Wi-Fi APIs, Wi-Fi APIs are common independent of
Wi-Fi offload or implemented natively (This is preparation for
introducing Native Wi-Fi).
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Add Pin Function Controller tables of registers and their bits
for ARM64 Renesas R-Car family. With this changes we can use
Renesas PFC driver for configuring bias and driving capabilities.
Add only needed driver strength and bias pins to PFC,
e.g. SDx and UART TX/RX pins.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Added Region based Address Translation (RAT) module driver. Required by
a few Texas Instruments SoCs to fucntion. Uses
sys_mm_drv_page_phys_get() API with device_map() for address translation.
Signed-off-by: L Lakshmanan <l-lakshmanan@ti.com>
- This includes the driver, test app, and sample app
- Only the boards\arm\xmc47_relax_kit board is supported for now
Signed-off-by: Bill Waters <bill.waters@infineon.com>
Removes redundant ACK state from `struct ieee802154_context` and
simplifies the ACK procedure.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This change introduces test coverage for association request and
response. Based on this coverage, several closely related issues were
found in the association process which cannot be split into separate
changes without breaking the build.
Most notably did the associate and disassociate net_mgmt commands send
already encoded IEEE 802.15.4 MPDUs to L3 rather than L2. L3 treated
them as payload and made L2 wrap them with another LL header/footer
which produced invalid packets.
The tests also enforce better aligment of the association process with
the IEEE 802.15.4-2020 standard:
* Association requests now ask for ACK as required by the standard. The
fake driver was enhanced to produce ACK packages when requested.
* macPanId and macCoordinator* MAC PIB attributes are set in the right
order for improved filtering of association responses.
* The coordinator may decide not to assign a short address to the end
device even when associated. This is now supported.
* The coordinator may or may not use a short address. Coordinators
choosing not to support short addresses are now supported.
* Updating the association will now remove any previously added short
address from the hardware filter.
* The short address may no longer be changed by the user while
associated to a PAN. Only the coordinator is allowed to allocate short
addresses.
* Validation of outgoing and incoming association request/response
packets is improved.
All changes are documented by pointers into the spec.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Calculates macResponseWaitTime and applies it to the association
process.
As the timing calculation re-uses symbol period calculations and other
PHY timing constants previously introduced, these are now shared as
utility functions.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
The additional hooks provide infrastructure to construct
rules on another network stack levels. Main benefit of this
approach is packets are pre-parsed and e.g. IP filter is
easier to implement. These hooks are equivalent of prerouting
and local_in in linux's netfilter.
Signed-off-by: Marcin Gasiorek <marcin.gasiorek@nordicsemi.no>
Adds an assertion for the GCC toolchain to check whether the K_SPINLOCK
block was left without unlocking the spinlock, e.g. by calling break,
return or goto.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
While the LOCKED pattern is universally useful it can be misused. This
change therefore exposes the LOCKED pattern with extensive usage
documentation to reduce the risk of abuse or unintended deadlock.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
This patch refactors the usage of MS OS 2.0 descriptors in the
WebUSB sample. The function subset header was removed since it
is not allowed for non-composite devices.
Also, a new random GUID was added for automatic driver installation.
Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
The current API for changing the bondable mode uses the global flag.
With Zephyr support for multiple Bluetooth identities, the API for
changing the bondable mode should be more fine-grained.
The bondable requirements of one identity should not have an impact on
another identity which can have a different set of requirements.
This change introduces function to overlay bondable flag per
connection.
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
Add the _VARGS variant of DT_FOREACH_NODE and
DT_FOREACH_STATUS_OKAY_NODE for when we want to do some kind of
operation on all the nodes in the tree.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add `k_event_test`, a helper function around `k_event_wait` which is
intended as an equivalent to `atomic_test_bit` in the atomic API.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Update the return value of functions that modify the internal event
state from `void` to `uint32_t`, so that calling code can determine
whether the event was already in a given state, or if the call modified
it.
This simplifies the usage of `struct k_event` as an alternative to
`atomic_t` that users can block on.
Implements #57216
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>