My Project
 All Classes Functions Variables Pages
Public Member Functions | List of all members
Ringbuffer Class Reference

Ringbuffer. More...

#include <FreeRTOS.h>

Public Member Functions

 Ringbuffer (size_t length, ringbuf_type_t type=RINGBUF_TYPE_NOSPLIT)
 Create a ring buffer. More...
 
void * receive (size_t *size, TickType_t wait=portMAX_DELAY)
 Receive data from the buffer. More...
 
void returnItem (void *item)
 Return an item. More...
 
bool send (void *data, size_t length, TickType_t wait=portMAX_DELAY)
 Send data to the buffer. More...
 

Detailed Description

Ringbuffer.

Constructor & Destructor Documentation

Ringbuffer::Ringbuffer ( size_t  length,
ringbuf_type_t  type = RINGBUF_TYPE_NOSPLIT 
)

Create a ring buffer.

Parameters
[in]lengthThe amount of storage to allocate for the ring buffer.
[in]typeThe type of buffer. One of RINGBUF_TYPE_NOSPLIT, RINGBUF_TYPE_ALLOWSPLIT, RINGBUF_TYPE_BYTEBUF.

Member Function Documentation

void * Ringbuffer::receive ( size_t *  size,
TickType_t  wait = portMAX_DELAY 
)

Receive data from the buffer.

Parameters
[out]sizeOn return, the size of data returned.
[in]waitHow long to wait.
Returns
A pointer to the storage retrieved.
void Ringbuffer::returnItem ( void *  item)

Return an item.

Parameters
[in]itemThe item to be returned/released.
bool Ringbuffer::send ( void *  data,
size_t  length,
TickType_t  wait = portMAX_DELAY 
)

Send data to the buffer.

Parameters
[in]dataThe data to place into the buffer.
[in]lengthThe length of data to place into the buffer.
[in]waitHow long to wait before giving up. The default is to wait indefinitely.
Returns

The documentation for this class was generated from the following files: