24 #if defined(BOARD_ATMEGA328P) 33 TCCR0A |= _BV(
WGM01) | _BV(WGM00);
34 TCCR0B |= _BV(CS01) | _BV(CS00);
41 TCCR1B |= _BV(CS11) | _BV(CS10);
60 Power::timer2_enable();
123 #elif defined(BOARD_ATMEGA32U4) 132 TCCR0A |= _BV(
WGM01) | _BV(WGM00);
133 TCCR0B |= _BV(CS01) | _BV(CS00);
139 TCCR1A |= _BV(WGM11) | _BV(WGM10);
140 TCCR1B |= _BV(CS11) | _BV(CS10);
145 TCCR3A |= _BV(WGM31) | _BV(WGM30);
146 TCCR3B |= _BV(CS31) | _BV(CS30);
152 TCCR4A |= _BV(PWM4A);
153 TCCR4B |= _BV(CS42) | _BV(CS41) | _BV(CS40);
154 TCCR4C |= _BV(PWM4D);
173 Power::timer3_enable();
239 #elif defined(BOARD_ATMEGA1248P) 248 TCCR0A |= _BV(
WGM01) | _BV(WGM00);
249 TCCR0B |= _BV(CS01) | _BV(CS00);
252 #if defined(__AVR_ATmega1284P__) 256 TCCR3A |= _BV(WGM30);
257 TCCR3B |= _BV(CS31) | _BV(CS30);
264 TCCR1A |= _BV(WGM10);
265 TCCR1B |= _BV(CS11) | _BV(CS10);
271 TCCR2A |= _BV(WGM20);
288 #if defined(__AVR_ATmega1284P__) 291 Power::timer3_enable();
299 Power::timer2_enable();
312 #if defined(__AVR_ATmega1284P__) 337 #if defined(__AVR_ATmega1284P__) 368 #elif defined(BOARD_ATMEGA2560) 377 TCCR0A |= _BV(
WGM01) | _BV(WGM00);
378 TCCR0B |= _BV(CS01) | _BV(CS00);
384 TCCR1A |= _BV(WGM10);
385 TCCR1B |= _BV(CS11) | _BV(CS10);
391 TCCR2A |= _BV(WGM20);
399 TCCR3A |= _BV(WGM30);
400 TCCR3B |= _BV(CS31) | _BV(CS30);
407 TCCR4A |= _BV(WGM40);
408 TCCR4B |= _BV(CS41) | _BV(CS40);
421 Power::timer3_enable();
430 Power::timer4_enable();
434 Power::timer2_enable();
523 #elif defined(BOARD_ATTINYX4) 531 TCCR0A |= _BV(
WGM01) | _BV(WGM00);
532 TCCR0B |= _BV(CS01) | _BV(CS00);
536 TCCR1A |= _BV(WGM10);
537 TCCR1B |= _BV(CS11) | _BV(CS10);
598 #elif defined(BOARD_ATTINYX5) 603 TCCR0A |= _BV(
WGM01) | _BV(WGM00);
604 TCCR0B |= _BV(CS01) | _BV(CS00);
649 #elif defined(BOARD_ATTINYX61) 655 TCCR1B |= _BV(CS12) | _BV(CS11) | _BV(CS10);
660 TCCR1A |= _BV(PWM1A);
663 TCCR1A |= _BV(PWM1B);
666 TCCR1C |= _BV(PWM1D);
725 if (
UNLIKELY(value <= min)) duty = 0;
726 else if (
UNLIKELY(value >= max)) duty = 255;
727 else duty = (((uint32_t) (value - min)) << 8) / (max - min);
PWMPin(Board::PWMPin pin, uint8_t duty=0)
static void timer1_enable()
static void timer0_enable()