no-OS
circular_buffer.h
Go to the documentation of this file.
1 /***************************************************************************/
41 #ifndef CIRCULAR_BUFFER_H
42 #define CIRCULAR_BUFFER_H
43 
44 /******************************************************************************/
45 /***************************** Include Files **********************************/
46 /******************************************************************************/
47 
48 #include <stdint.h>
49 
50 /******************************************************************************/
51 /*************************** Types Declarations *******************************/
52 /******************************************************************************/
53 
59 struct circular_buffer;
60 
61 /******************************************************************************/
62 /************************ Functions Declarations ******************************/
63 /******************************************************************************/
64 
65 int32_t cb_init(struct circular_buffer **desc, uint32_t size);
66 int32_t cb_remove(struct circular_buffer *desc);
67 int32_t cb_size(struct circular_buffer *desc, uint32_t *size);
68 
69 int32_t cb_write(struct circular_buffer *desc, const void *data,
70  uint32_t nb_elements);
71 int32_t cb_read(struct circular_buffer *desc, void *data, uint32_t nb_elements);
72 
73 int32_t cb_prepare_async_write(struct circular_buffer *desc,
74  uint32_t raw_size_to_write,
75  void **write_buff,
76  uint32_t *raw_size_avilable);
77 int32_t cb_end_async_write(struct circular_buffer *desc);
78 
79 int32_t cb_prepare_async_read(struct circular_buffer *desc,
80  uint32_t raw_size_to_read,
81  void **read_buff,
82  uint32_t *raw_size_avilable);
83 int32_t cb_end_async_read(struct circular_buffer *desc);
84 
85 #endif
cb_end_async_write
int32_t cb_end_async_write(struct circular_buffer *desc)
cb_prepare_async_write
int32_t cb_prepare_async_write(struct circular_buffer *desc, uint32_t raw_size_to_write, void **write_buff, uint32_t *raw_size_avilable)
cb_prepare_async_read
int32_t cb_prepare_async_read(struct circular_buffer *desc, uint32_t raw_size_to_read, void **read_buff, uint32_t *raw_size_avilable)
cb_remove
int32_t cb_remove(struct circular_buffer *desc)
cb_init
int32_t cb_init(struct circular_buffer **desc, uint32_t size)
cb_size
int32_t cb_size(struct circular_buffer *desc, uint32_t *size)
cb_write
int32_t cb_write(struct circular_buffer *desc, const void *data, uint32_t nb_elements)
cb_end_async_read
int32_t cb_end_async_read(struct circular_buffer *desc)
cb_read
int32_t cb_read(struct circular_buffer *desc, void *data, uint32_t nb_elements)