10f99eeccSopenharmony_ci/* 20f99eeccSopenharmony_ci * Copyright (c) 2020 Huawei Device Co., Ltd. 30f99eeccSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 40f99eeccSopenharmony_ci * you may not use this file except in compliance with the License. 50f99eeccSopenharmony_ci * You may obtain a copy of the License at 60f99eeccSopenharmony_ci * 70f99eeccSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 80f99eeccSopenharmony_ci * 90f99eeccSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 100f99eeccSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 110f99eeccSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 120f99eeccSopenharmony_ci * See the License for the specific language governing permissions and 130f99eeccSopenharmony_ci * limitations under the License. 140f99eeccSopenharmony_ci */ 150f99eeccSopenharmony_ci 160f99eeccSopenharmony_ci/** 170f99eeccSopenharmony_ci * @addtogroup power 180f99eeccSopenharmony_ci * @{ 190f99eeccSopenharmony_ci * 200f99eeccSopenharmony_ci * @brief Provides device power management functions. 210f99eeccSopenharmony_ci * 220f99eeccSopenharmony_ci * This module is used to reboot the device and set low power consumption for the device. \n 230f99eeccSopenharmony_ci * 240f99eeccSopenharmony_ci * @since 2.2 250f99eeccSopenharmony_ci * @version 2.2 */ 260f99eeccSopenharmony_ci 270f99eeccSopenharmony_ci/** 280f99eeccSopenharmony_ci * @file lowpower.h 290f99eeccSopenharmony_ci * 300f99eeccSopenharmony_ci * @brief Sets low power consumption for the device. 310f99eeccSopenharmony_ci * 320f99eeccSopenharmony_ci * 330f99eeccSopenharmony_ci * 340f99eeccSopenharmony_ci * @since 2.2 350f99eeccSopenharmony_ci * @version 2.2 360f99eeccSopenharmony_ci */ 370f99eeccSopenharmony_ci 380f99eeccSopenharmony_ci#ifndef LOWPOWER_H 390f99eeccSopenharmony_ci#define LOWPOWER_H 400f99eeccSopenharmony_ci 410f99eeccSopenharmony_ci/** 420f99eeccSopenharmony_ci * @brief Enumerates low power consumption modes. 430f99eeccSopenharmony_ci */ 440f99eeccSopenharmony_citypedef enum { 450f99eeccSopenharmony_ci /** No sleep */ 460f99eeccSopenharmony_ci NO_SLEEP, 470f99eeccSopenharmony_ci /** Light sleep */ 480f99eeccSopenharmony_ci LIGHT_SLEEP, 490f99eeccSopenharmony_ci /** Deep sleep */ 500f99eeccSopenharmony_ci DEEP_SLEEP, 510f99eeccSopenharmony_ci}LpcType; 520f99eeccSopenharmony_ci 530f99eeccSopenharmony_ci/** 540f99eeccSopenharmony_ci * @brief Initializes low power consumption. 550f99eeccSopenharmony_ci * 560f99eeccSopenharmony_ci * @return Returns {@link IOT_SUCCESS} if low power consumption is initialized; 570f99eeccSopenharmony_ci * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description. 580f99eeccSopenharmony_ci * @since 2.2 590f99eeccSopenharmony_ci * @version 2.2 600f99eeccSopenharmony_ci */ 610f99eeccSopenharmony_ciunsigned int LpcInit(void); 620f99eeccSopenharmony_ci 630f99eeccSopenharmony_ci/** 640f99eeccSopenharmony_ci * @brief Sets low power consumption for the device. 650f99eeccSopenharmony_ci * 660f99eeccSopenharmony_ci * @param type Indicates the low power consumption mode, as enumerated in {@link LpcType}. 670f99eeccSopenharmony_ci * @return Returns {@link IOT_SUCCESS} if low power consumption is set; 680f99eeccSopenharmony_ci * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description. 690f99eeccSopenharmony_ci * @since 2.2 700f99eeccSopenharmony_ci * @version 2.2 710f99eeccSopenharmony_ci */ 720f99eeccSopenharmony_ciunsigned int LpcSetType(LpcType type); 730f99eeccSopenharmony_ci 740f99eeccSopenharmony_ci#endif // LOWPOWER_H 750f99eeccSopenharmony_ci/** @} */ 76