1 /* 2 * Copyright (c) 2020 Huawei Device Co., Ltd. 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 16 /** 17 * @addtogroup power 18 * @{ 19 * 20 * @brief Provides device power management functions. 21 * 22 * This module is used to reboot the device and set low power consumption for the device. \n 23 * 24 * @since 2.2 25 * @version 2.2 */ 26 27 /** 28 * @file lowpower.h 29 * 30 * @brief Sets low power consumption for the device. 31 * 32 * 33 * 34 * @since 2.2 35 * @version 2.2 36 */ 37 38 #ifndef LOWPOWER_H 39 #define LOWPOWER_H 40 41 /** 42 * @brief Enumerates low power consumption modes. 43 */ 44 typedef enum { 45 /** No sleep */ 46 NO_SLEEP, 47 /** Light sleep */ 48 LIGHT_SLEEP, 49 /** Deep sleep */ 50 DEEP_SLEEP, 51 }LpcType; 52 53 /** 54 * @brief Initializes low power consumption. 55 * 56 * @return Returns {@link IOT_SUCCESS} if low power consumption is initialized; 57 * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description. 58 * @since 2.2 59 * @version 2.2 60 */ 61 unsigned int LpcInit(void); 62 63 /** 64 * @brief Sets low power consumption for the device. 65 * 66 * @param type Indicates the low power consumption mode, as enumerated in {@link LpcType}. 67 * @return Returns {@link IOT_SUCCESS} if low power consumption is set; 68 * returns {@link IOT_FAILURE} otherwise. For details about other return values, see the chip description. 69 * @since 2.2 70 * @version 2.2 71 */ 72 unsigned int LpcSetType(LpcType type); 73 74 #endif // LOWPOWER_H 75 /** @} */ 76