text: #ifndef TIMER_H
  # define TIMER_H
  
  /***********************************************************************
   * 
   * Timer library for AVR-GCC.
   * ATmega328P (Arduino Uno), 16 MHz, AVR 8-bit Toolchain 3.6.2
   *
   * Copyright (c) 2019-Present Tomas Fryza
   * Dept. of Radio Electronics, Brno University of Technology, Czechia
   * This work is licensed under the terms of the MIT license.
   *
   **********************************************************************/
  
  /**
   * @file 
   * @defgroup fryza_timer Timer Library <timer.h>
   * @code #include "timer.h" @endcode
   *
   * @brief Timer library for AVR-GCC.
   *
   * The library contains macros for controlling the timer modules.
   *
   * @note Based on Microchip Atmel ATmega328P manual and no source file
   *       is needed for the library.
   * @author Tomas Fryza, Dept. of Radio Electronics, Brno University 
   *         of Technology, Czechia
   * @copyright (c) 2019-Present Tomas Fryza, This work is licensed under 
   *                the terms of the MIT license
   * @{
   */
  
  
  /* Includes ----------------------------------------------------------*/
  #include <avr/io.h>
  
  
  /* Defines -----------------------------------------------------------*/
  /**
   * @name  Definitions of Timer/Counter1
   * @note  F_CPU = 16 MHz
   */
  /** @brief Stop timer, prescaler 000 --> STOP */
  #define TIM1_stop()           TCCR1B &= ~((1<<CS12) | (1<<CS11) | (1<<CS10)); // on clear tous les bits
  /** @brief Set overflow 4ms, prescaler 001 --> 1 */
  #define TIM1_overflow_4ms()   TCCR1B &= ~((1<<CS12) | (1<<CS11)); TCCR1B |= (1<<CS10); // on met les 2 premiers a 0 l'autre a 1
  /** @brief Set overflow 33ms, prescaler 010 --> 8 (ca c la valeur du prescaler)*/
  #define TIM1_overflow_33ms()  TCCR1B &= ~((1<<CS12) | (1<<CS10)); TCCR1B |= (1<<CS11);
  /** @brief Set overflow 262ms, prescaler 011 --> 64 */
  #define TIM1_overflow_262ms() TCCR1B &= ~(1<<CS12); TCCR1B |= (1<<CS11) | (1<<CS10);
  /** @brief Set overflow 1s, prescaler 100 --> 256 */
  #define TIM1_overflow_1s()    TCCR1B &= ~((1<<CS11) | (1<<CS10)); TCCR1B |= (1<<CS12);
  /** @brief Set overflow 4s, prescaler // 101 --> 1024 */
  #define TIM1_overflow_4s()    TCCR1B &= ~(1<<CS11); TCCR1B |= (1<<CS12) | (1<<CS10);
  /** @brief Enable overflow interrupt, 1 --> enable */
  #define TIM1_overflow_interrupt_enable()  TIMSK1 |= (1<<TOIE1);
  /** @brief Disable overflow interrupt, 0 --> disable */
  #define TIM1_overflow_interrupt_disable() TIMSK1 &= ~(1<<TOIE1);
  
  /**
   * @name  Definitions of Timer/Counter0
   * @note  F_CPU = 16 MHz
   */
  // WRITE YOUR CODE HERE
  #define T1M0_stop()   TCCR0B &= ~((1<<CS02) | (1<<CS01) | (1<<CS00));
  #define TIM0_overflow_16us()   TCCR0B &= ~((1<<CS02) | (1<<CS01)); TCCR0B |= (1<<CS00);
  #define TIM0_overflow_128us()   TCCR0B &= ~((1<<CS02) | (1<<CS01)); TCCR0B |= (1<<CS00);
  #define TIM0_overflow_1ms()   TCCR0B &= ~((1<<CS02) | (1<<CS01)); TCCR0B |= (1<<CS00);
  #define TIM0_overflow_4ms()   TCCR0B &= ~((1<<CS02) | (1<<CS01)); TCCR0B |= (1<<CS00);
  #define TIM0_overflow_16ms()   TCCR0B &= ~((1<<CS02) | (1<<CS01)); TCCR0B |= (1<<CS00);
  #define TIM0_overflow_interrupt_enable()  TIMSK0 |= (1<<TOIE0);
  #define TIM0_overflow_interrupt_disable() TIMSK0 &= ~(1<<TOIE0);
  
  /**
   * @name  Definitions of Timer/Counter2
   * @note  F_CPU = 16 MHz
   */
  // WRITE YOUR CODE HERE
  #define TIM2_stop()           TCCR2B &= ~((1<<CS22) | (1<<CS21) | (1<<CS20)); 
  #define TIM2_overflow_4ms()   TCCR2B &= ~((1<<CS22) | (1<<CS21)); TCCR2B |= (1<<CS20); 
  #define TIM2_overflow_33ms()  TCCR2B &= ~((1<<CS22) | (1<<CS20)); TCCR2B |= (1<<CS21);
  #define TIM2_overflow_131ms() TCCR2B &= ~(1<<CS22); TCCR2B |= (1<<CS21) | (1<<CS20);
  #define TIM2_overflow_262ms()    TCCR2B &= ~((1<<CS21) | (1<<CS20)); TCCR2B |= (1<<CS22);
  #define TIM2_overflow_512ms()    TCCR2B &= ~(1<<CS21); TCCR2B |= (1<<CS22) | (1<<CS20);
  #define TIM2_overflow_1s()    TCCR2B &= ~(1<<CS20); TCCR2B |= (1<<CS22) | (1<<CS21);
  #define TIM2_overflow_16ms()    TCCR2B |= (1<<CS22) | (1<<CS21) | (1<<CS20);
  #define TIM2_overflow_interrupt_enable()  TIMSK2 |= (1<<TOIE2);
  #define TIM2_overflow_interrupt_disable() TIMSK2 &= ~(1<<TOIE2);
  
  /** @} */
  
  #endif