1 /*
2  * Copyright (c) 2023 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 CLOCK_IF_H
10 #define CLOCK_IF_H
11 
12 #include "platform_if.h"
13 
14 #ifdef __cplusplus
15 #if __cplusplus
16 extern "C" {
17 #endif
18 #endif /* __cplusplus */
19 #define MAX_PATH_LEN 120
20 
21 DevHandle ClockOpen(uint32_t number);
22 
23 int32_t ClockClose(DevHandle handle);
24 
25 int32_t ClockEnable(DevHandle handle);
26 
27 int32_t ClockDisable(DevHandle handle);
28 
29 int32_t ClockSetRate(DevHandle handle, uint32_t rate);
30 
31 int32_t ClockGetRate(DevHandle handle, uint32_t *rate);
32 
33 int32_t ClockSetParent(DevHandle child, DevHandle parent);
34 
35 DevHandle ClockGetParent(DevHandle handle);
36 
37 /**
38  * @brief 枚举 CLOCK I/O 命令.
39  *
40  * @since 1.0
41  */
42 enum ClockIoCmd {
43     CLOCK_IO_OPEN = 0,
44     CLOCK_IO_CLOSE,
45     CLOCK_IO_ENABLE,
46     CLOCK_IO_DISABLE,
47     CLOCK_IO_SET_RATE,
48     CLOCK_IO_GET_RATE,
49     CLOCK_IO_SET_PARENT,
50     CLOCK_IO_GET_PARENT,
51 };
52 
53 #ifdef __cplusplus
54 #if __cplusplus
55 }
56 #endif
57 #endif /* __cplusplus */
58 
59 #endif /* CLOCK_IF_H */
60