[riot-notifications] [RIOT-OS/RIOT] Atmega PWM implementation (#7542)

lebrush notifications at github.com
Thu Sep 14 20:05:24 CEST 2017


lebrush commented on this pull request.



> +
+uint32_t pwm_init(pwm_t dev, pwm_mode_t mode, uint32_t freq, uint16_t res)
+{
+    /* only left implemented, max resolution 256 */
+    assert(dev < PWM_NUMOF && mode == PWM_LEFT && res <= 256);
+    /* resolution != 256 only valid if ch0 not used */
+    assert(!(res != 256 && pwm_conf[dev].pin_ch[0] != GPIO_UNDEF));
+
+    /* disable PWM */
+    pwm_conf[dev].dev->CRA = 0x00;
+    pwm_conf[dev].dev->CRB = 0x00;
+    pwm_conf[dev].dev->OCR[0] = 0;
+    pwm_conf[dev].dev->OCR[1] = 0;
+
+    /* disable power reduction */
+    MEGA_PRR &= ~pwm_conf[dev].prr_bit;

It's a good point, but no other platform is implemented as you suggest so far. I would rather keep it here by now.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/7542#discussion_r138968692
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20170914/7ebf79e4/attachment.html>


More information about the notifications mailing list