oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
Macros | Typedefs | Enumerations | Functions
Types

Common error codes, opaque handle types, and utility macros used throughout the oveRTOS public API. More...

Macros

#define OVE_NONNULL(...)
 
#define OVE_NODISCARD
 
#define OVE_RETURNS_NONNULL
 
#define OVE_DEPRECATED(msg)
 
#define OVE_WAIT_FOREVER   UINT64_MAX
 Timeout value that means "block indefinitely".
 
#define OVE_STATIC_ASSERT(cond, msg)   _Static_assert(cond, msg)
 
#define OVE_RTOS_NAME   "FreeRTOS"
 Compile-time string identifying the active RTOS backend.
 

Typedefs

typedef struct ove_thread * ove_thread_t
 Opaque handle for a thread object.
 
typedef struct ove_mutex * ove_mutex_t
 Opaque handle for a mutex object.
 
typedef struct ove_sem * ove_sem_t
 Opaque handle for a counting semaphore object.
 
typedef struct ove_event * ove_event_t
 Opaque handle for a binary event (signal/wait) object.
 
typedef struct ove_condvar * ove_condvar_t
 Opaque handle for a condition variable object.
 
typedef struct ove_eventgroup * ove_eventgroup_t
 Opaque handle for an event-group (bit-field) object.
 
typedef struct ove_workqueue * ove_workqueue_t
 Opaque handle for a work queue object.
 
typedef struct ove_work * ove_work_t
 Opaque handle for a deferred work item.
 
typedef struct ove_stream * ove_stream_t
 Opaque handle for a byte-stream (ring-buffer) object.
 
typedef struct ove_watchdog * ove_watchdog_t
 Opaque handle for a software watchdog object.
 
typedef struct ove_file * ove_file_t
 Opaque handle for an open file.
 
typedef struct ove_dir * ove_dir_t
 Opaque handle for an open directory.
 
typedef struct ove_model * ove_model_t
 Opaque handle for an ML inference model session.
 
typedef struct ove_socket * ove_socket_t
 Opaque handle for a network socket.
 
typedef struct ove_netif * ove_netif_t
 Opaque handle for a network interface.
 
typedef struct ove_tls * ove_tls_t
 Opaque handle for a TLS session.
 
typedef struct ove_http_client * ove_http_client_t
 Opaque handle for an HTTP client.
 
typedef struct ove_mqtt_client * ove_mqtt_client_t
 Opaque handle for an MQTT client.
 
typedef struct ove_uart * ove_uart_t
 Opaque handle for a UART peripheral.
 
typedef struct ove_spi * ove_spi_t
 Opaque handle for an SPI bus controller.
 
typedef struct ove_i2c * ove_i2c_t
 Opaque handle for an I2C bus controller.
 
typedef struct ove_i2s * ove_i2s_t
 Opaque handle for an I2S / SAI bus controller.
 
typedef uint32_t ove_eventbits_t
 Bit-mask type used by the event-group API.
 
typedef void(* ove_notify_cb) (void *user_data)
 Notify-callback signature used by the _set_notify variants of the comm primitives (stream / queue / eventgroup / semaphore).
 
typedef void(* ove_dma_complete_cb) (int result, void *user_data)
 DMA / async transfer completion callback signature.
 

Enumerations

enum  ove_err_t {
  OVE_OK = 0 , OVE_ERR_NOT_REGISTERED = -1 , OVE_ERR_INVALID_PARAM = -2 , OVE_ERR_NO_MEMORY = -3 ,
  OVE_ERR_TIMEOUT = -4 , OVE_ERR_NOT_SUPPORTED = -5 , OVE_ERR_QUEUE_FULL = -6 , OVE_ERR_ML_FAILED = -7 ,
  OVE_ERR_NET_REFUSED = -8 , OVE_ERR_NET_UNREACHABLE = -9 , OVE_ERR_NET_ADDR_IN_USE = -10 , OVE_ERR_NET_RESET = -11 ,
  OVE_ERR_NET_DNS_FAIL = -12 , OVE_ERR_NET_CLOSED = -13 , OVE_ERR_BUS_NACK = -14 , OVE_ERR_BUS_BUSY = -15 ,
  OVE_ERR_BUS_ERROR = -16 , OVE_ERR_QUEUE_EMPTY = -17 , OVE_ERR_WOULD_BLOCK = -18 , OVE_ERR_EOF = -19 ,
  OVE_ERR_INVAL = -20 , OVE_ERR_NOT_FOUND = -21
}
 oveRTOS error codes. More...
 

Functions

 OVE_STATIC_ASSERT (OVE_ERR_NOT_REGISTERED==-1, "OVE_ERR_NOT_REGISTERED drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_INVALID_PARAM==-2, "OVE_ERR_INVALID_PARAM drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NO_MEMORY==-3, "OVE_ERR_NO_MEMORY drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_TIMEOUT==-4, "OVE_ERR_TIMEOUT drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NOT_SUPPORTED==-5, "OVE_ERR_NOT_SUPPORTED drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_QUEUE_FULL==-6, "OVE_ERR_QUEUE_FULL drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_ML_FAILED==-7, "OVE_ERR_ML_FAILED drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NET_REFUSED==-8, "OVE_ERR_NET_REFUSED drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NET_UNREACHABLE==-9, "OVE_ERR_NET_UNREACHABLE drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NET_ADDR_IN_USE==-10, "OVE_ERR_NET_ADDR_IN_USE drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NET_RESET==-11, "OVE_ERR_NET_RESET drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NET_DNS_FAIL==-12, "OVE_ERR_NET_DNS_FAIL drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NET_CLOSED==-13, "OVE_ERR_NET_CLOSED drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_BUS_NACK==-14, "OVE_ERR_BUS_NACK drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_BUS_BUSY==-15, "OVE_ERR_BUS_BUSY drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_BUS_ERROR==-16, "OVE_ERR_BUS_ERROR drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_QUEUE_EMPTY==-17, "OVE_ERR_QUEUE_EMPTY drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_WOULD_BLOCK==-18, "OVE_ERR_WOULD_BLOCK drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_EOF==-19, "OVE_ERR_EOF drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_INVAL==-20, "OVE_ERR_INVAL drifted")
 
 OVE_STATIC_ASSERT (OVE_ERR_NOT_FOUND==-21, "OVE_ERR_NOT_FOUND drifted")
 
 OVE_STATIC_ASSERT (OVE_WAIT_FOREVER==UINT64_MAX, "OVE_WAIT_FOREVER drifted")
 

Detailed Description

Common error codes, opaque handle types, and utility macros used throughout the oveRTOS public API.

Macro Definition Documentation

◆ OVE_WAIT_FOREVER

#define OVE_WAIT_FOREVER   UINT64_MAX

Timeout value that means "block indefinitely".

Pass this as the timeout_ns argument to any blocking API (or as the deadline_ns argument to an _until variant) to wait without a deadline.

◆ OVE_RTOS_NAME

#define OVE_RTOS_NAME   "FreeRTOS"

Compile-time string identifying the active RTOS backend.

Resolved to a human-readable string literal ("FreeRTOS", "Zephyr", "NuttX", "POSIX", or "Unknown") based on which CONFIG_OVE_RTOS_* symbol is defined in ove_config.h.

Typedef Documentation

◆ ove_thread_t

typedef struct ove_thread* ove_thread_t

Opaque handle for a thread object.

See also
ove_thread_init, ove_thread_create

◆ ove_mutex_t

typedef struct ove_mutex* ove_mutex_t

Opaque handle for a mutex object.

See also
ove_mutex_init, ove_mutex_create

◆ ove_sem_t

typedef struct ove_sem* ove_sem_t

Opaque handle for a counting semaphore object.

See also
ove_sem_init, ove_sem_create

◆ ove_event_t

typedef struct ove_event* ove_event_t

Opaque handle for a binary event (signal/wait) object.

See also
ove_event_init, ove_event_create

◆ ove_condvar_t

typedef struct ove_condvar* ove_condvar_t

Opaque handle for a condition variable object.

See also
ove_condvar_init, ove_condvar_create

◆ ove_model_t

typedef struct ove_model* ove_model_t

Opaque handle for an ML inference model session.

See also
ove_model_init, ove_model_create

◆ ove_socket_t

typedef struct ove_socket* ove_socket_t

Opaque handle for a network socket.

See also
ove_socket_open, ove_socket_create

◆ ove_netif_t

typedef struct ove_netif* ove_netif_t

Opaque handle for a network interface.

See also
ove_netif_init, ove_netif_create

◆ ove_tls_t

typedef struct ove_tls* ove_tls_t

Opaque handle for a TLS session.

See also
ove_tls_init, ove_tls_create

◆ ove_http_client_t

typedef struct ove_http_client* ove_http_client_t

Opaque handle for an HTTP client.

See also
ove_http_client_init, ove_http_client_create

◆ ove_mqtt_client_t

typedef struct ove_mqtt_client* ove_mqtt_client_t

Opaque handle for an MQTT client.

See also
ove_mqtt_client_init, ove_mqtt_client_create

◆ ove_uart_t

typedef struct ove_uart* ove_uart_t

Opaque handle for a UART peripheral.

See also
ove_uart_init, ove_uart_create

◆ ove_spi_t

typedef struct ove_spi* ove_spi_t

Opaque handle for an SPI bus controller.

See also
ove_spi_init, ove_spi_create

◆ ove_i2c_t

typedef struct ove_i2c* ove_i2c_t

Opaque handle for an I2C bus controller.

See also
ove_i2c_init, ove_i2c_create

◆ ove_i2s_t

typedef struct ove_i2s* ove_i2s_t

Opaque handle for an I2S / SAI bus controller.

See also
ove_i2s_init, ove_i2s_create

◆ ove_eventbits_t

typedef uint32_t ove_eventbits_t

Bit-mask type used by the event-group API.

Each bit represents a distinct event flag. Up to 32 independent flags can be combined in a single event group.

◆ ove_notify_cb

typedef void(* ove_notify_cb) (void *user_data)

Notify-callback signature used by the _set_notify variants of the comm primitives (stream / queue / eventgroup / semaphore).

Invoked from inside the producing call (e.g. ove_stream_send) after a successful update. The implementation must be short, non-blocking, and safe to call from whatever context the originating send/give/set ran in — typically a Rust AtomicWaker::wake bridge for the async runtime.

Note
The _set_notify registration is setup-time only: it is NOT safe to call concurrently with producing operations on the same primitive, since those read the callback pointer without synchronisation. Register the callback once before the primitive is shared across contexts (the async bridge registers it at construction).
Parameters
[in]user_dataOpaque pointer supplied at _set_notify time.

◆ ove_dma_complete_cb

typedef void(* ove_dma_complete_cb) (int result, void *user_data)

DMA / async transfer completion callback signature.

Invoked by ove_spi_transfer_async / ove_i2c_write_read_async (and similar) when a transfer finishes. Runs in whatever context the backend's completion fires in: ISR on real DMA-capable hardware (STM32F7 HAL), thread on simulator / worker-thread fallback paths. Implementations must be non-blocking and ISR-safe.

Parameters
[in]resultOVE_OK on success, negative OVE_ERR_* on failure.
[in]user_dataOpaque pointer passed to the _async call.

Enumeration Type Documentation

◆ ove_err_t

enum ove_err_t

oveRTOS error codes.

Convention: zero (OVE_OK) on success, negative values on error. Numeric values are pinned by the _Static_assert block below — the names and codes form the stable C ABI between substrate and bindings.

Function APIs return int (not ove_err_t) for ABI compatibility and to keep the int rc = ...; if (rc < 0) idiom unchanged. Bindings consume the typed enum via bindgen / @cImport.

Enumerator
OVE_OK 

Operation completed successfully.

OVE_ERR_NOT_REGISTERED 

The requested backend or feature has not been registered.

OVE_ERR_INVALID_PARAM 

One or more parameters are invalid (e.g. NULL pointer, zero size).

OVE_ERR_NO_MEMORY 

Dynamic allocation failed — heap is full or not available.

OVE_ERR_TIMEOUT 

Operation timed out before it could complete.

OVE_ERR_NOT_SUPPORTED 

The requested feature is not supported by the active backend.

OVE_ERR_QUEUE_FULL 

Queue send failed because the queue is at maximum capacity.

OVE_ERR_ML_FAILED 

ML inference or model loading failed.

OVE_ERR_NET_REFUSED 

Remote peer refused the connection.

OVE_ERR_NET_UNREACHABLE 

Network or host is unreachable.

OVE_ERR_NET_ADDR_IN_USE 

Local address already in use.

OVE_ERR_NET_RESET 

Connection was reset by the remote peer.

OVE_ERR_NET_DNS_FAIL 

DNS name resolution failed.

OVE_ERR_NET_CLOSED 

Connection closed by the remote peer.

OVE_ERR_BUS_NACK 

Bus device did not acknowledge (I2C NACK).

OVE_ERR_BUS_BUSY 

Bus arbitration lost (multi-master).

OVE_ERR_BUS_ERROR 

Framing, parity, or hardware error on a serial bus.

OVE_ERR_QUEUE_EMPTY 

Queue receive failed because the queue is empty.

OVE_ERR_WOULD_BLOCK 

Non-blocking operation would have to block.

Returned by zero-timeout / ISR variants of blocking APIs when the requested resource is unavailable. More general than OVE_ERR_QUEUE_FULL / OVE_ERR_QUEUE_EMPTY; suitable for mutex/sem/etc. non-blocking paths.

OVE_ERR_EOF 

End of file / directory iterator exhausted.

OVE_ERR_INVAL 

Argument or state is invalid for this operation.

OVE_ERR_NOT_FOUND 

Requested key / entry / resource was not found.