no-OS
no_os_circular_buffer.h
Go to the documentation of this file.
1 /***************************************************************************/
35 #ifndef _NO_OS_CIRCULAR_BUFFER_H_
36 #define _NO_OS_CIRCULAR_BUFFER_H_
37 
38 /******************************************************************************/
39 /***************************** Include Files **********************************/
40 /******************************************************************************/
41 
42 #include <stdint.h>
43 
44 /******************************************************************************/
45 /*************************** Types Declarations *******************************/
46 /******************************************************************************/
47 
52 struct no_os_cb_ptr {
54  uint32_t idx;
56  uint32_t spin_count;
60  uint32_t async_size;
61 };
62 
69  uint32_t size;
71  int8_t *buff;
76 };
77 
78 /******************************************************************************/
79 /************************ Functions Declarations ******************************/
80 /******************************************************************************/
81 
82 int32_t no_os_cb_init(struct no_os_circular_buffer **desc, uint32_t size);
83 /* Configure cb structure with given parameters without memory allocation */
84 int32_t no_os_cb_cfg(struct no_os_circular_buffer *desc, int8_t *buf,
85  uint32_t size);
86 int32_t no_os_cb_remove(struct no_os_circular_buffer *desc);
87 int32_t no_os_cb_size(struct no_os_circular_buffer *desc, uint32_t *size);
88 
89 int32_t no_os_cb_write(struct no_os_circular_buffer *desc, const void *data,
90  uint32_t nb_elements);
91 int32_t no_os_cb_read(struct no_os_circular_buffer *desc, void *data,
92  uint32_t nb_elements);
93 
95  uint32_t raw_size_to_write,
96  void **write_buff,
97  uint32_t *raw_size_avilable);
99 
101  uint32_t raw_size_to_read,
102  void **read_buff,
103  uint32_t *raw_size_avilable);
104 int32_t no_os_cb_end_async_read(struct no_os_circular_buffer *desc);
105 
106 #endif //_NO_OS_CIRCULAR_BUFFER_H_
no_os_circular_buffer::read
struct no_os_cb_ptr read
Definition: no_os_circular_buffer.h:75
no_os_cb_ptr
Circular buffer pointer.
Definition: no_os_circular_buffer.h:52
no_os_cb_ptr::idx
uint32_t idx
Definition: no_os_circular_buffer.h:54
no_os_circular_buffer::buff
int8_t * buff
Definition: no_os_circular_buffer.h:71
no_os_cb_prepare_async_write
int32_t no_os_cb_prepare_async_write(struct no_os_circular_buffer *desc, uint32_t raw_size_to_write, void **write_buff, uint32_t *raw_size_avilable)
no_os_circular_buffer::size
uint32_t size
Definition: no_os_circular_buffer.h:69
no_os_cb_end_async_write
int32_t no_os_cb_end_async_write(struct no_os_circular_buffer *desc)
no_os_cb_ptr::async_started
bool async_started
Definition: no_os_circular_buffer.h:58
no_os_cb_ptr::async_size
uint32_t async_size
Definition: no_os_circular_buffer.h:60
no_os_cb_prepare_async_read
int32_t no_os_cb_prepare_async_read(struct no_os_circular_buffer *desc, uint32_t raw_size_to_read, void **read_buff, uint32_t *raw_size_avilable)
no_os_cb_init
int32_t no_os_cb_init(struct no_os_circular_buffer **desc, uint32_t size)
no_os_cb_remove
int32_t no_os_cb_remove(struct no_os_circular_buffer *desc)
no_os_cb_cfg
int32_t no_os_cb_cfg(struct no_os_circular_buffer *desc, int8_t *buf, uint32_t size)
no_os_cb_write
int32_t no_os_cb_write(struct no_os_circular_buffer *desc, const void *data, uint32_t nb_elements)
no_os_circular_buffer
Circular buffer descriptor.
Definition: no_os_circular_buffer.h:67
no_os_cb_size
int32_t no_os_cb_size(struct no_os_circular_buffer *desc, uint32_t *size)
no_os_circular_buffer::write
struct no_os_cb_ptr write
Definition: no_os_circular_buffer.h:73
no_os_cb_end_async_read
int32_t no_os_cb_end_async_read(struct no_os_circular_buffer *desc)
no_os_cb_ptr::spin_count
uint32_t spin_count
Definition: no_os_circular_buffer.h:56
no_os_cb_read
int32_t no_os_cb_read(struct no_os_circular_buffer *desc, void *data, uint32_t nb_elements)