-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
cpu/samd21: Add samd21 pwm driver #2473
Conversation
2f229d9
to
2a32990
Compare
/* ignore file in case no PWM devices are defined */ | ||
#if PWM_NUMOF | ||
|
||
int round_to_prescaler(unsigned int frequency, unsigned int resolution, int *presc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be static
, right?
c160878
to
f50a16d
Compare
addressed latest comments |
#define PWM_1_PM PM_APBCMASK_TCC1 | ||
/* PWM 1 pin configuration */ | ||
#define PWM_1_PORT (PORT->Group[0]) | ||
#define PWM_1_PIN_CH0 (6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be aware that this pin is used for ADC_0
in PR #2063
@PeterKietzmann needs rebase. |
f50a16d
to
b34b716
Compare
I rebased and squashed. We should not forget that the |
b34b716
to
3f8e68e
Compare
@thomaseichinger I tried to implement the left and right aligned pwm modes for the samr21-xpro. According to the reference manual (section 28.6.2.5 page 617) I wanted to use the up-counting mode for the left-aligned pwm and the down-counting mode for the right-aligned pwm. The corresponding register-content ( |
In addition: Do you know a way to measure the regarding clock signal? |
9f184dd
to
45554bf
Compare
@PeterKietzmann: I just opened a new PR with a slightly adapted version of your PWM driver: #3127. Should we close this then? |
Yes of course! Will test the new one soon |
This is an implementation of a pwm lowlevel driver for samr21-xpro boards. Please note that the
pwm_mode_t mode
is not yet implemented for this board.