oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
types.h
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
16#ifndef OVE_TYPES_H
17#define OVE_TYPES_H
18
19#include <stddef.h>
20#include <stdint.h>
21
23#define OVE_OK 0
24
26#define OVE_ERR_NOT_REGISTERED (-1)
27
29#define OVE_ERR_INVALID_PARAM (-2)
30
32#define OVE_ERR_NO_MEMORY (-3)
33
35#define OVE_ERR_TIMEOUT (-4)
36
38#define OVE_ERR_NOT_SUPPORTED (-5)
39
41#define OVE_ERR_QUEUE_FULL (-6)
42
44#define OVE_ERR_ML_FAILED (-7)
45
47#define OVE_ERR_NET_REFUSED (-8)
48
50#define OVE_ERR_NET_UNREACHABLE (-9)
51
53#define OVE_ERR_NET_ADDR_IN_USE (-10)
54
56#define OVE_ERR_NET_RESET (-11)
57
59#define OVE_ERR_NET_DNS_FAIL (-12)
60
62#define OVE_ERR_NET_CLOSED (-13)
63
65#define OVE_ERR_BUS_NACK (-14)
66
68#define OVE_ERR_BUS_BUSY (-15)
69
71#define OVE_ERR_BUS_ERROR (-16)
72
79#define OVE_WAIT_FOREVER UINT32_MAX
80
82typedef struct ove_thread *ove_thread_t;
83
85typedef struct ove_mutex *ove_mutex_t;
86
88typedef struct ove_sem *ove_sem_t;
89
91typedef struct ove_event *ove_event_t;
92
94typedef struct ove_condvar *ove_condvar_t;
95
97typedef struct ove_eventgroup *ove_eventgroup_t;
98
100typedef struct ove_workqueue *ove_workqueue_t;
101
103typedef struct ove_work *ove_work_t;
104
106typedef struct ove_stream *ove_stream_t;
107
109typedef struct ove_watchdog *ove_watchdog_t;
110
112typedef struct ove_file *ove_file_t;
113
115typedef struct ove_dir *ove_dir_t;
116
118typedef struct ove_model *ove_model_t;
119
121typedef struct ove_socket *ove_socket_t;
122
124typedef struct ove_netif *ove_netif_t;
125
127typedef struct ove_tls *ove_tls_t;
128
130typedef struct ove_http_client *ove_http_client_t;
131
133typedef struct ove_mqtt_client *ove_mqtt_client_t;
134
136typedef struct ove_uart *ove_uart_t;
137
139typedef struct ove_spi *ove_spi_t;
140
142typedef struct ove_i2c *ove_i2c_t;
143
145typedef struct ove_i2s *ove_i2s_t;
146
153typedef uint32_t ove_eventbits_t;
154
155/* RTOS name string (compile-time) */
156#include "ove_config.h"
157
165#if defined(CONFIG_OVE_RTOS_FREERTOS)
166#define OVE_RTOS_NAME "FreeRTOS"
167#elif defined(CONFIG_OVE_RTOS_ZEPHYR)
168#define OVE_RTOS_NAME "Zephyr"
169#elif defined(CONFIG_OVE_RTOS_NUTTX)
170#define OVE_RTOS_NAME "NuttX"
171#elif defined(CONFIG_OVE_RTOS_POSIX)
172#define OVE_RTOS_NAME "POSIX"
173#else
174#define OVE_RTOS_NAME "Unknown"
175#endif
176
177#endif /* OVE_TYPES_H */
178
struct ove_mqtt_client * ove_mqtt_client_t
Opaque handle for an MQTT client.
Definition types.h:133
struct ove_spi * ove_spi_t
Opaque handle for an SPI bus controller.
Definition types.h:139
struct ove_netif * ove_netif_t
Opaque handle for a network interface.
Definition types.h:124
struct ove_eventgroup * ove_eventgroup_t
Opaque handle for an event-group (bit-field) object.
Definition types.h:97
struct ove_thread * ove_thread_t
Opaque handle for a thread object.
Definition types.h:82
struct ove_i2s * ove_i2s_t
Opaque handle for an I2S / SAI bus controller.
Definition types.h:145
struct ove_tls * ove_tls_t
Opaque handle for a TLS session.
Definition types.h:127
struct ove_uart * ove_uart_t
Opaque handle for a UART peripheral.
Definition types.h:136
uint32_t ove_eventbits_t
Bit-mask type used by the event-group API.
Definition types.h:153
struct ove_stream * ove_stream_t
Opaque handle for a byte-stream (ring-buffer) object.
Definition types.h:106
struct ove_event * ove_event_t
Opaque handle for a binary event (signal/wait) object.
Definition types.h:91
struct ove_dir * ove_dir_t
Opaque handle for an open directory.
Definition types.h:115
struct ove_sem * ove_sem_t
Opaque handle for a counting semaphore object.
Definition types.h:88
struct ove_condvar * ove_condvar_t
Opaque handle for a condition variable object.
Definition types.h:94
struct ove_mutex * ove_mutex_t
Opaque handle for a mutex object.
Definition types.h:85
struct ove_workqueue * ove_workqueue_t
Opaque handle for a work queue object.
Definition types.h:100
struct ove_watchdog * ove_watchdog_t
Opaque handle for a software watchdog object.
Definition types.h:109
struct ove_i2c * ove_i2c_t
Opaque handle for an I2C bus controller.
Definition types.h:142
struct ove_socket * ove_socket_t
Opaque handle for a network socket.
Definition types.h:121
struct ove_file * ove_file_t
Opaque handle for an open file.
Definition types.h:112
struct ove_model * ove_model_t
Opaque handle for an ML inference model session.
Definition types.h:118
struct ove_http_client * ove_http_client_t
Opaque handle for an HTTP client.
Definition types.h:130
struct ove_work * ove_work_t
Opaque handle for a deferred work item.
Definition types.h:103