-
Notifications
You must be signed in to change notification settings - Fork 677
[TEST ONLY] BACKPORT SPIM to 3.7.99-ncs3-branch #2951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
bjarki-andreasen
wants to merge
17
commits into
nrfconnect:v3.7.99-ncs3-branch
from
bjarki-andreasen:nrf54h-branch-update-nrfx-spim
Closed
[TEST ONLY] BACKPORT SPIM to 3.7.99-ncs3-branch #2951
bjarki-andreasen
wants to merge
17
commits into
nrfconnect:v3.7.99-ncs3-branch
from
bjarki-andreasen:nrf54h-branch-update-nrfx-spim
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…able Instead of raw register access. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no> (cherry picked from commit fa46eec)
So that pin configuration can be queried. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no> (cherry picked from commit bea0a06)
…t_config The nRF GPIO hardware does not store the initial output value set resulting from gpio_pin_configure() and thus, when gpio_get_config() is used, the initial value is not returned. This commit just reads the output value and sets the INIT value to match in gpio_get_config(). Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit 0826996)
Implement PM_DEVICE_RUNTIME for gpio_nrfx.c PM is required to request/release the GPD domain if such exists for a given GPIO instance. Without this, every single API call will result in a requesting the GPD domain, which makes it slow and unusable from ISRs, given GPD requires IPC. Now, user can simply get the GPIO before using it, and put it once done, calling the APIs from ISR while resumed. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit c4d475c)
…is set to no-connect Fixes a bug in nrfx spi when used in modes where only MOSI is needed such as driving a WS2812. In this mode NRFX_ASSERT() is triggered when sck pin is configured as no-connect. Signed-off-by: Anthony Williams <anthony289478@gmail.com> (cherry picked from commit 291a688)
Add compile time detection if fast SPIM instances are used and system managed device PM is enabled. This configuration is not supported. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no> (cherry picked from commit d8dc241)
… SPIM instances Add FOREACH macro which iterates over all SPIM instances and creates device instances for each enabled instance. Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no> (cherry picked from commit 9d59e03)
…odes Instead of explicitly defining the SPIM instances that need it. Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no> (cherry picked from commit a068709)
…ut_all Implement calling spi_context_cs_get_all() and spi_context_cs_put_all() in line with pm resume/suspend. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit acbed8a)
The nrxf_spim driver currently resumes itself for the duration of a transfer, however, in case SPI_LOCK_ON is used, the driver needs to keep itself resumed until spi_release() is called. Currently, this results in unbalanced suspend as the bus puts itself both after transaction is done, and when spi_release() is called. This patch makes the driver check if SPI_LOCK_ON is set once transaction is complete, if yes, selv get one more time to account for the two puts which will follow. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit 8cf519d)
Make clear in the include/ header that data frame size is the same thing as word size for the context of this API. Also, add some comments to the spi_context to make it easier for driver writers to understand how to use the functions, by noting the meaning of the dfs and len parameters to the update functions. Otherwise it takes some time to understand what they mean. Signed-off-by: Declan Snyder <declan.snyder@nxp.com> (cherry picked from commit ca829e1)
Extract the lock condition to a dedicated variable to make future changes clearer. Signed-off-by: Jordan Yates <jordan@embeint.com> (cherry picked from commit ebc2ca5)
Update the context state parameters when the context is already locked. This allows changing the callback information for asynchronous operations while the context is locked. Signed-off-by: Jordan Yates <jordan@embeint.com> (cherry picked from commit 13df3b9)
Add functions to get remaining length in the transfer. Refactor a bit to avoid duplicate code for the for loop that is the same as in the total length function. The difference between the total length and left length function is that the current buffer total length is counted in the former and the current buffer remaining length is counted in the latter. Signed-off-by: Declan Snyder <declan.snyder@nxp.com> (cherry picked from commit 0bb7ccb)
Personally I found this file hard to understand at first, but since now it is clear to me, I decided to put these comments with my understanding to help anyone else who needs to use these. Signed-off-by: Declan Snyder <declan.snyder@nxp.com> (cherry picked from commit 0b843be)
Introduce spi_context_cs_get() and spi_context_cs_put() which shall be used from drivers to get/put the GPIO port the CS GPIO belongs to before and after a transaction, in line with the SPI drivers pm action hook being called. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit cbd9535)
TEST ONLY This commit adds cs-gpios and zephyr,pm-device-runtime-auto; to spi instances used for the loopback test. PORT 7 PIN 0 is used for CS. It also ups the SPI freq to 10MHz. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
e47b583
to
776d97e
Compare
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR which backports a ton of NRFX SPI and GPIO driver commits