Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
dvfs.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_
7#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_
8
9#include <stdint.h>
10#include <stdbool.h>
11#include <stddef.h>
12#include <errno.h>
13
19
26#define IRONSIDE_DVFS_OPPOINT_COUNT (3)
27
34#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT (1)
36#define IRONSIDE_DVFS_ERROR_BUSY (2)
38#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA (3)
40#define IRONSIDE_DVFS_ERROR_PERMISSION (4)
42#define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED (5)
44#define IRONSIDE_DVFS_ERROR_TIMEOUT (6)
46#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED (7)
47
52/* IRONside call identifiers with implicit versions.
53 *
54 * With the initial "version 0", the service ABI is allowed to break until the
55 * first production release of IRONside SE.
56 */
57#define IRONSIDE_CALL_ID_DVFS_SERVICE_V0 3
58
59/* Index of the DVFS oppoint within the service buffer. */
60#define IRONSIDE_DVFS_SERVICE_OPPOINT_IDX (0)
61/* Index of the return code within the service buffer. */
62#define IRONSIDE_DVFS_SERVICE_RETCODE_IDX (0)
63
74
81static inline bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvfs_oppoint)
82{
83 if (dvfs_oppoint != IRONSIDE_DVFS_OPP_HIGH &&
84 dvfs_oppoint != IRONSIDE_DVFS_OPP_MEDLOW &&
85 dvfs_oppoint != IRONSIDE_DVFS_OPP_LOW) {
86 return false;
87 }
88
89 return true;
90}
91
92#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_FIRMWARE_NRF_IRONSIDE_DVFS_H_ */
static bool ironside_dvfs_is_oppoint_valid(enum ironside_dvfs_oppoint dvfs_oppoint)
Check if the given oppoint is valid.
Definition dvfs.h:81
ironside_dvfs_oppoint
Definition dvfs.h:14
@ IRONSIDE_DVFS_OPP_HIGH
Definition dvfs.h:15
@ IRONSIDE_DVFS_OPP_LOW
Definition dvfs.h:17
@ IRONSIDE_DVFS_OPP_MEDLOW
Definition dvfs.h:16
int ironside_dvfs_change_oppoint(enum ironside_dvfs_oppoint dvfs_oppoint)
Change the current DVFS oppoint.
System error numbers.