BSB Developer Docs
Loading...
Searching...
No Matches
busy_timer_common.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <stdint.h>
8#include <stdbool.h>
9#include <time.h>
10
11#include "time_macros.h"
12
13#define BUSY_TIMER_TIME_MIN_MN (5)
14#define BUSY_TIMER_TIME_MAX_MN H_TO_M(24)
15#define BUSY_TIMER_TIME_INCREMENT_MN (5)
16
17#define BUSY_TIMER_WORK_TIME_MIN_MN (5)
18#define BUSY_TIMER_WORK_TIME_MAX_MN H_TO_M(8)
19
20#define BUSY_TIMER_REST_TIME_MIN_MN (5)
21#define BUSY_TIMER_REST_TIME_MAX_MN H_TO_M(8)
22
23#define BUSY_TIMER_CYCLE_COUNT_MIN (2)
24#define BUSY_TIMER_CYCLE_COUNT_MAX (35)
25#define BUSY_TIMER_CYCLE_INCREMENT (1)
26
27#define BUSY_TIMER_TIME_DEFAULT_MN (20)
28#define BUSY_TIMER_WORK_TIME_DEFAULT_MN (20)
29#define BUSY_TIMER_REST_TIME_DEFAULT_MN (5)
30#define BUSY_TIMER_CYCLE_COUNT_DEFAULT (3)
31
32#define BUSY_TIMER_ENABLE_AUTOSTART_DEFAULT (false)
33#define BUSY_TIMER_ENABLE_DEMO_MODE_DEFAULT (false)
34
35#define BUSY_TIMER_CARD_ID_LEN (36)
36#define BUSY_TIMER_TITLE_LEN (32 * 4)
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42typedef enum {
43 BusyTimerModeInfinite,
44 BusyTimerModeSimple,
45 BusyTimerModeInterval,
46 BusyTimerModeMax,
47} BusyTimerMode;
48
49typedef struct {
50 int sort_order;
51 char title[BUSY_TIMER_TITLE_LEN + 1];
52 char card_id[BUSY_TIMER_CARD_ID_LEN + 1];
54
55typedef struct {
56 uint32_t total_time_ms;
58
59typedef struct {
60 uint32_t work_time_ms;
61 uint32_t rest_time_ms;
62 uint32_t cycles_count;
63 bool is_autostart_enabled;
65
66typedef struct {
67 uint32_t index;
68 uint32_t time_total_ms;
69 uint32_t time_left_ms;
71
72typedef struct {
73 BusyTimerMode mode;
74 union {
77 };
79
80#ifdef __cplusplus
81}
82#endif
Definition busy_timer_common.h:72
Definition busy_timer_common.h:59
Definition busy_timer_common.h:66
Definition busy_timer_common.h:49
Definition busy_timer_common.h:55
TIME (Simple Network Time Protocol) service API.