Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Value: one typed scalar or range inside a capability. More...

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

union  mpipe_value_bound
 One end of a range value, or its step. More...
struct  mpipe_value
 Value structure. More...

Macros

Initializers for a statically defined value

Each expands to a braced initializer for one Value Container, so a capability known at build time can be placed in .rodata rather than built at runtime.

They are what MPIPE_STRUCTURE_DEFINE takes for each of its fields. The range forms take the bounds and the step between two consecutive values.

#define MPIPE_VALUE_BOOLEAN(v)
 Initialize an MPIPE_TYPE_BOOLEAN value.
#define MPIPE_VALUE_INT(v)
 Initialize an MPIPE_TYPE_INT value.
#define MPIPE_VALUE_UINT(v)
 Initialize an MPIPE_TYPE_UINT value.
#define MPIPE_VALUE_INT_RANGE(lo, hi, st)
 Initialize an MPIPE_TYPE_INT_RANGE value.
#define MPIPE_VALUE_UINT_RANGE(lo, hi, st)
 Initialize an MPIPE_TYPE_UINT_RANGE value.

Enumerations

enum  mpipe_value_type {
  MPIPE_TYPE_NONE = 0 , MPIPE_TYPE_BOOLEAN , MPIPE_TYPE_INT , MPIPE_TYPE_UINT ,
  MPIPE_TYPE_INT_RANGE , MPIPE_TYPE_UINT_RANGE , MPIPE_TYPE_COUNT
}
 Value types. More...

Functions

int mpipe_value_set (struct mpipe_value *value, int type,...)
 Set a value's type and contents.
int mpipe_value_set_va_list (struct mpipe_value *value, enum mpipe_value_type type, va_list *args)
 Set a value from a va_list.
bool mpipe_value_get_boolean (const struct mpipe_value *value)
 Get boolean value of MPIPE_TYPE_BOOLEAN type.
int32_t mpipe_value_get_int (const struct mpipe_value *value)
 Get int value of MPIPE_TYPE_INT type.
uint32_t mpipe_value_get_uint (const struct mpipe_value *value)
 Get uint value of MPIPE_TYPE_UINT type.
int32_t mpipe_value_get_int_range_min (const struct mpipe_value *range)
 Get minimum value of a MPIPE_TYPE_INT_RANGE type.
int32_t mpipe_value_get_int_range_max (const struct mpipe_value *range)
 Get maximum value of a MPIPE_TYPE_INT_RANGE type.
int32_t mpipe_value_get_int_range_step (const struct mpipe_value *range)
 Get step value of a MPIPE_TYPE_INT_RANGE type.
uint32_t mpipe_value_get_uint_range_min (const struct mpipe_value *range)
 Get minimum value of a MPIPE_TYPE_UINT_RANGE type.
uint32_t mpipe_value_get_uint_range_max (const struct mpipe_value *range)
 Get maximum value of a MPIPE_TYPE_UINT_RANGE type.
uint32_t mpipe_value_get_uint_range_step (const struct mpipe_value *range)
 Get step value of a MPIPE_TYPE_UINT_RANGE type.
int mpipe_value_intersect (const struct mpipe_value *val1, const struct mpipe_value *val2, struct mpipe_value *out)
 Intersect two values, put the result into caller-provided storage.
bool mpipe_value_is_primitive (const struct mpipe_value *value)
 Check if a value is of a primitive type.
void mpipe_value_print (const struct mpipe_value *value, bool new_line)
 Print a value.

Detailed Description

Value: one typed scalar or range inside a capability.