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

Peter Kietzmann notifications at github.com
Mon Jun 8 09:00:03 CEST 2015


> + * Disable GPIO and set peripheral A/B ("0/1") for pwm channel pins.
> + *
> + * \todo { Find out why simple assignment '=' isn't working although
> + * registers are Read only}
> + * \todo { Extend macro use }
> + */
> +#define PWM_0_CHAN_PIN_SET() {                          \
> +        PIOC->PIO_PDR  |= PIO_PDR_P21;                  \
> +        PWM_0_PORT_CH0->PIO_ABSR |= PWM_0_PIN_CH0;      \
> +        PIOC->PIO_PDR  |= PIO_PDR_P22;                  \
> +        PWM_0_PORT_CH1->PIO_ABSR |= PWM_0_PIN_CH1;      \
> +        PIOC->PIO_PDR  |= PIO_PDR_P23;                  \
> +        PWM_0_PORT_CH2->PIO_ABSR |= PWM_0_PIN_CH2;      \
> +        PIOC->PIO_PDR  |= PIO_PDR_P24;                  \
> +        PWM_0_PORT_CH3->PIO_ABSR |= PWM_0_PIN_CH3;      \
> +    }

If you really need a separate instance to set these pins, I'd suggest to write an inline function that is usable for any configuration. Please don't write a separate macro for all channels

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


More information about the notifications mailing list