clock.h 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #pragma once
  2. #ifndef _CLOCK_H
  3. #define _CLOCK_H
  4. /* Includes */
  5. #include "main.h"
  6. /* type defs */
  7. typedef enum {
  8. Lvl_Off = 0,
  9. Lvl_Min = 1,
  10. Lvl_2 = 2,
  11. Lvl_3 = 3,
  12. Lvl_Mdl = 4,
  13. Lvl_5 = 5,
  14. Lvl_Max = 6,
  15. Lvl_On = 7
  16. } brigh_level_t;
  17. /* macro */
  18. #define FADE_START 0
  19. #define FADE_STOP 15
  20. #define FADE_STEP 1
  21. // Day/Night mode
  22. #define MORNING_HOUR 0x06
  23. #define EVENING_HOUR 0x22
  24. #define DAY_BR_LVL (brigh_level_t)5
  25. #define NIGHT_BR_LVL (brigh_level_t)2
  26. // Color HUE angle
  27. #define COLOUR_RED 0
  28. #define COLOUR_GREEN 20
  29. #define COLOUR_BLUE 40
  30. #define COLOUR_NIXIE 1
  31. /* time constant in ms */
  32. #define BTN_SCAN_PERIOD 10
  33. #define BTN_SCAN_PAUSE 200
  34. #define BTN_TIME_PRESSED 30
  35. #define BTN_TIME_HOLDED 500
  36. #define BTN_TIME_REPEATED 50
  37. /* Display timeout, sec */
  38. #define DISP_WDT_TIME 10
  39. /* variables */
  40. extern rtc_t Clock;
  41. /* function prototypes */
  42. void Clock_Init(void);
  43. void btnProcess(void);
  44. void new_Second(void);
  45. #endif /* _CLOCK_H */