[riot-notifications] [RIOT] [WIP] cpu/sam3x8e: Add pwm implementation (#3170)

Peter Kietzmann notifications at github.com
Mon Jun 8 09:21:05 CEST 2015


> +            prea = prea + 1;
> +            diva = diva >> 1;
> +        }
> +        frequency = F_CPU / ( ( resolution * diva) << prea);
> +    }
> +
> +    retval = frequency;
> +
> +    /* Activate PWM block by enabling it's clock. */
> +    PMC->PMC_PCER1 = PMC_PCER1_PID36;
> +
> +    /*!
> +     * PWM ID is ID_PWM (36).
> +     * \note { Is there any choice? }
> +     */
> +    pwm = PWM_0_DEV;

This gives no abstraction. Either you introduce a switch-case or you try to implement a much more efficient implementation like in  #3127. This would be really cool :-) but also hard for the beginning I guess.

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/3170/files#r31891049
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20150608/d8d72c89/attachment.html>


More information about the notifications mailing list