• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  * Description: Provides PMU header \n
16  *
17  * History: \n
18  * 2023-01-12, Create file. \n
19  */
20 
21 #ifndef PM_PMU_H
22 #define PM_PMU_H
23 
24 #include "common_def.h"
25 #include "errcode.h"
26 #include "pm_pmu_porting.h"
27 
28 #ifdef __cplusplus
29 #if __cplusplus
30 extern "C" {
31 #endif /* __cplusplus */
32 #endif /* __cplusplus */
33 
34 /**
35  * @defgroup drivers_driver_pm_pmu PM PMU
36  * @ingroup  drivers_driver_pm
37  * @{
38  */
39 
40 /**
41  * @if Eng
42  * @brief  Set the LDO voltage.
43  * @param  [in]  id The LDO to set voltage.
44  * @param  [in]  vset The voltage value to be configured.
45  * @retval ERRCODE_SUCC Success.
46  * @retval Other        Failure. For details, see @ref errcode_t.
47  * @else
48  * @brief  设置LDO电压。
49  * @param  [in]  id 用来设置电压的LDO。
50  * @param  [in]  vset 要配置的电压值。
51  * @retval ERRCODE_SUCC 成功。
52  * @retval Other        失败,参考 @ref errcode_t 。
53  * @endif
54  */
55 errcode_t uapi_pmu_ldo_set_voltage(pmu_ldo_id_t id, uint8_t vset);
56 
57 /**
58  * @if Eng
59  * @brief  Get the LDO voltage.
60  * @param  [in]  id The LDO to get the voltage.
61  * @return The LDO current voltage.
62  * @else
63  * @brief  获取LDO电压。
64  * @param  [in]  id 用来获取电压的LDO。
65  * @return LDO当前电压值。
66  * @endif
67  */
68 uint8_t uapi_pmu_ldo_get_voltage(pmu_ldo_id_t id);
69 
70 /**
71  * @if Eng
72  * @brief  PMU control API.
73  * @param  [in]  type PMU control type.
74  * @param  [in]  param PMU control parameter.
75  * @retval ERRCODE_SUCC Success.
76  * @retval Other        Failure. For details, see @ref errcode_t.
77  * @else
78  * @brief  PMU控制API。
79  * @param  [in]  type PMU控制类型。
80  * @param  [in]  param PMU控制参数。
81  * @retval ERRCODE_SUCC 成功。
82  * @retval Other        失败,参考 @ref errcode_t 。
83  * @endif
84  */
85 errcode_t uapi_pmu_control(pmu_control_type_t type, uint8_t param);
86 
87 /**
88  * @}
89  */
90 
91 #ifdef __cplusplus
92 #if __cplusplus
93 }
94 #endif /* __cplusplus */
95 #endif /* __cplusplus */
96 
97 #endif
98