ringbuffer_init

Ring buffer init.

int32_t ringbuffer_init(
    struct ringbuffer *const rb,
    void * buf,
    uint32_t size
)

Parameters

rb

Type: struct ringbuffer Struct *const

The pointer to a ring buffer structure instance

buf

Type: void *

Space to store the data

size

Type: uint32_t

The buffer length, must be aligned with power of 2

Returns

Type: int32_t

ERR_NONE on success, or an error code on failure.