|
struct buffer * | buffer_init (struct buffer_base *base, uint32_t len, uint32_t sizeOfEntry, bool readOnly, uint32_t irqnr) |
|
int32_t | buffer_deinit (struct buffer *buffer) |
|
int32_t | buffer_is_full (struct buffer *buffer) |
|
bool | buffer_empty (struct buffer *buffer) |
|
int32_t | buffer_write (struct buffer *buffer, uint8_t *data, int32_t size) |
|
int32_t | buffer_read (struct buffer *buffer, uint8_t *data, int32_t size, TickType_t waittime) |
|
Shared Memmory driver for heterogeneous Multicore Possessor
◆ BUFFER_EINVAL
Error Code return if Argument not valid
◆ BUFFER_NO_SPACE_LEFT
#define BUFFER_NO_SPACE_LEFT -2 |
Error Code return if no space Left on BUffer
◆ BUFFER_OPERATION_NOT_SUPPORTED
#define BUFFER_OPERATION_NOT_SUPPORTED -1 |
Error Code return if Operation not Supported
◆ SHARED_MAGIC
#define SHARED_MAGIC 0x42424343 |
Magic Number used to detect memory is already initialized
◆ buffer_deinit()
int32_t buffer_deinit |
( |
struct buffer * |
buffer | ) |
|
Deinit Buffer Instance
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ buffer_empty()
bool buffer_empty |
( |
struct buffer * |
buffer | ) |
|
Check Buffer is empty
- Parameters
-
- Returns
- true = buffer empty false = buffer not empty
◆ buffer_init()
struct buffer* buffer_init |
( |
struct buffer_base * |
base, |
|
|
uint32_t |
len, |
|
|
uint32_t |
sizeOfEntry, |
|
|
bool |
readOnly, |
|
|
uint32_t |
irqnr |
|
) |
| |
Init Buffer Instance
- Parameters
-
base | Base Pointer in SRAM |
len | Length of Buffer shall Power of 2 |
sizeOfEntry | Size of one Entry in Buffer shall Power of 2 |
readOnly | one Buffer Instance is unidirectional read only or write only |
irqnr | IRQ Nummber |
- Returns
- Buffer Instance or NULL on error
◆ buffer_is_full()
int32_t buffer_is_full |
( |
struct buffer * |
buffer | ) |
|
Check Buffer is full
- Parameters
-
- Returns
- Return 0 on is full else space left on buffer
◆ buffer_read()
int32_t buffer_read |
( |
struct buffer * |
buffer, |
|
|
uint8_t * |
data, |
|
|
int32_t |
size, |
|
|
TickType_t |
waittime |
|
) |
| |
read one entry from buffer. This Function blocks until data is in Buffer. The function read until buffer is empty or user pointer is full. If waittime == 0 function is unblocking!
- Parameters
-
buffer | Buffer Instance |
data | Data to write |
size | Size of writing data in entrys! Not in bytes |
waittime | max waittime in ISR lock see xSemaphoreTake() |
- Returns
- < 0 on error >= 0 size read from buffer
◆ buffer_write()
int32_t buffer_write |
( |
struct buffer * |
buffer, |
|
|
uint8_t * |
data, |
|
|
int32_t |
size |
|
) |
| |
Write one entry from buffer
- Parameters
-
buffer | Buffer Instance |
data | Data to write |
size | Size of writing data in entrys! Not in bytes |
- Returns
- < 0 on error >= 0 size write to buffer