Add `DT_ANY_INST_HAS_BOOL_STATUS_OKAY` as a complement to
`DT_ANY_INST_HAS_PROP_STATUS_OKAY`. This macro exists because boolean
properties not present on a node are still generated with a value of 0,
and therefore cannot be used with `DT_ANY_INST_HAS_PROP_STATUS_OKAY`.
Signed-off-by: Jordan Yates <jordan@embeint.com>
The commit adds flash_area_sectors function that allows to get information
on sector/erase page layout by flash_area object pointer instead of
index.
The only difference between flash_area_sectors and flash_area_get_sectors
is that the later calls flash_area_open internally and as such requires
flash map to be compiled in.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds FIXED_PARTITION(label) macro that allows to obtain
struct flash_area object for partition of given label.
The macro allows instantiation of partition at point of usage
and will be replacing need for defining flash map with all partition
entries.
Area obtained with the macro should not be passed to open, instead
flash_area_device_is_ready, basically equivalent of device_is_ready
should be called on the obtained pointer to check if area is ready
for use.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Move all adc driver api structs into an iterable section, this allows us
to verify if an api pointer is located in compatible linker section.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
With recent changes the regulatory domain is handled via the hostap
rather than by passing and going through the driver and hostap doesn't
have any option for forcing the regulatory domain, so, add a note to
reflect that this is implementation dependent to cover both hostap as
well other offloaded implementations.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Several of the codec helper functions used @retval incorrectly
Several functions referenced @ccid_list incorrectly
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Silicon Labs Series 2 and newer devices do alternate function
configuration fundamentally differently from Series 0 and 1. Pin routing
is done in a centralized fashion in the GPIO peripheral, as opposed to
having ROUTE registers in every peripheral. The concept of alternate
function location numbers also does not exist, functions are directly
assigned to GPIOs by their port and pin number.
This commit adds a new pinctrl driver for devices that use DBUS. It fully
makes use of pinctrl design principles as outlined in the Zephyr
documentation. The previous driver hard-codes pin properties such as filter
and pull-up/down in the driver itself, while the new driver leaves this up
to the user as configurable DeviceTree properties. The previous driver has
hard-coded support for UART, SPI and I2C, while the new driver has generic
support for all DBUS signals.
Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
Add RTIO async and RTIO stream functionalities that enables,
among all the other things, the sensor data streaming from FIFO.
RTIO stream is using both SENSOR_TRIG_FIFO_WATERMARK and
SENSOR_TRIG_FIFO_FULL triggers. The decoder currently only supports
following FIFO tags:
- LSM6DSV16X_XL_NC_TAG
- LSM6DSV16X_GY_NC_TAG
- LSM6DSV16X_TEMP_NC_TAG
Following FIFO parameters has to be defined in device tree to
correctly stream sensor data:
- fifo-watermark (defaults to 32)
- accel-fifo-batch-rate (defaults to LSM6DSV16X_DT_XL_NOT_BATCHED)
- gyro-fifo-batch-rate (defaults to LSM6DSV16X_DT_GY_NOT_BATCHED)
- temp-fifo-batch-rate (defaults to LSM6DSV16X_DT_TEMP_NOT_BATCHED)
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Traditionally threads have been initialized with a PRESTART flag set,
which gets cleared when the thread runs for the first time via either
its timeout or the k_thread_start() API.
But if you think about it, this is no different, semantically, than
SUSPENDED: the thread is prevented from running until the flag is
cleared.
So unify the two. Start threads in the SUSPENDED state, point
everyone looking at the PRESTART bit to the SUSPENDED flag, and make
k_thread_start() be a synonym for k_thread_resume().
There is some mild code size savings from the eliminated duplication,
but the real win here is that we make space in the thread flags byte,
which had run out.
Signed-off-by: Andy Ross <andyross@google.com>
The commit adds flash_area_sectors function that allows to get information
on sector/erase page layout by flash_area object pointer instead of
index.
The only difference between flash_area_sectors and flash_area_get_sectors
is that the later calls flash_area_open internally and as such requires
flash map to be compiled in.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds FIXED_PARTITION(label) macro that allows to obtain
struct flash_area object for partition of given label.
The macro allows instantiation of partition at point of usage
and will be replacing need for defining flash map with all partition
entries.
Area obtained with the macro should not be passed to open, instead
flash_area_device_is_ready, basically equivalent of device_is_ready
should be called on the obtained pointer to check if area is ready
for use.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Make controls more readable and intuitive to extend, with definition
of each control value to help disambiguate between similar controls,
such as BRIGHTNESS vs GAIN.
Move the class definition to the top of each relevant class, like it
is on Linux for the V4L2_CID_..._CLASS_BASE variables.
Signed-off-by: Josuah Demangeon <me@josuah.net>
This uses Linux V4L2 controls as a reference to give names to the
CIDs. Apply the renaming down to the drivers that use them.
Signed-off-by: Josuah Demangeon <me@josuah.net>
Refers to the CID numbers found in the Linux Kernel so that each CID
of Zephyr matches the CIDs of Linux. The new CIDs introduced in
Zephyr can then follow the same number and naming found on Linux.
No renaming of the CID macro names is done yet.
Signed-off-by: Josuah Demangeon <me@josuah.net>
The V4L2 and V4Z list of control IDs are slightly different. Use the
same CIDs as Linux, with the exact same numbers to facilitate debug
and co-development.
This also rename the GENERIC class into BASE as in Linux. No change
in the video CIDs names in this commit.
Signed-off-by: Josuah Demangeon <me@josuah.net>
The special value 0x8000 is just outside the range of an int16_t,
so this should help make sure whatever overflow behavior is entered
by using the step data structs on protocol bytes is the same as this
macro.
Signed-off-by: Olivier Lesage <olivier.lesage@nordicsemi.no>
Because the number of ACL RX buffers must be at least the number of
maximum connections plus one, increasing `CONFIG_BT_MAX_CONN` could
inadvertently lead to a build failure if the number of ACL RX buffers is
not also increased. This dependency may not be obvious to users.
To address this issue, this commit deprecates the
`CONFIG_BT_BUF_RX_COUNT` Kconfig symbol and computes the value in
`buf.h` using the new `BT_BUF_RX_COUNT` define. Note that the default
value and the minimum range value have been changed to 0 to "disable"
the option.
Additionally, to allow users to increase the number of ACL RX buffers,
this commit introduces the new `CONFIG_BT_BUF_RX_COUNT_EXTRA` Kconfig
symbol. The value of this symbol will be added to the computed value of
`BT_BUF_RX_COUNT`.
The configurations of tests and samples have been updated to reflect
these changes.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
This commit refactos set_actual_position to set_reference_position.
stepper_set_reference_position is more apt in regards to what this func
actually does
Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
when receiving the io cap request from controller, call
pairing_accept to check whether application accept the
pairing. If no, reply BT_HCI_OP_IO_CAPABILITY_NEG_REPLY.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
This API gives better control on L2CAP COC credits and suits better
for Upper Tester implementation.
Co-authored-by: Szymon Janc <szymon.janc@codecoup.pl>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Add macro definitions for device drivers to instantiate API structs
into iterable sections and to evaluate them.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
The device enumeration feature requires all devices
to place their API implementation in linker sections
by api type. This commit adds a script which uses
the tag __subsystem to identify all existing driver
API types and generate iterable sections for them.
The script is invoked from the top CMakeLists.txt
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
Co-authored-by: Pieter De Gendt <pieter.degendt@basalte.be>
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
On Arm Cortex R52, cache segregation policy controls the
number of L1 I/D cache ways that are allocated to Flash
and AXIM interface. Adding Kconfig options for configuring
it.
Writing to IMP_CSCTRL is only permitted before the caches
have been enabled, following a system reset.
Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
Instead of requiring one big buffer for formatting the output,
have a walk function that can be used to generate output by
one metric at a time.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Remove the "static" from HTTP service definition macro so that
user is able to add it or leave it out if needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add collector parameter to metric creation macros so that it
is possible to bind the metric to collector already at built
time.
Also add optional user_data to metric macro calls so that user
can add optional data there. This will be used by network statistics
Prometheus support in subsequent commits.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
When creating prometheus network statistics variables, we need
to map the variables back to the collector, so add a backpointer
to it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Embed "struct prometheus_metric" to individual metric like
counter, gauge, histogram and summary. This way we avoid having
a separate base pointer in specific metrict struct. We also do
not need to search the specific metric from base metric as
we can simply use CONTAINER_OF() macro to get the base metric.
This embedding means that the counter, gauge, histogram and summary
metric define macros are changed as user does not need to create a
separate "struct prometheus_metric".
Convert the tests and sample to use the new macros.
Remove also the static from metric creation macros so that user
can decide whether it needs collector to be static or not.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Instead of allocating space for description and label name + value,
have a const pointer for it. The data is set typically statically
when the metric is defined, so there should be no need to allocate
separate buffer for those strings.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This is similar function as add, but will add the difference of
previous value and the new one. This can be used if we want to
periodically update the value with a new one but don't want to
keep track of the old one.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This refactors internal bits out of the public API header file
and into its own file. This includes:
* Driver API struct which is only used by driver implementations
but not by users of API.
* Inline implementations of various APIs.
* Inline z_impl_*.
These are implementation details that do not need to live within
the public API header file. This de-clutters the public header
file.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit adds the clock driver for WCH CH32V003.
Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>
This commit adds the pinctrl driver for WCH CH32V003.
Signed-off-by: Michael Hope <michaelh@juju.nz>
Signed-off-by: Dhiru Kholia <dhiru.kholia@gmail.com>