• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef TIMER_TEST_H
10 #define TIMER_TEST_H
11 
12 #include "platform_if.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 enum TimerTestCmd {
19     TIMER_START_TEST = 1,
20     TIMER_TEST_SET,
21     TIMER_TEST_SETONCE,
22     TIMER_TEST_GET,
23     TIMER_TEST_START,
24     TIMER_TEST_STOP,
25     TIMER_MULTI_THREAD_TEST,
26     TIMER_RELIABILITY_TEST,
27     TIMER_IF_PERFORMANCE_TEST,
28     TIMER_TEST_MAX_CMD,
29 };
30 
31 #define TIMER_TEST_STACK_SIZE    (1024 * 100)
32 #define TIMER_TEST_WAIT_TIMES    4
33 #define TIMER_TEST_WAIT_TIMEOUT  5
34 #define TIMER_TEST_PERIOD_TIMES  2
35 
36 #define TIMER_TEST_TIME_ID_THREAD1  3
37 #define TIMER_TEST_TIME_ID_THREAD2  5
38 #define TIMER_TEST_TIME_USECONDS    5000
39 
40 struct TimerTestConfig {
41     uint32_t number;
42     uint32_t uSecond;
43     uint32_t isPeriod;
44 };
45 
46 struct TimerTest {
47     DevHandle handle;
48     uint32_t number;
49     uint32_t uSecond;
50     uint32_t isPeriod;
51 };
52 
53 int32_t TimerTestExecute(int cmd);
54 
55 #ifdef __cplusplus
56 }
57 #endif
58 
59 #endif /* TIMER_TEST_H */
60