zephyr/tests/subsys/pm/device_runtime_api/src/test_driver.h
Gerard Marull-Paretas 05e5a72e03 tests: pm: device_runtime: add test for the API
Add a test for the device runtime API that makes sure most common usage
scenarios behave as expected:

- get + put
- get + asynchronous put until suspended
- get + asynchronous put + get (while suspend still ongoing)

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 16:37:33 -04:00

40 lines
913 B
C

/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef TESTS_SUBSYS_PM_DEVICE_RUNTIME_TEST_DRIVER_H_
#define TESTS_SUBSYS_PM_DEVICE_RUNTIME_TEST_DRIVER_H_
#include <device.h>
/**
* @brief Put test driver in async test mode.
*
* In this mode the driver will not end PM action until signaled, thus
* allowing to have control of the sequence.
*
* @param dev Device instance.
*/
void test_driver_pm_async(const struct device *dev);
/**
* @brief Unblock test driver PM action.
*
* @param dev Device instance.
*/
void test_driver_pm_done(const struct device *dev);
/**
* @brief Check if PM actions is ongoing.
*
* @param dev Device instance.
*
* @return true If PM action is ongoing.
* @return false If PM action is not ongoing.
*/
bool test_driver_pm_ongoing(const struct device *dev);
#endif /* TESTS_SUBSYS_PM_DEVICE_RUNTIME_TEST_DRIVER_H_ */