timer02.h 704 B

123456789101112131415161718192021222324252627282930313233343536
  1. //timer02.h
  2. // use atmega timer2 as main system timer instead of timer0
  3. // timer0 is used for fast pwm (OC0B output)
  4. // original OVF handler is disabled
  5. #ifndef TIMER02_H
  6. #define TIMER02_H
  7. #include <inttypes.h>
  8. #if defined(__cplusplus)
  9. extern "C" {
  10. #endif //defined(__cplusplus)
  11. extern uint8_t timer02_pwm0;
  12. extern void timer02_set_pwm0(uint8_t pwm0);
  13. extern void timer02_init(void);
  14. extern unsigned long millis2(void);
  15. extern unsigned long micros2(void);
  16. extern void delay2(unsigned long ms);
  17. extern void tone2(uint8_t _pin, unsigned int frequency/*, unsigned long duration*/);
  18. extern void noTone2(uint8_t _pin);
  19. #if defined(__cplusplus)
  20. }
  21. #endif //defined(__cplusplus)
  22. #endif //TIMER02_H