Skip to content
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

cpu/sam0_common: GPIO always default to MAIN clock for EXTI, make configurable #14320

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

benpicco
Copy link
Contributor

Contribution description

Currently only samd21 used the 32 kHz clock for EXTI which makes it miss fast events.
All newer members of the family use the MAIN clock.

While touching this, also make the clock source configurable to this can be overwritten, e.g. in the board config if desired.

Testing procedure

GPIO interrupts should still work.

Issues/PRs references

@benpicco benpicco added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: cpu Area: CPU/MCU ports labels Jun 19, 2020
@benpicco benpicco requested a review from MrKevinWeiss as a code owner June 19, 2020 10:38
@benpicco benpicco force-pushed the cpu/sam0_common-gpio_gclk branch from 8025eca to ea209b4 Compare June 19, 2020 10:39
@benpicco benpicco requested review from dylad, fjmolinas and keestux June 19, 2020 10:39
Currently only samd21 used the 32 kHz clock for EXTI which makes it miss fast events.
All newer members of the family use the MAIN clock.

While touching this, also make the clock source configurable to this can be overwritten,
e.g. in the board config if desired.
@fjmolinas
Copy link
Contributor

It seems that using the 32Khz clock was introduced in #6160, seems like it was done to have the GPIO working in low power modes, is this something that is arleady handled in gpio_pm_cb_enter?

@benpicco
Copy link
Contributor Author

is this something that is arleady handled in gpio_pm_cb_enter?

Yes gpio_pm_cb_enter will configure the 32kHz clock and gpio_pm_cb_leave will restore the main clock.
Actually it already does this now, so when waking from resume the EXTI peripheral will already run off the main clock in master.

Copy link
Contributor

@fjmolinas fjmolinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, GPIO irq stil work on samr21-xpro.

2020-06-23 22:47:46,204 # main(): This is RIOT! (Version: 2020.07-devel-1284-gc0203a-pr-14320)
2020-06-23 22:47:46,210 # This application allows you to test the CPU power management.
2020-06-23 22:47:46,215 # The available power modes are 0 - 2. Lower-numbered power modes
2020-06-23 22:47:46,221 # save more power, but may require an event/interrupt to wake up
2020-06-23 22:47:46,224 # the CPU. Reset the CPU if needed.
2020-06-23 22:47:46,226 # mode 0 blockers: 1 
2020-06-23 22:47:46,228 # mode 1 blockers: 0 
2020-06-23 22:47:46,229 # mode 2 blockers: 0 
2020-06-23 22:47:46,231 # Lowest allowed mode: 1
2020-06-23 22:47:46,234 # using BTN0 as wake-up source
> 2020-06-23 22:47:46,495 #  BTN0 pressed.
2020-06-23 22:47:46,496 # BTN0 pressed.
2020-06-23 22:47:46,638 # BTN0 pressed.
2020-06-23 22:47:46,639 # BTN0 pressed.
2020-06-23 22:47:47,270 # BTN0 pressed.
2020-06-23 22:47:47,271 # BTN0 pressed.
2020-06-23 22:47:47,388 # BTN0 pressed.
2020-06-23 22:47:47,505 # BTN0 pressed.
2020-06-23 22:47:47,616 # BTN0 pressed.
2020-06-23 22:47:48,387 # BTN0 pressed.
2020-06-23 22:47:48,388 # BTN0 pressed.
2020-06-23 22:47:49,560 # BTN0 pressed.
2020-06-23 22:47:49,561 # BTN0 pressed.
2020-06-23 22:4750,241 # BTN0 pressed.


@fjmolinas fjmolinas merged commit a73b61e into RIOT-OS:master Jun 23, 2020
@benpicco benpicco deleted the cpu/sam0_common-gpio_gclk branch June 23, 2020 22:04
@miri64 miri64 added this to the Release 2020.07 milestone Jun 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: cpu Area: CPU/MCU ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants