agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
vm_io.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 ykat UG (haftungsbeschraenkt) - All Rights Reserved
3  *
4  * Permission for non-commercial use is hereby granted,
5  * free of charge, without warranty of any kind.
6  */
7 #ifndef ZRTOS_VM_IO_H
8 #define ZRTOS_VM_IO_H
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 
14 #include <zrtos/types.h>
15 
16 
17 typedef enum{
28 
29 typedef enum{
34 
38 
41 
43 
46 
48  return type >= ZRTOS_VM_IO_TYPE__UINT8
49  && type <= ZRTOS_VM_IO_TYPE__UINT64
50  ;
51 }
52 
54  return (type >= ZRTOS_VM_IO_TYPE__INT8
55  && type <= ZRTOS_VM_IO_TYPE__INT32
56  )|| type == ZRTOS_VM_IO_TYPE__INT64
57  ;
58 }
59 
61  return type == ZRTOS_VM_IO_TYPE__FLOAT;
62 }
63 
65  return type == ZRTOS_VM_IO_TYPE__DOUBLE;
66 }
67 
69  size_t length = type;
70  length += 1;
71  if(type == ZRTOS_VM_IO_TYPE__FLOAT){
72  length = 4;
73  }else if(type == ZRTOS_VM_IO_TYPE__DOUBLE){
74  length = 8;
75  }
76  return length;
77 }
78 
79 typedef enum{
84 
86 
90 
98 
100  size_t address;
103 
104 
105 
107  return thiz->address;
108 }
109 
111  return (thiz->type & ZRTOS_VM_IO_ADDRESS_TYPE__IS_NEGATIVE) > 0;
112 }
113 
116 }
117 
120 }
121 
123  return (thiz->type & ZRTOS_VM_IO_ADDRESS_TYPE__SOURCE_PROGRAM) > 0;
124 }
125 
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 #endif
size_t zrtos_vm_io_address__get_address(zrtos_vm_io_address_t *thiz)
Definition: vm_io.h:106
bool zrtos_vm_io_address__is_negative(zrtos_vm_io_address_t *thiz)
Definition: vm_io.h:110
bool zrtos_vm_io_type__is_double(zrtos_vm_io_type_t type)
Definition: vm_io.h:64
bool zrtos_vm_io_type__is_int(zrtos_vm_io_type_t type)
Definition: vm_io.h:53
size_t zrtos_vm_io_type__get_length(zrtos_vm_io_type_t type)
Definition: vm_io.h:68
zrtos_vm_io_address_type_t
Definition: vm_io.h:79
zrtos_vm_io_address_type_t type
Definition: vm_io.h:101
bool zrtos_vm_io_type__is_uint(zrtos_vm_io_type_t type)
Definition: vm_io.h:47
bool zrtos_vm_io_address__is_relative(zrtos_vm_io_address_t *thiz)
Definition: vm_io.h:114
zrtos_vm_io_source_t
Definition: vm_io.h:17
bool zrtos_vm_io_address__is_source_program(zrtos_vm_io_address_t *thiz)
Definition: vm_io.h:122
struct _zrtos_vm_io_source_address_t zrtos_vm_io_address_t
size_t zrtos_vm_io_address__get_length(zrtos_vm_io_address_t *thiz)
Definition: vm_io.h:118
bool zrtos_vm_io_type__is_float(zrtos_vm_io_type_t type)
Definition: vm_io.h:60
zrtos_vm_io_type_t
Definition: vm_io.h:29