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. 15 * 16 * Similarly for deep sleep, the test sleeps in the main thread for 500 ms 17 * longer than STANDBY. 18 * 19 * @param cycles to repeat the cycle described above. 20 * @retval 0 if successful, errno otherwise. 21 */ 22 int test_pwr_mgmt_singlethread(uint8_t cycles); 23 24 /** @brief Alternates between light and deep sleep cycles. 25 * 26 * Performs same approach to achieve light and deep sleep, but additional 27 * it suspend all threads within the app. 28 * 29 * @param cycles to repeat the cycle described above. 30 * @retval 0 if successful, errno otherwise. 31 */ 32 int test_pwr_mgmt_multithread(uint8_t cycles); 33 34 /** @brief Initializes the board simply without assertions 35 * 36 * Performs a dummy initialization for the board to enter light/deep sleep 37 * without assertions to check if power management is enabled correctly 38 * on the board. Also serves to initialize the counters. 39 * 40 * @retval 0 if successful, errno otherwise. 41 */ 42 int test_dummy_init(void); 43 44 #endif /* __TEST_PWRMGMT_H__ */ 45