1 /* 2 * Copyright (c) 2024 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 #ifndef LD_DVFS_HANDLER_H 7 #define LD_DVFS_HANDLER_H 8 9 #include <dvfs_oppoint.h> 10 #include <stdint.h> 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /** 17 * @brief Function to request LD frequency change. 18 * 19 * @param frequency requested frequency setting from enum dvfs_frequency_setting. 20 * @return EBUSY Frequency change request pending. 21 * @return EAGAIN DVFS init in progress. 22 * @return ENXIO Not supported frequency settings. 23 * @return NRFS_SUCCESS Request sent successfully. 24 * @return NRFS_ERR_INVALID_STATE Service is uninitialized. 25 * @return NRFS_ERR_IPC Backend returned error during request sending. 26 */ 27 int32_t dvfs_service_handler_change_freq_setting(enum dvfs_frequency_setting freq_setting); 28 29 /** 30 * @brief Type to use as callback function in dvfs service 31 * 32 * @param new_setting applied frequency setting 33 */ 34 typedef void (*dvfs_service_handler_callback)(enum dvfs_frequency_setting new_setting); 35 36 /** 37 * @brief Register callback function which will be called when new dvfs frequency is applied. 38 * 39 * @param clb dvfs_service_handler_callback to register 40 */ 41 void dvfs_service_handler_register_freq_setting_applied_callback(dvfs_service_handler_callback clb); 42 43 #ifdef __cplusplus 44 } 45 #endif 46 47 #endif /* LD_DVFS_HANDLER_H */ 48