1 /* 2 * Copyright (c) 2020 Intel Corporation 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __TEST_PWRMGMT_H__ 8 #define __TEST_PWRMGMT_H__ 9 10 11 /** @brief Alternates between light and deep sleep cycles. 12 * 13 * For light sleep, the test sleeps in main thread for 500 ms longer than 14 * SUSPEND_TO_IDLE residency. 15 * 16 * Similarly for deep sleep, the test sleeps in the main thread for 500 ms 17 * longer than STANDBY residency. 18 * 19 * @param use_logging test progress will be reported using logging, 20 * otherwise printk. 21 * @param cycles to repeat the cycle described above. 22 * @retval 0 if successful, errno otherwise. 23 */ 24 int test_pwr_mgmt_singlethread(bool use_logging, uint8_t cycles); 25 26 /** @brief Alternates between light and deep sleep cycles. 27 * 28 * Performs same approach to achieve light and deep sleep, but additional 29 * it suspend all threads within the app. 30 * 31 * @param use_logging test progress will be reported using logging, 32 * otherwise printk. 33 * @param cycles to repeat the cycle described above. 34 * @retval 0 if successful, errno otherwise. 35 */ 36 int test_pwr_mgmt_multithread(bool use_logging, uint8_t cycles); 37 38 #endif /* __TEST_PWRMGMT_H__ */ 39