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

Peter Kietzmann notifications at github.com
Wed Jun 10 08:31:54 CEST 2015


> +    PWM_0_DEV_CH5->PWM_CPRD = resolution - 1;
> +    PWM_0_DEV_CH5->PWM_CDTY = 0;
> +    PWM_0_DEV->PWM_ENA = PWM_0_ENA_CH5;
> +#endif
> +#if PWM_0_CHANNELS > 6
> +    PWM_0_DEV_CH6->PWM_CMR = PWM_CMR_CPRE_CLKA;
> +    PWM_0_DEV_CH6->PWM_CPRD = resolution - 1;
> +    PWM_0_DEV_CH6->PWM_CDTY = 0;
> +    PWM_0_DEV->PWM_ENA = PWM_0_ENA_CH6;
> +#endif
> +#if PWM_0_CHANNELS > 7
> +    PWM_0_DEV_CH7->PWM_CMR = PWM_CMR_CPRE_CLKA;
> +    PWM_0_DEV_CH7->PWM_CPRD = resolution - 1;
> +    PWM_0_DEV_CH7->PWM_CDTY = 0;
> +    PWM_0_DEV->PWM_ENA = PWM_0_ENA_CH7;
> +#endif

@A-Paul this is eight times the "same" code. Please look at some other drivers an see the switch block for the input device (like commented above). Just for the idea behind it compare [this](https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32f1/periph/gpio.c#L54)

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


More information about the notifications mailing list