Line data Source code
1 0 : /*
2 : * Copyright (c) 2025 Nordic Semiconductor ASA
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : #ifndef ZEPHYR_INCLUDE_DRIVERS_I2C_NRFX_TWIM_H
8 : #define ZEPHYR_INCLUDE_DRIVERS_I2C_NRFX_TWIM_H
9 :
10 : #include <zephyr/kernel.h>
11 : #include <zephyr/drivers/i2c.h>
12 :
13 : /** @brief Acquires exclusive access to the i2c bus controller.
14 : *
15 : * @param dev Pointer to the device structure for an I2C controller
16 : * driver configured in controller mode.
17 : * @param timeout Timeout for waiting to acquire exclusive access.
18 : *
19 : * @retval 0 If successful.
20 : * @retval -EBUSY Returned without waiting.
21 : * @retval -EAGAIN Waiting period timed out,
22 : * or the underlying semaphore was reset during the waiting period.
23 : */
24 1 : int i2c_nrfx_twim_exclusive_access_acquire(const struct device *dev, k_timeout_t timeout);
25 :
26 : /** @brief Releases exclusive access to the i2c bus controller.
27 : *
28 : * @param dev Pointer to the device structure for an I2C controller
29 : * driver on which @ref i2c_nrfx_twim_exclusive_access_acquire
30 : * has been successfully called.
31 : */
32 1 : void i2c_nrfx_twim_exclusive_access_release(const struct device *dev);
33 :
34 : #endif /* ZEPHYR_INCLUDE_DRIVERS_I2C_NRFX_TWIM_H */
|