-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Samples: Introduce device_deinit()
sample
#89927
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
Open
bjarki-andreasen
wants to merge
6
commits into
zephyrproject-rtos:main
Choose a base branch
from
bjarki-andreasen:nrfx-spim-deinit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Samples: Introduce device_deinit()
sample
#89927
bjarki-andreasen
wants to merge
6
commits into
zephyrproject-rtos:main
from
bjarki-andreasen:nrfx-spim-deinit
+458
−16
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
device_deinit()
sample
23af243
to
4b2375f
Compare
Note I'm all for chaning the name of the sample and its location :) |
Add DEVICE_DEINIT variants of SPI_DEVICE_ macros. These include - SPI_DEVICE_DT_DEINIT_DEFINE() - SPI_DEVICE_DT_INST_DEINIT_DEFINE() Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Implement device deinit fn for nrf spim device driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Implement deinit op in spi_nrfx_spi.c Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Introduce clearirqhandler which clears the irq handler of a peripheral. Useful for device_deinit(). Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Implement deinit op for NXP LPSPI device driver. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Introduce device deinit sample which demonstrates how to share hardware resources between application and device drivers using device_deinit(), specifically between a GPIO port and SPI peripheral. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
4b2375f
to
e34168b
Compare
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: MFD
area: Samples
Samples
area: SPI
SPI bus
DNM
This PR should not be merged (Do Not Merge)
platform: nRF
Nordic nRFx
platform: NXP Drivers
NXP Semiconductors, drivers
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.
Introduce sample which switches ownership of a pin between a GPIO controller and a SPI controller driver, specifically the CS. This specific usecase has been requested before to be able to monitor the CS pin using GPIO to then wake up and switch to SPI when asserted. Its also a generally useful and portable sample of
device_deinit()
,device_init()
and deferred init.With this, the SPI API is updated with new headers for the _DEINIT variants of SPI_DEVICE_DT_DEFINE, and select SPI device drivers are updated to implement device deinit, drivers for the nRF SPI, nRF SPIM, and NXP LPSPI