[riot-notifications] [RIOT-OS/RIOT] cpu/sam0_common: move PWM to common code, add support for saml21, samd5x (#14007)
notifications at github.com
Sun May 3 21:07:18 CEST 2020
@benpicco commented on this pull request.
> + | GCLK_CLKCTRL_GEN(cfg->gclk_src)
+ | GCLK_CLKCTRL_ID(cfg->tim.gclk_id);
+ PM->APBCMASK.reg |= cfg->tim.pm_mask;
+static void poweroff(pwm_t dev)
+ const pwm_conf_t *cfg = &pwm_config[dev];
+ GCLK->PCHCTRL[cfg->tim.gclk_id].reg = 0;
+ *cfg->tim.mclk &= ~cfg->tim.mclk_mask;
+ PM->APBCMASK.reg &= ~cfg->tim.pm_mask;
+ GCLK->CLKCTRL.reg = GCLK_CLKCTRL_GEN_GCLK7
I guess the idea was to connect it to an unused GCLK so the original one can be turned off if it runs ondemand.
This was there already, I just kept that part - I can check if it makes any difference to power consumption (if something other than `SAM0_GCLK_MAIN` is used), I'd be happy to drop it.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications