Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.
Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.
Updated the includes path of in-tree sources accordingly.
Most of the changes here are scripted, check the PR for more
info.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Based on information from doc/develop/api/overview.rst, add current
version for some groups representing APIs, following the following
table:
- Experimental: 0.1.0
- Unstable: 0.8.0
- Stable: 1.0.0
Also based on doc/develop/api/overview.rst, add 'since' tag to the
groups.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
spi_transceive returns number of received frames for slave mode.
This information was missing for spi_read type of functions.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
- Fixed a few improperly formatted struct
- Marked some mask definitions as internal when macros abstracting them
out already exist
- Fixed a few code blocks to add proper syntax highlightingy
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Use the defined(__DOXYGEN__) more specifically in the header to better
match i2c.h and make things more explicit. Removes the define being
setup in zephyr.doxyfile.in.
Fixes some of the deprecation notes and what to look for instead. Fixes
some typos.
The async, signal, and rtio APIs for SPI are now shown in the built docs
as would be expected.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
`@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>
The SPI dt-spec macros has been modified to make it compatible with C++.
But there are still a macros that haven't been modified completely.
And the macros are not available.
So I modified them to Adapt the new SPI dt-spec macros.
Signed-off-by: guotong ma <maguotong66@gmail.com>
Rather than the rings, which weren't shared between userspace and kernel
space in Zephyr like they are in Linux with io_uring, use atomic mpsc
queues for submission and completion queues.
Most importantly this removes a potential head of line blocker in the
submission queue as the sqe would be held until a task is completed.
As additional bonuses this avoids some additional locks and restrictions
about what can be submitted and where. It also removes the need for
two executors as all chains/transactions are done concurrently.
Lastly this opens up the possibility for a common pool of sqe's to
allocate from potentially saving lots of memory.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Add spi_cs_is_gpio(_dt) helpers to check whether SPI CS is controlled by
GPIO or not. This both improves code readability and isolates SPI
internals.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
As of today it is not possible to use SPI dt-spec macros in C++,
something known and documented. The main reason is because `cs` property
is initialized using a compound literal, something not supported in C++.
This PR takes another approach, that is to not make `cs` a pointer but a
struct member. This way, we can perform a regular initialization, at the
cost of using extra memory for unused delay/pin/flags if `cs` is not
used.
Fixes#56572
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Provides a macro and submit API for SPI drivers to support RTIO.
A copy function enables compatibility with the existing blocking API
and very easily the existing async API as well.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Add `spi_is_ready_dt` function that validates SPI DT spec
is ready and it allows the user to pass `spi_dt_spec` directly.
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Adds a new spi_transcieve_cb API which enables asynchronous
SPI transactions with callback notification.
The exist spi_transcieve_async API remains and uses the new
spi_transcieve_cb API to provide a k_poll_signal notifier.
The driver API changes to provide a callback and userdata
parameter to async transcieve. All drivers in the tree
have been updated to the change.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
Upcoming versions of breathe highlight code embedded in Doxygen blocks.
In this case, the Devicetree fragment contained invalid syntax leading
to Sphinx warnings.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Simplify spi_cs_control by removing anonymous struct around the
"gpio" field. Update SPI_CS_CONTROL_PTR_DT to match this change.
Signed-off-by: Kumar Gala <galak@kernel.org>
All in tree users are using the gpio_dt_spec so we can remove the
older gpio struct elements that have been deprecated for some
time.
Signed-off-by: Kumar Gala <galak@kernel.org>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Since gpio_dt_spec is finally available within spi_cs_control
struct, mark the old fields deprecated in order to use
gpio_dt_spec struct.
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
Co-authored-by: Jordan Yates <jordan.yates@data61.csiro.au>
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Co-authored-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
example: <irq.h> -> <zephyr/irq.h>
Issue #41543
Signed-off-by: Yuval Peress <peress@google.com>