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 File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <errno.h>

Go to the source code of this file.

Macros

#define IRONSIDE_DVFS_OPPOINT_COUNT   (3)
 Number of DVFS oppoints supported by IRONside.
 
#define IRONSIDE_CALL_ID_DVFS_SERVICE_V0   3
 
#define IRONSIDE_DVFS_SERVICE_OPPOINT_IDX   (0)
 
#define IRONSIDE_DVFS_SERVICE_RETCODE_IDX   (0)
 
IRONside DVFS service error codes.
#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT   (1)
 The requested DVFS oppoint is not allowed.
 
#define IRONSIDE_DVFS_ERROR_BUSY   (2)
 Waiting for mutex lock timed out, or hardware is busy.
 
#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA   (3)
 There is configuration error in the DVFS service.
 
#define IRONSIDE_DVFS_ERROR_PERMISSION   (4)
 The caller does not have permission to change the DVFS oppoint.
 
#define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED   (5)
 The requested DVFS oppoint is already set, no change needed.
 
#define IRONSIDE_DVFS_ERROR_TIMEOUT   (6)
 The operation timed out, possibly due to a hardware issue.
 
#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED   (7)
 The DVFS oppoint change operation is not allowed in the ISR context.
 

Enumerations

enum  ironside_dvfs_oppoint { IRONSIDE_DVFS_OPP_HIGH = 0 , IRONSIDE_DVFS_OPP_MEDLOW = 1 , IRONSIDE_DVFS_OPP_LOW = 2 }
 

Functions

int ironside_dvfs_change_oppoint (enum ironside_dvfs_oppoint dvfs_oppoint)
 Change the current DVFS oppoint.
 
static bool ironside_dvfs_is_oppoint_valid (enum ironside_dvfs_oppoint dvfs_oppoint)
 Check if the given oppoint is valid.
 

Macro Definition Documentation

◆ IRONSIDE_CALL_ID_DVFS_SERVICE_V0

#define IRONSIDE_CALL_ID_DVFS_SERVICE_V0   3

◆ IRONSIDE_DVFS_ERROR_BUSY

#define IRONSIDE_DVFS_ERROR_BUSY   (2)

Waiting for mutex lock timed out, or hardware is busy.

◆ IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED

#define IRONSIDE_DVFS_ERROR_ISR_NOT_ALLOWED   (7)

The DVFS oppoint change operation is not allowed in the ISR context.

◆ IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED

#define IRONSIDE_DVFS_ERROR_NO_CHANGE_NEEDED   (5)

The requested DVFS oppoint is already set, no change needed.

◆ IRONSIDE_DVFS_ERROR_OPPOINT_DATA

#define IRONSIDE_DVFS_ERROR_OPPOINT_DATA   (3)

There is configuration error in the DVFS service.

◆ IRONSIDE_DVFS_ERROR_PERMISSION

#define IRONSIDE_DVFS_ERROR_PERMISSION   (4)

The caller does not have permission to change the DVFS oppoint.

◆ IRONSIDE_DVFS_ERROR_TIMEOUT

#define IRONSIDE_DVFS_ERROR_TIMEOUT   (6)

The operation timed out, possibly due to a hardware issue.

◆ IRONSIDE_DVFS_ERROR_WRONG_OPPOINT

#define IRONSIDE_DVFS_ERROR_WRONG_OPPOINT   (1)

The requested DVFS oppoint is not allowed.

◆ IRONSIDE_DVFS_OPPOINT_COUNT

#define IRONSIDE_DVFS_OPPOINT_COUNT   (3)

Number of DVFS oppoints supported by IRONside.

This is the number of different DVFS oppoints that can be set on IRONside. The oppoints are defined in the ironside_dvfs_oppoint enum.

◆ IRONSIDE_DVFS_SERVICE_OPPOINT_IDX

#define IRONSIDE_DVFS_SERVICE_OPPOINT_IDX   (0)

◆ IRONSIDE_DVFS_SERVICE_RETCODE_IDX

#define IRONSIDE_DVFS_SERVICE_RETCODE_IDX   (0)

Enumeration Type Documentation

◆ ironside_dvfs_oppoint

Enumerator
IRONSIDE_DVFS_OPP_HIGH 
IRONSIDE_DVFS_OPP_MEDLOW 
IRONSIDE_DVFS_OPP_LOW 

Function Documentation

◆ ironside_dvfs_change_oppoint()

int ironside_dvfs_change_oppoint ( enum ironside_dvfs_oppoint dvfs_oppoint)

Change the current DVFS oppoint.

This function will request a change of the current DVFS oppoint to the specified value. It will block until the change is applied.

Parameters
dvfs_oppointThe new DVFS oppoint to set.
Returns
int 0 on success, negative error code on failure.

◆ ironside_dvfs_is_oppoint_valid()

static bool ironside_dvfs_is_oppoint_valid ( enum ironside_dvfs_oppoint dvfs_oppoint)
inlinestatic

Check if the given oppoint is valid.

Parameters
dvfs_oppointThe oppoint to check.
Returns
true if the oppoint is valid, false otherwise.