-
Notifications
You must be signed in to change notification settings - Fork 14
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
[Draft] gpio: Add interrupt functionalities for GPIOs #8
Open
SoucheSouche
wants to merge
14
commits into
main
Choose a base branch
from
feature/gpio-interrupt
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.
Conversation
This file contains 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
SoucheSouche
changed the title
gpio: Add interrupt functionalities for GPIOs
[Draft] gpio: Add interrupt functionalities for GPIOs
Sep 5, 2022
SoucheSouche
force-pushed
the
feature/gpio-interrupt
branch
12 times, most recently
from
September 12, 2022 06:03
a81cbe6
to
a84ecda
Compare
SoucheSouche
force-pushed
the
feature/gpio-interrupt
branch
7 times, most recently
from
September 14, 2022 08:47
0ca9f8c
to
9eb6e08
Compare
SoucheSouche
force-pushed
the
feature/gpio-interrupt
branch
4 times, most recently
from
September 19, 2022 05:32
13af606
to
3525f53
Compare
This commits implements the simpliest class wrapping the basic gpio interrupt functionalities. - Setting an interrupt on a given GPIO and providing a callback function - enabling the interrupt on a given GPIO - disabling the interrupt on a given GPIO The gpio_intr_cxx example is added as a sandbox for testing during development
this commit adds: - gpio_common_cxx.hpp where the GPIONum and GPIOExceptions types are defined to make it accessible on both gpio_intr_cxx.hpp and gpio_cxx.hpp - the strong type GPIOIntrType - the conversion function from GPIOIntrType to C driver gpio_intr_type - the conversion function from GPIONum to C driver gpio_num_t
- create GPIOIsrFlag class that builds and provides ISR flags to pass to gpio_install_isr_service()
…ven GPIO number this function will also disable de interrupts on this GPIO
…thods in GPIO_intr - remove reference to GPIO_Intr from gpio_cxx.hpp to lower binary size when interrupt is not used. - gpio_intr prefix removed as it is redundant with the name of the Class. - the callback table now accepts a list a callback ona given GPIO number. - when first callback is added on a given GPIO, the generic callback is registered to the driver. - when the last callback is removed on a given GPIO, the generic callback is de-registered from the driver
…. Move isr service related method to GPIOIsr - Remove conversion functions and use get_value<>() instead - GPIOIntr is tied to a GPIO number, the user handles instances of the classes itself - GPIOIsr provides function to start and stop ISR service from the driver (WIP)
this commit also move hldr_bounce and driver_handler methods to the provate section of GPIOIntr.
SoucheSouche
force-pushed
the
feature/gpio-interrupt
branch
from
October 3, 2022 06:51
3525f53
to
e71b50c
Compare
This will force the user to have a GPIO input setup when using the interrupt functionalities.
The new constructor takes gpio number, pull mode and driver strength as parameters. This constructor by used in GPIOIntr constructor.
SoucheSouche
force-pushed
the
feature/gpio-interrupt
branch
from
October 3, 2022 06:54
e71b50c
to
84570df
Compare
Create 3 senarios running on 3 different threads. In each scenario, a GPIOIntr instance is created and 1(or 2) callback(s) is(are) registered. the example showcases the usage of lambda function, static function and non static member function as callback for GPIO interrupts.
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.
Implement the GPIO interrupt functionalities based on the esp-idf gpio driver.