Since the protocol doesn't have message IDs in the responses to these
update messages, there's no reliable way to know, if an update succeeded or
not. I use that fact to simplify the implementation by:
- Not providing success/failure callbacks.
- Not handling updating the variables in the client struct while
an update is in progess.
In addition to adding some tests, I tested this with the emqx server.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
Add flow rate to `enum sensor_channel` in litres per minute.
The SI unit for flow rate is cubic metres per second. Due to a sensor value
resolution of 1/100000 this unit is not granular enough for low flow rate
sensors.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Do not read extra byte when we decide to drop a frame.
Instead go directly to MODEM_CMUX_RECEIVE_STATE_SOF, so the next
flag character will start a new frame.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Commit a60f93d742 removed the delay parameter
from various SPI macros, but aimed to retain a clean migration path by
throwing a deprecation warning when the parameter is still passed. However,
the commit failed to have this feature included in the SPI_DT_IODEV_DEFINE
macro. This commit should fix the issue.
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
- Get bit ordering from DT property in SPI_CONFIG_DT.
More precisely, set LSB first if set in DT.
- Get CS polarity from DT property in SPI_CONFIG_DT.
- Add inter-word delay parameter to spi_config struct. If value is 0, the
value will be half of the period.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
The CS delay parameter did not make a distinction between the setup and
hold time of the CS, and also did not specify very fine control which
can be done usually by a native controller CS. So use the new nanosecond
DT properties to get the delay values and make distinction.
Add deprecation warning if consumer supplies the delay parameter and
make it still work the old way in that case for backward compatibility
following API lifecycle process.
Update driver API version to 1.1.0 due to this change
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Certain SPIM instances in nRF52/53/54L/54H Series provide hardware
control of the CSN (chip select) line. Although the standard SPI
drivers do not use this feature, it should be possible to configure
this line through pinctrl in case some special driver needs this.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
To avoid conflicts between the C library's `time.h` and signal.h use an
"override" header (when necessary) for C libraries that do not themselves
provide POSIX definitions in `time.h` or `signal.h`.
V2
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Create a header for satisfying POSIX conformance requirements of signal.h
that is named posix_signal.h rather than signal.h.
The primary reason for doing so, is that the de-facto owner of signal.h is
the C library.
This new header only defines required POSIX symbols that form a strict
superset over the ISO C signal.h symbols.
V2
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Create a header for satisfying POSIX conformance requirements of time.h
that is named posix_time.h rather than time.h.
The primary reason for doing so, is that the de-facto owner of time.h is
the C library.
This new header only defines required POSIX symbols that form a strict
superset over the ISO C time.h symbols.
V2
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Replaced all pointer to rvalues used for the second parameter in calls of
timespec_compare() within function timespec_to_timeout(). This might be
legal syntax in C, but leads to compile errors when timeutil.h is included
and compiled in a C++ compilation unit.
Signed-off-by: Philipp Finke <philipp.finke@sick.de>
When a connectable advertising set is stopped, the
preallocated connection object is free by calling
bt_conn_unref which triggers a call to the recycled
callback.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add XENMEM_acquire_resource wrapper to map device model related buffers.
This is required for communication with the ioreq server.
- memory
- xendom_acquire_resource:
HYPERVISOR_memory_op(XENMEM_acquire_resource)
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Replace `gnttab_get_page()`/`gnttab_put_pabes(addr)` with
`gnttab_get_pages(npages)`/`gnttab_put_pages(addr, npages)`
for supporting multi-page operation.
Note: This is a breaking change, update callers accordingly.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
Minor updates to both the k_thread_deadline_set() and
k_thread_absolute_deadline_set() API documentation.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
During testing with teensy 4.0 it was discoverd that toggling
at high frequencies led to missed steps. As per the datasheets
of step-dir drivers an active edge needs to be maintained for
a certain timerperiod, for a step to be executed.
Instead of toggling pin twice instantaneously, the current fix
halves the step period and the step-pin is toggled on the timeout
of the respective timing source.
rework stepper stepper stop
set step pin to low if the driver does not support dual edge
and increment/decrement the actual position by one
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
Add gpio_dt_spec based helpers for easier access to:
* gpio_emul_input_set
* gpio_emul_output_get
* gpio_emul_flags_get
Signed-off-by: Maximilian Werner <maximilian.werner96@gmail.com>
The IIS3DWB is a system-in-package featuring a 3-axis digital vibration
sensor with low noise over an ultrawide and flat frequency range.
The wide bandwidth, low noise, very stable and repeatable sensitivity,
together with the capability of operating over an extended temperature
range (up to +105 C), make the device particularly suitable for vibration
monitoring in industrial applications.
Datasheet: https://www.st.com/en/mems-and-sensors/iis3dwb.html
This driver is currently only supporting the polling-mode read_and_decode
APIs (both blocking and non-blocking).
This driver is based on stmemsc HAL i/f v2.9.1.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Update sensor_decoder_api.decode Doxygen to reflect changes in the
parameters, including the change from the channel parameter to
channel spec.
Signed-off-by: Alexander Apostolu <apostolu240@gmail.com>
Change name of the struct sensor_chan_spec paramater from "channel" to
"chan_spec" to reflect its type.
Signed-off-by: Alexander Apostolu <apostolu240@gmail.com>
Making the assumption, that mqtt_sn_connect does not process any incoming
data allows for this to be a very simple, additional API function instead
of adding more complexity to the connect function. This also means that the
user has to re-add predefined topics upon reconnects which don't reuse the
old session though.
Signed-off-by: Michael Zimmermann <michael.zimmermann@sevenlab.de>
This reworks the Intel audio DSP host IPC driver as a backend of
the IPC service. This is the first step to rework IPC in SOF
(Sound Open Firmware) into using a more generic IPC API instead
of a SoC specific one.
For now, it keeps the old interface to maintain usability
as it is going to be a multiple process to rework IPC
over there.
Also, the structure of the new IPC backend resembles
the SoC specific driver to make it easier to compare
between them at this first iteration. Future optimizations
will probably be needed once we start modifying the SOF
side to utilize the IPC interface.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Various drivers have their own static versions of reg_read()/reg_write().
When building for riscv the macros conflict with the driver function
causing compiler failures. Prefix them with riscv_ to avoid conflict
and move them into the unit test which is the only place they are
used.
Signed-off-by: Lee Trager <lee@trager.us>
Adds support for the user defining their own channels within the
fixed L2CAP channel range. To make this possible, the
`bt_l2cap_fixed_chan` struct and `BT_L2CAP_CHANNEL_DEFINE` macro
needed to converted to public API. In the process of doing so, the
`_destroy` parameter was removed from the `BT_L2CAP_CHANNEL_DEFINE`
macro as it was never used (fixed channels will not be destroyed over
the lifetime of the connection). `BT_L2CAP_CHANNEL_DEFINE` is renamed
`BT_L2CAP_FIXED_CHANNEL_DEFINE` to avoid confusion
The `bt_l2cap_chan_send` function is updated to be able to send data
on fixed l2cap channels.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Clang's -Wused-but-marked-unused warns when variables marked as
__unused are actually used. Logging macros can trigger this warning
depending on CONFIG_LOG_* settings, leading to noisy builds.
This change suppresses those warnings, allowing the warning flag to
be used alongside logging functionality.
Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
Implement the broadcast to unicast handover procedure,
as per the Bluetooth CAP specificiation.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move macros derived from the VIRTIO specification to a shared include.
This change allows the VIRTIO standard definitions to be referenced
from outside the driver implementation.
The following definitions have also been added:
- VIRTIO_F_VERSION_1
- VIRTIO_F_ACCESS_PLATFORM
- VIRTIO_RING_F_INDIRECT_DESC
- VIRTIO_RING_F_EVENT_IDX
- VIRTQ_AVAIL_F_NO_INTERRUPT
- VIRTQ_USED_F_NO_NOTIFY
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This commit adds the I3C handling of open-drain
timing configurations with the following changes:
- Add scl_od_min structure to i3c_config_controller for
high/low period settings
- Define Open-drain mixed bus SCL timing constants
Requirement (MIPI Specification for I3C Basic v1.2 (16-Dec-2024),
Section 4.3.11.2 & Table 49):
- The MIPI I3C specification mandates different open-drain speeds during
bus initialization as defined in
"I3C Basic Open Drain Timing Parameters".
- The first broadcast address (7'h7E+W) must be transmitted at a slower
open-drain speed to ensure visibility to all devices on the I3C bus,
including legacy I2C devices. This slow speed (minimum 200ns Thigh)
allows I2C devices to properly detect the I3C mode transition and
disable their spike filters before switching to I3C mode. After the
initial broadcast, normal I3C open-drain speeds can be used for
regular operation.
Signed-off-by: Shreehari HK <shreehari.hk@alifsemi.com>
Since the timespec_normalize() function is not branchless, and since it
can also generate a fair bit of code, make the function non-inline and
place it in timeutil.c instead.
This should save some code space on most systems.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Previously, warnings could be promoted to errors in timeutil.h. Those
warnings were of the form below.
warning: comparison is always true due to limited range of data type
warning: comparison is always false due to limited range of data type
Specifically, in the speed-optimized version of timespec_normalize() and
in the macro SYS_TICKS_TO_NSECS().
The speed-optimized version of timespec_normalize(), which used the
__builtin_add_overflow() function, was mainly intended to be branchless.
However, many targets generate branching instructions regardless.
The speed optimized version is less valuable in that case, so remove it.
Additionally, SYS_TICKS_TO_NSECS() does not generate the above warnings
when k_ticks_to_ns_floor64() is used instead of k_ticks_to_ns_floor32(),
so use the former.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Some pieces of the system may have custom types of constraints that they
define based on different effects and reasons than just the standard
"zephyr,disabling-states". To avoid every single one of these component
reinventing the wheel, make some common APIs to handle these type of
custom constraint lists.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
I am surprised this notifier didn't already report the substate id, it
seems important since different substate obviously are defined for a
reason, they can be having a different effect on the system.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
- add NXP_BOARD_SPECIFIC_MPU_SETTINGS kconfig to provide a switch
for developer if they want to use private mpu settings
CONFIG_NXP_BOARD_SPECIFIC_MPU_SETTINGS==1 | NXP default setting
CONFIG_NXP_BOARD_SPECIFIC_MPU_SETTINGS==0 | User specific
- Use DT function to get memory base address and region size for cm7
- CM33 use dts to set mpu settings
- Add REGION_CUSTOMED_MEMORY_SIZE macro provide a common mapping ways
to map actual memory_size_kb to "region_size"
- The settings of the unified memory on cm33/cm7 cores:
ocram1/flexspi2 -> REGION_RAM_NOCACHE_ATTR
ocram2/dtcm -> REGION_RAM_NOCACHE_ATTR
flexspi/itcm -> REGION_FLASH_ATTR
Signed-off-by: Lucien Zhao <lucien.zhao@nxp.com>
Allow the ZMS API to optionally accept 64 bit IDs. A typedef `zms_id_t`
is added, so that the maximum ID width can be controlled using Kconfig.
The current ATE structure is already large enough that it is possible to
reserve 64 bits for IDs without increasing its total size (128 bits).
This makes the feature a natural, low footprint alternative to Settings,
for cases where the supported key namespace must be larger than 32 bit
but not arbitrarily large.
The ATE format does have to be altered to accommodate larger IDs, but
the default "32 bit" format is left as is. Now, the `struct zms_ate`
describes one of two supported formats, selected by an `#if` condition.
In the future, it may be possible to support multiple ATE formats at
runtime, in which case the structure can be turned into a union.
In the new, "64 bit" ATEs, the `offset` and `metadata` fields are moved
into a union, because they are found to be mutually exclusive. With the
old format, the same fields are in different locations, but one of them
always gets filled with a dummy value, depending on the given ATE type.
To cover both cases, a `memset` is used, which should be optimized away
by the compiler when appropriate.
The only limitation is that the new ATE format has no room for data CRC,
but an alternative integrity check can be implemented by the caller.
Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
To avoid conflicts between the C library's `time.h` and signal.h use an
"override" header (when necessary) for C libraries that do not themselves
provide POSIX definitions in `time.h` or `signal.h`.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Create a header for satisfying POSIX conformance requirements of signal.h
that is named posix_signal.h rather than signal.h.
The primary reason for doing so, is that the de-facto owner of signal.h is
the C library.
This new header only defines required POSIX symbols that form a strict
superset over the ISO C signal.h symbols.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Create a header for satisfying POSIX conformance requirements of time.h
that is named posix_time.h rather than time.h.
The primary reason for doing so, is that the de-facto owner of time.h is
the C library.
This new header only defines required POSIX symbols that form a strict
superset over the ISO C time.h symbols.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>