1 /*
2  * Copyright (c) 2021 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef TESTS_SUBSYS_PM_DEVICE_RUNTIME_TEST_DRIVER_H_
8 #define TESTS_SUBSYS_PM_DEVICE_RUNTIME_TEST_DRIVER_H_
9 
10 #include <zephyr/device.h>
11 
12 /**
13  * @brief Put test driver in async test mode.
14  *
15  * In this mode the driver will not end PM action until signaled, thus
16  * allowing to have control of the sequence.
17  *
18  * @param dev Device instance.
19  */
20 void test_driver_pm_async(const struct device *dev);
21 
22 /**
23  * @brief Unblock test driver PM action.
24  *
25  * @param dev Device instance.
26  */
27 void test_driver_pm_done(const struct device *dev);
28 
29 /**
30  * @brief Check if PM actions is ongoing.
31  *
32  * @param dev Device instance.
33  *
34  * @return true If PM action is ongoing.
35  * @return false If PM action is not ongoing.
36  */
37 bool test_driver_pm_ongoing(const struct device *dev);
38 
39 /**
40  * @brief Gets the number of times the device changed state.
41  *
42  * @param dev Device instance.
43  *
44  * @return The number of state changes the device made.
45  */
46 size_t test_driver_pm_count(const struct device *dev);
47 
48 #endif /* TESTS_SUBSYS_PM_DEVICE_RUNTIME_TEST_DRIVER_H_ */
49