Add new GPIO APIs for adding shared GPIO handlers, and improve docs #850

Merged
kilograham merged 4 commits from gpio_irq_improvements into develop 2022-06-08 13:03:12 -05:00
kilograham commented 2022-06-05 17:47:19 -05:00 (Migrated from github.com)

Note this PR includes the get_core_num() change as they are dependent

Note this PR includes the get_core_num() change as they are dependent
liamfraser (Migrated from github.com) reviewed 2022-06-05 17:47:19 -05:00
lurch (Migrated from github.com) reviewed 2022-06-06 09:41:47 -05:00
@ -347,63 +353,288 @@ void gpio_set_drive_strength(uint gpio, enum gpio_drive_strength drive);
*/
lurch (Migrated from github.com) commented 2022-06-06 09:41:47 -05:00

nit: "an GPIO" -> "a GPIO"

nit: "an GPIO" -> "a GPIO"
lurch (Migrated from github.com) reviewed 2022-06-06 09:42:22 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 09:42:22 -05:00

nit: lowercase 'w' on "which"

nit: lowercase 'w' on "which"
lurch (Migrated from github.com) reviewed 2022-06-06 09:45:01 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 09:45:01 -05:00

bease -> based ?

bease -> based ?
lurch (Migrated from github.com) reviewed 2022-06-06 09:46:17 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 09:46:17 -05:00

"it callback is NULL" -> " if callback is NULL" ?

"it callback is NULL" -> " if callback is NULL" ?
lurch (Migrated from github.com) reviewed 2022-06-06 09:47:55 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 09:47:55 -05:00
Typo? https://www.doxygen.nl/manual/commands.html#cmdendcode
lurch (Migrated from github.com) reviewed 2022-06-06 09:51:23 -05:00
lurch (Migrated from github.com) commented 2022-06-06 09:51:23 -05:00

Not clear what this comment is signifying?

Not clear what this comment is signifying?
lurch (Migrated from github.com) reviewed 2022-06-06 09:57:58 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 09:57:58 -05:00

This function takes a single uint gpio, so should "specified GPIOs" be "specified GPIO" ?

This function takes a single `uint gpio`, so should "specified GPIOs" be "specified GPIO" ?
lurch (Migrated from github.com) reviewed 2022-06-06 09:59:39 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 09:59:38 -05:00

"This configures affects the..." doesn't sound right?

"This configures affects the..." doesn't sound right?
lurch (Migrated from github.com) reviewed 2022-06-06 10:33:22 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 10:33:22 -05:00

Is it worth clarifying that this is a bitmask of events, or is that fairly self-evident?

Is it worth clarifying that this is a bitmask of events, or is that fairly self-evident?
lurch (Migrated from github.com) reviewed 2022-06-06 10:34:08 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 10:34:08 -05:00

\endcode ?
(and also in multiple other places)

`\endcode` ? (and also in multiple other places)
lurch (Migrated from github.com) reviewed 2022-06-06 10:35:25 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 10:35:24 -05:00

"can be controller" -> "can be controlled"

"can be controller" -> "can be controlled"
lurch (Migrated from github.com) reviewed 2022-06-06 10:38:22 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 10:38:21 -05:00

"can be controller" -> "can be controlled"

"can be controller" -> "can be controlled"
lurch (Migrated from github.com) reviewed 2022-06-06 10:40:13 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 10:40:13 -05:00

Should this have a check_gpio_param(gpio) ?

Should this have a `check_gpio_param(gpio)` ?
lurch (Migrated from github.com) reviewed 2022-06-06 10:45:03 -05:00
lurch (Migrated from github.com) commented 2022-06-06 10:45:03 -05:00

Should this have been GPIO_CALLBACK_IRQ_ORDER_PRIORITY, or is there a reason for it being different?

Should this have been `GPIO_CALLBACK_IRQ_ORDER_PRIORITY`, or is there a reason for it being different?
lurch (Migrated from github.com) reviewed 2022-06-06 10:59:23 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 10:59:23 -05:00

I wonder if it's worth mentioning (if I've understood things correctly) that only 'edge' events can be cleared / acknowledged, and 'level' events can't be cleared? (since the corresponding fields in the INTR registers are all RO).

I wonder if it's worth mentioning (if I've understood things correctly) that only 'edge' events can be cleared / acknowledged, and 'level' events can't be cleared? (since the corresponding fields in the INTR registers are all RO).
lurch (Migrated from github.com) reviewed 2022-06-06 11:04:54 -05:00
@ -407,0 +500,4 @@
* \code{.c}
* void my_irq_handler(void) {
* if (gpio_get_irq_event_mask(my_gpio_num) & my_gpio_event_mask) {
* gpio_acknowledge_irq(my_gpio_num, my_gpio_event_mask);
lurch (Migrated from github.com) commented 2022-06-06 11:04:54 -05:00

Could it be worth adding e.g. a gpio_set_irq_enabled_with_callback_masked function which would take a bitmask of GPIO numbers? (so that the user doesn't have to make multiple separate gpio_set_irq_enabled calls)

Could it be worth adding e.g. a `gpio_set_irq_enabled_with_callback_masked` function which would take a bitmask of GPIO numbers? (so that the user doesn't have to make multiple separate `gpio_set_irq_enabled` calls)
lurch (Migrated from github.com) reviewed 2022-06-06 11:24:43 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 11:24:43 -05:00

IRQs events -> IRQ events?

IRQs events -> IRQ events?
lurch (Migrated from github.com) reviewed 2022-06-06 11:41:31 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 11:41:31 -05:00

nit: "a explicit" -> "an explicit"

nit: "a explicit" -> "an explicit"
lurch (Migrated from github.com) reviewed 2022-06-06 11:54:21 -05:00
@ -407,0 +583,4 @@
*
* In addition to the default mechanism of a single GPIO IRQ event callback per core (see \ref gpio_set_irq_callback),
* it is possible to add explicit GPIO IRQ handlers which are called independent of the default event callback.
*
lurch (Migrated from github.com) commented 2022-06-06 11:54:21 -05:00

This is probably a dumb question, but if the user has to manually check for GPIO numbers inside their callback-function themselves, what's the advantage of using these "raw handlers" over the "shared handler"? From looking at the implementation of gpio_add_raw_irq_handler_with_order_priority_masked it seems like if you added multiple raw-handlers (each with a separate callback), then each of the callbacks would get called for every GPIO IRQ that's registered to be handled by a raw-handler?
So you could just do the same thing with the shared-handler, by calling a different function depending on the GPIO number that it was passed?
No doubt I'm missing something obvious / fundamental 😕

This is probably a dumb question, but if the user has to manually check for GPIO numbers inside their callback-function themselves, what's the advantage of using these "raw handlers" over the "shared handler"? From looking at the implementation of `gpio_add_raw_irq_handler_with_order_priority_masked` it seems like if you added multiple raw-handlers (each with a separate callback), then _each_ of the callbacks would get called for *every* GPIO IRQ that's registered to be handled by a raw-handler? So you could just do the same thing with the shared-handler, by calling a different function depending on the GPIO number that it was passed? No doubt I'm missing something obvious / fundamental :confused:
lurch (Migrated from github.com) reviewed 2022-06-06 11:58:57 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 11:58:57 -05:00

current code -> current core

current code -> current core
kilograham (Migrated from github.com) reviewed 2022-06-06 11:59:32 -05:00
kilograham (Migrated from github.com) commented 2022-06-06 11:59:32 -05:00

nope it is different, but i'm adding a another constant

nope it is different, but i'm adding a another constant
lurch (Migrated from github.com) reviewed 2022-06-06 12:06:01 -05:00
lurch (Migrated from github.com) commented 2022-06-06 12:06:01 -05:00

If you use gpio_add_raw_irq_handler_masked to e.g. set up GPIOs 2, 3 and 4 to be handled by my_callback1, is it possible that you might want to switch GPIOs 2 and 4 back to the default handler, but not remove the my_callback1 handler that's still being used by GPIO 3?

If you use `gpio_add_raw_irq_handler_masked` to e.g. set up GPIOs 2, 3 and 4 to be handled by `my_callback1`, is it possible that you might want to switch GPIOs 2 and 4 back to the default handler, but **not** remove the `my_callback1` handler that's still being used by GPIO 3?
kilograham (Migrated from github.com) reviewed 2022-06-06 12:07:28 -05:00
@ -407,0 +500,4 @@
* \code{.c}
* void my_irq_handler(void) {
* if (gpio_get_irq_event_mask(my_gpio_num) & my_gpio_event_mask) {
* gpio_acknowledge_irq(my_gpio_num, my_gpio_event_mask);
kilograham (Migrated from github.com) commented 2022-06-06 12:07:28 -05:00

the events may be different, and I was disfavoring the original method only, so don't think ill change it

the events may be different, and I was disfavoring the original method only, so don't think ill change it
lurch (Migrated from github.com) reviewed 2022-06-06 12:07:30 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 12:07:30 -05:00

specified GPIOs -> specified GPIO

specified GPIOs -> specified GPIO
lurch (Migrated from github.com) reviewed 2022-06-06 12:13:46 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 12:13:45 -05:00

Should there be a PICO_CONFIG stanza for this, or is it something that you don't expect users to change?

Should there be a PICO_CONFIG stanza for this, or is it something that you don't expect users to change?
kilograham (Migrated from github.com) reviewed 2022-06-06 12:14:21 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
kilograham (Migrated from github.com) commented 2022-06-06 12:14:21 -05:00

I have renamed params and methods to be more explicitly event_mask

sadly some of the enums and indeed function names were badly/imprecisely named from the start

I have renamed params and methods to be more explicitly event_mask sadly some of the enums and indeed function names were badly/imprecisely named from the start
lurch (Migrated from github.com) reviewed 2022-06-06 12:19:59 -05:00
lurch (Migrated from github.com) commented 2022-06-06 12:19:58 -05:00

What does "non-existent GPIO" mean here, given that you're iterating from 0 to NUM_BANK0_GPIOS ?

What does "non-existent GPIO" mean here, given that you're iterating from `0` to `NUM_BANK0_GPIOS` ?
kilograham (Migrated from github.com) reviewed 2022-06-06 12:20:13 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
kilograham (Migrated from github.com) commented 2022-06-06 12:20:13 -05:00

Hmm; i wasn't event aware of that!!! cc @liamfraser, @Wren6991

I think it would probably be more confusing to change it; it is harmless as is.

Hmm; i wasn't event aware of that!!! cc @liamfraser, @Wren6991 I think it would probably be more confusing to change it; it is harmless as is.
kilograham (Migrated from github.com) reviewed 2022-06-06 12:22:17 -05:00
@ -407,0 +583,4 @@
*
* In addition to the default mechanism of a single GPIO IRQ event callback per core (see \ref gpio_set_irq_callback),
* it is possible to add explicit GPIO IRQ handlers which are called independent of the default event callback.
*
kilograham (Migrated from github.com) commented 2022-06-06 12:22:17 -05:00

Yes, you can, but only one person can set the shared calback function. Therefore if you have two independent/unrelated bits of code that want to respond to GPIO IRQ they would stomp on each other if they used the old API. Most people will continue to use the existing API, but libraries that need to hook a GPIO should add their own handler.

Yes, you can, but only one person can set the shared calback function. Therefore if you have two independent/unrelated bits of code that want to respond to GPIO IRQ they would stomp on each other if they used the old API. Most people will continue to use the existing API, but libraries that need to hook a GPIO should add their own handler.
kilograham (Migrated from github.com) reviewed 2022-06-06 13:35:36 -05:00
kilograham (Migrated from github.com) commented 2022-06-06 13:35:36 -05:00

well i'm going in steps of 8, so the comment relates to what happens if NUM_BANK0_GPIOs is not divisible by 8 (which it might not be, and indeed it is 30)

well i'm going in steps of 8, so the comment relates to what happens if NUM_BANK0_GPIOs is not divisible by 8 (which it might not be, and indeed it is 30)
lurch (Migrated from github.com) reviewed 2022-06-06 16:13:43 -05:00
@ -407,0 +583,4 @@
*
* In addition to the default mechanism of a single GPIO IRQ event callback per core (see \ref gpio_set_irq_callback),
* it is possible to add explicit GPIO IRQ handlers which are called independent of the default event callback.
*
lurch (Migrated from github.com) commented 2022-06-06 16:13:43 -05:00

Ahhh, "libraries that need to hook a GPIO should add their own handler" was the bit I was missing, thanks 😃
(is that worth clarifying in the doxygen?)

Ahhh, "libraries that need to hook a GPIO should add their own handler" was the bit I was missing, thanks :smiley: (is that worth clarifying in the doxygen?)
lurch (Migrated from github.com) reviewed 2022-06-06 16:23:59 -05:00
lurch (Migrated from github.com) commented 2022-06-06 16:23:59 -05:00

Ahhh, so I guess the fix for that would be to put a if (i >= NUM_BANK0_GPIOS) break; inside the inner for-loop? (or even change the inner for-loop itself to for(uint i=gpio;events8 && i<gpio+8 && i<NUM_BANK0_GPIOS;i++) { )

Ahhh, so I guess the fix for that would be to put a `if (i >= NUM_BANK0_GPIOS) break;` inside the inner for-loop? (or even change the inner for-loop itself to `for(uint i=gpio;events8 && i<gpio+8 && i<NUM_BANK0_GPIOS;i++) {` )
lurch (Migrated from github.com) reviewed 2022-06-06 16:28:41 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
lurch (Migrated from github.com) commented 2022-06-06 16:28:40 -05:00

nit: I guess the full-stop here ought to be a colon?

nit: I guess the full-stop here ought to be a colon?
Wren6991 (Migrated from github.com) reviewed 2022-06-07 05:24:26 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
Wren6991 (Migrated from github.com) commented 2022-06-07 05:24:26 -05:00

Yes, the level IRQs are non-latching. If we did have a register you could clear, that register would immediately re-pend anyway.

Yes, the level IRQs are non-latching. If we did have a register you could clear, that register would immediately re-pend anyway.
Wren6991 (Migrated from github.com) reviewed 2022-06-07 07:19:01 -05:00
Wren6991 (Migrated from github.com) commented 2022-06-07 07:19:01 -05:00

Should we assert that there is not already a raw IRQ for this GPIO?

Reasoning is that we unconditionally clear the raw bit in the remove function, so going add -> add -> remove on the same GPIO leaves it marked as non-raw even though it does have a raw handler installed.

Should we assert that there is not already a raw IRQ for this GPIO? Reasoning is that we unconditionally clear the raw bit in the `remove` function, so going `add` -> `add` -> `remove` on the same GPIO leaves it marked as non-raw even though it does have a raw handler installed.
Wren6991 (Migrated from github.com) reviewed 2022-06-07 07:26:50 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
Wren6991 (Migrated from github.com) commented 2022-06-07 07:26:49 -05:00

So yes if you are interrupting on GPIO level, you "clear" the IRQ by changing the IRQ enable to interrupt on the opposite level.

So yes if you are interrupting on GPIO level, you "clear" the IRQ by changing the IRQ enable to interrupt on the opposite level.
Wren6991 (Migrated from github.com) reviewed 2022-06-07 07:29:24 -05:00
Wren6991 (Migrated from github.com) commented 2022-06-07 07:29:24 -05:00

Not convinced there is anything that needs fixing here. It's not totally clear your proposed change would make anything faster -- seems like six of one, half a dozen the other.

// note we assume events8 is 0 for non-existent GPIO

This assumption is correct btw, and I believe always will be.

Not convinced there is anything that needs fixing here. It's not totally clear your proposed change would make anything faster -- seems like six of one, half a dozen the other. ``` // note we assume events8 is 0 for non-existent GPIO ``` This assumption is correct btw, and I believe always will be.
Wren6991 (Migrated from github.com) reviewed 2022-06-07 07:30:49 -05:00
Wren6991 (Migrated from github.com) left a comment

Happy with this, other than discussion about whether to assert on double-hooking the same pin, and the comment nits.

At risk of bikeshedding, I'm not crazy about the name raw, as opposed to e.g. per_pin, but I don't feel strongly enough about this to not approve

Happy with this, other than discussion about whether to assert on double-hooking the same pin, and the comment nits. At risk of bikeshedding, I'm not crazy about the name `raw`, as opposed to e.g. `per_pin`, but I don't feel strongly enough about this to not approve
Wren6991 (Migrated from github.com) reviewed 2022-06-07 07:41:41 -05:00
Wren6991 (Migrated from github.com) commented 2022-06-07 07:41:41 -05:00

Good point! I think this code works fine as long as you add/remove with the same masks, and some cases where you fail to do this will be caught by an assert on removing the same IRQ twice, but in this case you would actually just lock up the core because nobody would clear the IRQ status.

I don't see any way to fix this without excessive bookkeeping, so maybe we just need to document that add/remove must use the same mask?

Good point! I think this code works fine as long as you add/remove with the same masks, and some cases where you fail to do this will be caught by an assert on removing the same IRQ twice, but in this case you would actually just lock up the core because nobody would clear the IRQ status. I don't see any way to fix this without excessive bookkeeping, so maybe we just need to document that add/remove must use the same mask?
kilograham (Migrated from github.com) reviewed 2022-06-07 08:10:44 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
kilograham (Migrated from github.com) commented 2022-06-07 08:10:44 -05:00

ah; probably worth mentioning that then

ah; probably worth mentioning that then
kilograham (Migrated from github.com) reviewed 2022-06-07 08:14:47 -05:00
@ -124,7 +126,7 @@ enum gpio_slew_rate gpio_get_slew_rate(uint gpio) {
// Enum encoding should match hardware encoding on RP2040
kilograham (Migrated from github.com) commented 2022-06-07 08:14:47 -05:00

oops; these are the wrong way around

oops; these are the wrong way around
kilograham (Migrated from github.com) reviewed 2022-06-07 08:18:56 -05:00
kilograham (Migrated from github.com) commented 2022-06-07 08:18:56 -05:00

Good point. And adding two handlers for the same pin is silly anyway, as you are unlikely to have two different event mask handlers for the same pin. I will add an assert

Good point. And adding two handlers for the same pin is silly anyway, as you are unlikely to have two different event mask handlers for the same pin. I will add an assert
kilograham (Migrated from github.com) reviewed 2022-06-07 14:37:40 -05:00
@ -368,0 +372,4 @@
* bit | constant | interrupt
* ----|----------------------------------------------------------
* 0 | GPIO_IRQ_LEVEL_LOW | Continuously while level is low
* 1 | GPIO_IRQ_LEVEL_HIGH | Continuously while level is high
kilograham (Migrated from github.com) commented 2022-06-07 14:37:39 -05:00

i have added some blurb

i have added some blurb
kilograham (Migrated from github.com) reviewed 2022-06-07 14:38:59 -05:00
@ -407,0 +583,4 @@
*
* In addition to the default mechanism of a single GPIO IRQ event callback per core (see \ref gpio_set_irq_callback),
* it is possible to add explicit GPIO IRQ handlers which are called independent of the default event callback.
*
kilograham (Migrated from github.com) commented 2022-06-07 14:38:59 -05:00

i think these comments are outdated as I don't see the text "libraries that need to"

i think these comments are outdated as I don't see the text "libraries that need to"
kilograham (Migrated from github.com) reviewed 2022-06-07 14:45:52 -05:00
kilograham (Migrated from github.com) commented 2022-06-07 14:45:51 -05:00

fixed

fixed
kilograham (Migrated from github.com) reviewed 2022-06-08 13:02:21 -05:00
kilograham (Migrated from github.com) commented 2022-06-08 13:02:21 -05:00

ok really fixed

ok really fixed
kilograham commented 2022-06-08 13:02:53 -05:00 (Migrated from github.com)

Happy with this, other than discussion about whether to assert on double-hooking the same pin, and the comment nits.

At risk of bikeshedding, I'm not crazy about the name raw, as opposed to e.g. per_pin, but I don't feel strongly enough about this to not approve

note it isn't per pin anyway, as it can be more than one pin :-) sticking with raw for now

> Happy with this, other than discussion about whether to assert on double-hooking the same pin, and the comment nits. > > At risk of bikeshedding, I'm not crazy about the name `raw`, as opposed to e.g. `per_pin`, but I don't feel strongly enough about this to not approve note it isn't per pin anyway, as it can be more than one pin :-) sticking with raw for now
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!850
No description provided.